yuanzhongshang / PMR

23 stars 7 forks source link

usage example #2

Closed muzilily closed 10 months ago

muzilily commented 4 years ago

hi, Dr.Yuan Now I have a GWAS result file which contain the informations such as rsID, pavule,OR. I‘m going to run PMR_summary_Egger with the eQTL results from GTEx project. I'm not very clear about the files from the example you have provided in the https://github.com/yuanzhongshang/PMR/tree/master/example. Could you send me a more detail description file or some suggestions?Thanks!

lily

yuanzhongshang commented 4 years ago

Hi Lily, Thanks for your interest for our PMR method. The current PMR version analyze one gene at a time. Overall, the PMR_summary_Egger requires 10 inputs listed below. Zscore_1: the Zscore vector of the cis-SNP of one specific gene in eQTL data. Zscore_2: the Zscore vector of the cis-SNP of one specific gene in GWAS data Sigma1sin: the LD matrix in eQTL data Sigma2sin: the LD matrix in GWAS data, both Sigma2sin and sigma1sin are often the same from the reference panel samplen1: the sample size of eQTL data samplen2: the sample size of GWAS data lambda: The shrinkage parameter to guarantee the sparsity and positive definiteness of the estimated LD matrix (The default value is 0, you can also try another empirical values such as 0.05, 0.1, 0.15, 0.2, 0.25). max_iterin: The maximum iteration, which can be determined by users (the default value is 1000) epsin: The convergence tolerance of the absolute value of the difference between the nth and (n+1)th log likelihood, which can be determined by users (the default value is 1e-05) Heritability_geneexpression_threshold: The threshold for the estimate of gene expression heritability explained by cis-SNPs, which can be determined by users. The causal effect pvalue will be assigned to be NA automatically if the the estimate of gene expression heritability is under this threshold (the default value is1e-04, you can also set it to be 0)

With these inputs, you can try to run the R function PMR_summary_Egger<-function(Zscore_1,Zscore_2,Sigma1sin,Sigma2sin,samplen1,samplen2, lambda=0, max_iterin =1000,epsin=1e-5, Heritability_geneexpression_threshold=1e-04)

The output of PMR_summary_Egger function is a list of estimated parameters including the p values for both the causal effect test and pleiotropy effect test: causal_effect: The estimates of causal effect causal_pvalue: The p value for the causal effect pleiotropy_effect: The estimates of pleiotropy effect pleiotropy_pvalue: The p value for the pleiotropy effect sigma_cisSNP: The variance estimate for the cis-SNP effect sizes sigma_error_1: The variance estimate of the error in eQTL data model sigma_error_2: The variance estimate of the error in GWAS data model

Note that PMR_summary_Egger aim to account for the LD correlation anmong the cis-SNPs and requires a LD correlation matrix among cis-SNPs. You need to estimate the LD matrix first often from a reference panel dataset, such as 1000 Genome Project. LD matrix for the cis-SNPs in the eQTL data (Sigma1sin) and that in the GWAS data (Sigma2sin) may be from the same reference panel data.

Thanks for your interest again. If you have any questions, please don’t hesitate to contact me using github or email (yuanzhongshang@sdu.edu.cn).