get_lead_snp | R Documentation |
Get the lead SNP from the list of SNPs in input data.frame The lead SNP is defined as the SNP with the lowest sum of p-values from the two studies.
get_lead_snp(merged, snp = NULL)
merged |
(data.frame) Input data.frame, which is a result by merging two association studies. |
snp |
(string, optional) SNP rsID. If NULL, the function will select the lead SNP based on the sum of p-values from the two studies. If an rsID is supplied, the function will simply return the rsID. |
# Select the lead SNP in_fn_1 = system.file('extdata', 'gwas.tsv', package = 'locuscomparer') d1 = read_metal(in_fn_1, marker_col = 'rsid', pval_col = 'pval') in_fn_2 = system.file('extdata', 'gwas.tsv', package = 'locuscomparer') d1 = read_metal(in_fn_2, marker_col = 'rsid', pval_col = 'pval') merged = merge(d1, d2, by = "rsid", suffixes = c("1", "2"), all = FALSE) get_lead_snp(merged)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.