Mendelian Randomisation

type
status
date
slug
summary
tags
category
icon
password
image

The Tutorial of Mendelian Randomisation

1. download the software

notion image

2. click the subMR.exe

notion image
I shared the "workDir.zip" with Quark network disk, you can open the link through your browser to download and extract the zip to the working path.
Take the working path D:/appTest/mr/workDir as an example:
1kg.v3 and plinkbinr folders should be placed under the working path!
notion image

3. Fill the setting

For convenience, I use the rows and columns as the coordinates of the buttons, such as (1,1) represents “WorkDir” which is a show-lineEdit.
  1. Working environment
    1. WorkDir: All results are placed under the work path with subfolder as WorkDir/mrProject/Project Name/
      1. you can click (1,2) “WorkDir” to choose your working folder of this project.
      2. Of course, you can also edit (1,1) “WorkDir” manually.
    2. R Path or Server Address:
      1. you can click (1,4) “R Path” to choose your R environment on your PC like I:/App/R/R-4.3.3.
        1. notion image
      2. Of course, you can also edit (1,3) “R Path or Server Address” manually by using a R path.
      3. If you have a linux R server environment, you can edit (1,3) “R Path or Server Address” manually by using a host:port like 127.0.0.1:6311
        1. notion image
    3. Project Name:
      1. you can edit (1,5) “Project Name” manually.
  1. Batch Mendelian randomization analysis software
    1. The folder path of Expose or clumped data:
      1. if your data are in vcf format:
        1. you can click (1,2) “The folder path of vcf data” to choose your folder path of vcf data.
        2. Of course, you can also edit (1,1) “The folder path of vcf format gwas data” manually.
        3. then you can Convert data format by click (1,3) “0-Trans vcf to csv”, the results will in the vcf2csv folder under the work path.
        4. The you can choose the vcf2csv folder as “The folder path of Expose or clumped data”
        5. Of course, you can trans by the code like:
      2. if your data are not in vcf format,like csv,txt,tsv or in .gz compression format:
        1. you can click (2,2) “Choose Exp Dir” to choose your “The folder path of Expose or clumped data” folder of this project.
        2. Of course, you can also edit (2,1) “The folder path of Expose or clumped data” manually.
        3. if the “The folder path of Expose or clumped data” is the folder without clumping, you need to check (4,2) “Whether clump” to make clumping; otherwise, if the “The folder path of Expose or clumped data” is the folder after clumping, you need to uncheck (4,2) “Whether clump”.Because you only need to clump once with specific parameters, at the same time, we will save the clumping data under the WorkDir.
    2. The folder path of Outcome:
      1. if your data are in vcf format:Please refer to above “The folder path of Expose or clumped data”
      2. if your data are not in vcf format,like csv,txt,tsv or in .gz compression format:
        1. you can click (2,4) “The folder path of Outcome” to choose your working folder of this project.
        2. Of course, you can also edit (2,4) “The folder path of Outcome” manually.
    3. Number of parallel cores:
      1. you can edit (4,1) “Number of parallel cores” manually. If the value =0, which means single-core operations, if the value=4,which means parallel operations with 4 cores.
    4. Expose name index / Outcome name index:
      1. you can edit (5,1) “Expose name index” manually. If the value =0, which means Expose name is the full file name, if the value=4, which means Expose name is 4th str by splitting the full file name with “_”.For example,The file name is a_b_c_d_e.csv, 0 means a_b_c_d_e,4 means d.
      2. you can edit (6,1) “Outcome name index” manually. If the value =0, which means Outcome name is the full file name, if the value=4, which means Outcome name is 4th str by splitting the full file name with “_”.For example,The file name is a_b_c_d_e.csv, 0 means a_b_c_d_e,4 means d.
    5. Generate subgraphs by exposure or outcome:
      1. you can choose (5,2) “Out” manually. If the value =Out, which means Generate subgraphs by outcome, if the value=Exp, which means Generate subgraphs by exposure.
      2. Let's assume the number of exposure file is m,the number of outcome file is n, if m≥n, you can choose “Out”,otherwise,you can choose “Exp”.
    6. Exposure and Outcome SampleSize Ncase path:
      1. if your gwas dataframe do not contain the column of SampleSize and Ncase, you can click (7,2) “SampleSize Ncase” to choose your Exposure and Outcome SampleSize Ncase csv file path like SampleSizeNcaseFile.csv. The software will add them by match the file name.
      2. Of course, you can also edit (7,1) “SampleSize Ncase” manually.
        1. notion image
      3. if you just have one exposure file and one outcome file, you can fill them in there.
      4. notion image
    7. Parameter explanation
      1. Expose p-value:
      2. Outcome p-value:
      3. R-squared value:
      4. F value:
      5. P value of forest
      6. Volcano chart title
      7. Items number in donut diagram
      8. Volcano plot height
      9. Volcano plot width
      10. Donut Width
    8. Run MR:
      1. if the “The folder path of Expose or clumped data” is the folder without clumping, you need to check (4,2) “Whether clump” to make clumping.
        1. First, you can click (4,3) “1-clump analysis” to clump.
        2. then, you can click (4,4) “2-MR analysis”.
        3. then, you can click (4,5) “3- Merge result”.
        4. then, you can click (5,5) “4- Mapping the Forest Volcano”.
        5. then, you can click (6,5) “5-Draw a ring heat map”.
      2. if the “The folder path of Expose or clumped data” is the folder after clumping, you need to uncheck (4,2) “Whether clump”.
        1. First, you can click (4,4) “2-MR analysis”.
        2. then, you can click (4,5) “3- Merge result”.
        3. then, you can click (5,5) “4- Mapping the Forest Volcano”.
        4. then, you can click (6,5) “5-Draw a ring heat map”.
  1. Colocalization analysis software
    1. The folder path of Expose:
      1. you can click (1,2) “Choose Exp Dir” to choose your working folder of this project.
      2. Of course, you can also edit (1,1) “The folder path of Expose” manually.
    2. The folder path of Outcome:
      1. you can click (2,2) “Choose Out Dir” to choose your working folder of this project.
      2. Of course, you can also edit (1,1) “The folder path of Outcome” manually.
    3. Genome format file to be converted:
      1. you can click (3,2) “Path of the folder to be converted” to choose your working folder of this project.
      2. Of course, you can also edit (3,1) “Genome format file to be converted” manually.
    4. Parameter explanation
      1. Up and down range: Upstream and downstream range
      2. variable type: Continuous or Classification
      3. PPH4:PPH4 threshold filtering
      4. genome type: 37 or 38 ⇒ grch37/38
    5. run Colocalization
      1. you can click (2,6) “1- Colocalization analysis and plot”.
      2. Colocalization do not need to run “0-Chromosome format conversion”, but you need to choose right genome type of the data file!
    6. run Chromosome format conversion
      1. you can click (3,4) “0-Chromosome format conversion”,then it will add chr and poc of new Chromosome format by match snp name!