xMEsmr | R Documentation |
xMEsmr
is supposed to conduct Summary-data-based Mendelian
Randomisation (SMR) integrating GWAS and eQTL summary data.
xMEsmr(gwas.summary, beqtl.summary, mode = c("both", "cis", "trans"), peqtl = 5e-08, window.cis = 1000, window.trans = 1000, heidi = T, bfile = NULL, heidi.peqtl = 0.00157, heidi.ld = c(0.05, 0.9), heidi.num = c(3, 20), freq.check = F, thread.num = 1, p.adjust.method = c("BH", "BY", "bonferroni", "holm", "hochberg", "hommel"), clear = T, verbose = T, silent = FALSE)
gwas.summary |
an input GWAS summary data file, containing columns 'snp', 'effect allele' (the allele assessed), 'other allele', 'freq' (frequency of the effect allele; not essential unless 'freq.check' is true), 'b' (effect size for the allele assessed; log(odds ratio) for a case-control study), 'se' (standard error), 'p' (p-value) and 'n' (sample size; not required) |
beqtl.summary |
a character specifying where to find eQTL summary data files in the BESD format containing three files (.esi for SNP information, .epi for probe information, and .besd for eQTL summary statistics) |
mode |
a character specifying the SMR and HEIDI test mode. It can be 'cis' for the test in cis regions, 'trans' for the test in trans regions, and 'both' for both regions |
peqtl |
eQTL p-value threshold for selecting a probe (with the top associated eQTL passing a p-value threshold) for the SMR test. In other words, a probe with the top associated eQTL not passing this threshold will be removed for the test. By default, it is 5e-8 |
window.cis |
an integer specifying a window centred around the probe to select cis-eQTLs (passing a p-value threshold) for the SMR test. The default value is 1000Kb |
window.trans |
an integer specifying a window centred around the top associated trans-eQTL to select trans-eQTLs (passing a p-value threshold) for the SMR and HEIDI test. The default value is 1000Kb |
heidi |
logical to indicate whether the HEIDI test is enabled. By default it is true |
bfile |
a character specifying where to find the LD reference data containing three files (.bed, .bim, and .fam). Required if heidi test is enabled (see above) |
heidi.peqtl |
eQTL p-value threshold for selecting eQTLs per probe for the HEIDI test. The default value is 1.57e-3 (a chi-squared value 10 with df=1) |
heidi.ld |
LD r2 threshold used to further prune SNPs (eQTLs) in the HEIDI test. By default only those between 0.05 and 0.9 will be used for the test |
heidi.num |
the number of SNPs (eQTLs) left per probe in the HEIDI test. By default, the test skipped if the number of remaining SNPs is less than 3; and top 20 SNPs (ranked by eQTL p-value) will be used in the test |
freq.check |
logical to indicate whether to remove SNPs withe discrepant allele frequencies between data sets. By default it is disabled |
thread.num |
an integer specifying the number of OpenMP threads for parallel computing. By default it is 1 |
p.adjust.method |
the method used to adjust p-values. It can be one of "BH", "BY", "bonferroni", "holm", "hochberg" and "hommel". The first two methods "BH" (widely used) and "BY" control the false discovery rate (FDR: the expected proportion of false discoveries amongst the rejected hypotheses); the last four methods "bonferroni", "holm", "hochberg" and "hommel" are designed to give strong control of the family-wise error rate (FWER). Notes: FDR is a less stringent condition than FWER |
clear |
logical to indicate whether the temporary and log files are cleared up. By default, it sets to TRUE |
verbose |
logical to indicate whether the messages will be displayed in the screen. By default, it sets to false for no display |
silent |
logical to indicate whether the messages will be silent completely. By default, it sets to false. If true, verbose will be forced to be false |
a data frame with following columns ("mode", "probeID", "Gene", "ProbeChr", "Probe_bp", "topSNP", "topSNP_chr", "topSNP_bp", "A1", "A2", "b_GWAS", "b_eQTL", "b_SMR", "p_GWAS", "p_eQTL", "p_SMR", "fdr_SMR") and, if heidi teste enabled, columns ("p_HEIDI", "fdr_HEIDI", "nsnp_HEIDI")
This function requires the software 'smr' at http://cnsgenomics.com/software/smr. Shell command lines in Terminal (Mac and Linux) are:
1a) Mac: wget
http://cnsgenomics.com/software/smr/download/smr_Mac.zip && unzip
smr_Mac.zip && mv smr_Mac ~/smr
1b) Linux: wget
https://cnsgenomics.com/software/smr/download/smr_Linux.zip && unzip
smr_Linux.zip && mv smr_Linux ~/smr
2a) # Assuming a ROOT (sudo) privilege: sudo cp ~/smr
/usr/local/bin
2b) # Assuming without ROOT (sudo) privilege and adding the
system PATH variable to your ~/.bash_profile file: export
PATH=$HOME:$PATH
xMEsmr
## Not run: # Load the library library(XGR) gwas.summary <- "summary_gwas.RA.txt" beqtl.summary <- "~/Sites/SVN/github/bigdata_dev/Pi_eQTL_hg19/Blood" # only SMR test df_output <- xMEsmr(gwas.summary, beqtl.summary, heidi=F) utils::write.table(df_output, file="df_output.txt", row.names=F, col.names=T, quote=F, sep="\t") # also heidi test bfile <- "~/Sites/SVN/github/bigdata_dev/Pi_eQTL_hg19/Merged_EUR" df_output <- xMEsmr(gwas.summary, beqtl.summary, bfile) utils::write.table(df_output, file="df_output.txt", row.names=F, col.names=T, quote=F, sep="\t") ## End(Not run)