Title: | R wrapper to fine-mappers |
---|---|
Description: | R wrapper to fine-mappers. |
Authors: | Andrey Ziyatdinov [aut, cre] |
Maintainer: | Andrey Ziyatdinov <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2024-12-27 04:13:44 UTC |
Source: | https://github.com/remlapmot/finemapr |
http://gcta.freeforums.net/thread/178/conditional-joint-analysis-using-summary
cojo( tab, bed, method = c("select", "cond"), cmd = "", snps_cond = NULL, dir_run = "run_cojo", tool = getOption("finemapr_cojo"), args = "" )
cojo( tab, bed, method = c("select", "cond"), cmd = "", snps_cond = NULL, dir_run = "run_cojo", tool = getOption("finemapr_cojo"), args = "" )
tab <- "~/git/hemostat/scc/results/sumstats-cojo/sumstats-1.cojo" bed <- "~/git/hemostat/scc/data/FineMapping/forGCTA_onco_r1.bed"
S3 class FinemaprFinemap.
## S3 method for class 'FinemaprFinemap' filename_zscore(x, locus = 1) ## S3 method for class 'FinemaprFinemap' filename_ld(x, locus = 1) ## S3 method for class 'FinemaprFinemap' filename_snp(x, locus) ## S3 method for class 'FinemaprFinemap' filename_config(x, locus) ## S3 method for class 'FinemaprFinemap' filename_k(x, locus) ## S3 method for class 'FinemaprFinemap' filename_log(x, locus) ## S3 method for class 'FinemaprFinemap' filename_master(x) ## S3 method for class 'FinemaprFinemap' write_files(x, ...) ## S3 method for class 'FinemaprFinemap' run_tool(x, ...) ## S3 method for class 'FinemaprFinemap' collect_results(x, ...) print.FinemaprFinemap(x, ...) ## S3 method for class 'FinemaprFinemap' plot( x, grid_nrow = NULL, grid_ncol = NULL, label_size = getOption("finemapr_label_size"), label_size_config = label_size, label_size_snp = label_size, top_rank = getOption("top_rank"), top_rank_config = top_rank, top_rank_snp = top_rank, lim_prob = getOption("lim_prob"), lim_prob_config = lim_prob, lim_prob_snp = lim_prob, lim_prob_ncausal = lim_prob, ... ) ## S3 method for class 'FinemaprFinemap' plot_ncausal(x, locus = 1, lim_prob = c(0, 1), ...) ## S3 method for class 'FinemaprFinemap' plot_config( x, locus = 1, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... ) ## S3 method for class 'FinemaprFinemap' plot_snp( x, locus = 1, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... )
## S3 method for class 'FinemaprFinemap' filename_zscore(x, locus = 1) ## S3 method for class 'FinemaprFinemap' filename_ld(x, locus = 1) ## S3 method for class 'FinemaprFinemap' filename_snp(x, locus) ## S3 method for class 'FinemaprFinemap' filename_config(x, locus) ## S3 method for class 'FinemaprFinemap' filename_k(x, locus) ## S3 method for class 'FinemaprFinemap' filename_log(x, locus) ## S3 method for class 'FinemaprFinemap' filename_master(x) ## S3 method for class 'FinemaprFinemap' write_files(x, ...) ## S3 method for class 'FinemaprFinemap' run_tool(x, ...) ## S3 method for class 'FinemaprFinemap' collect_results(x, ...) print.FinemaprFinemap(x, ...) ## S3 method for class 'FinemaprFinemap' plot( x, grid_nrow = NULL, grid_ncol = NULL, label_size = getOption("finemapr_label_size"), label_size_config = label_size, label_size_snp = label_size, top_rank = getOption("top_rank"), top_rank_config = top_rank, top_rank_snp = top_rank, lim_prob = getOption("lim_prob"), lim_prob_config = lim_prob, lim_prob_snp = lim_prob, lim_prob_ncausal = lim_prob, ... ) ## S3 method for class 'FinemaprFinemap' plot_ncausal(x, locus = 1, lim_prob = c(0, 1), ...) ## S3 method for class 'FinemaprFinemap' plot_config( x, locus = 1, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... ) ## S3 method for class 'FinemaprFinemap' plot_snp( x, locus = 1, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... )
S3 class FinemaprPaintor.
## S3 method for class 'FinemaprPaintor' filename_zscore(x, locus = 1) ## S3 method for class 'FinemaprPaintor' filename_ld(x, locus = 1) ## S3 method for class 'FinemaprPaintor' filename_annot(x, locus = 1) ## S3 method for class 'FinemaprPaintor' filename_master(x) ## S3 method for class 'FinemaprPaintor' filename_snp(x, locus) print.FinemaprPaintor(x, ...) ## S3 method for class 'FinemaprPaintor' process_annot(x, annots, annotations, ...) ## S3 method for class 'FinemaprPaintor' write_files(x, ...) ## S3 method for class 'FinemaprPaintor' run_tool(x, ...) ## S3 method for class 'FinemaprPaintor' collect_results(x, ...)
## S3 method for class 'FinemaprPaintor' filename_zscore(x, locus = 1) ## S3 method for class 'FinemaprPaintor' filename_ld(x, locus = 1) ## S3 method for class 'FinemaprPaintor' filename_annot(x, locus = 1) ## S3 method for class 'FinemaprPaintor' filename_master(x) ## S3 method for class 'FinemaprPaintor' filename_snp(x, locus) print.FinemaprPaintor(x, ...) ## S3 method for class 'FinemaprPaintor' process_annot(x, annots, annotations, ...) ## S3 method for class 'FinemaprPaintor' write_files(x, ...) ## S3 method for class 'FinemaprPaintor' run_tool(x, ...) ## S3 method for class 'FinemaprPaintor' collect_results(x, ...)
Run FINEMAP.
finemapr( tab, ld, n, annot, annotations, prop_credible = 0.95, method = c("finemap", "paintor"), dir_run, tool, args = "", prior_k, save_ld = FALSE, ret = c("results", "zscore", "ld") )
finemapr( tab, ld, n, annot, annotations, prop_credible = 0.95, method = c("finemap", "paintor"), dir_run, tool, args = "", prior_k, save_ld = FALSE, ret = c("results", "zscore", "ld") )
ex <- example_finemap() out <- finemapr(list(ex$tab1, ex$tab2), list(ex$ld1, ex$ld2), list(ex$n1, ex$n2), args = "--n-causal-max 1") out <- finemapr(list(ex$tab1, ex$tab2), list(ex$ld1, ex$ld2), list(ex$n1, ex$n2), method = "paintor", args = "-enumerate 1")
ex <- example_finemap() out <- finemapr(list(ex$tab1, ex$tab2), list(ex$ld1, ex$ld2), list(ex$n1, ex$n2), args = "--n-causal-max 1") out <- finemapr(list(ex$tab1, ex$tab2), list(ex$ld1, ex$ld2), list(ex$n1, ex$n2), method = "paintor", args = "-enumerate 1")
S3 class FinemaprCaviar.
print.FinemaprCaviar(x, ...) ## S3 method for class 'FinemaprCaviar' plot(x, ...) ## S3 method for class 'FinemaprCaviar' plot_snp( x, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... )
print.FinemaprCaviar(x, ...) ## S3 method for class 'FinemaprCaviar' plot(x, ...) ## S3 method for class 'FinemaprCaviar' plot_snp( x, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... )
S3 class Finemapr.
## S3 method for class 'Finemapr' plot_zscore( x, locus = 1, label_size = getOption("finemapr_label_size"), selected, force = 20, color_main = "grey75", color_selected = "aquamarine4", color_credible = "dodgerblue4", color_missing = "brown", plot_missing = FALSE, ... ) plot_ncausal(x, ...) print.Finemapr(x, ...) print.Finemapr(x, ...) ## S3 method for class 'Finemapr' plot(x, ...) ## S3 method for class 'Finemapr' plot_snp( x, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... ) ## S3 method for class 'Finemapr' extract_credible_set(x, ...) ## S3 method for class 'Finemapr' process_tab(x, tabs, ...) ## S3 method for class 'Finemapr' process_ld(x, lds, ...)
## S3 method for class 'Finemapr' plot_zscore( x, locus = 1, label_size = getOption("finemapr_label_size"), selected, force = 20, color_main = "grey75", color_selected = "aquamarine4", color_credible = "dodgerblue4", color_missing = "brown", plot_missing = FALSE, ... ) plot_ncausal(x, ...) print.Finemapr(x, ...) print.Finemapr(x, ...) ## S3 method for class 'Finemapr' plot(x, ...) ## S3 method for class 'Finemapr' plot_snp( x, lim_prob = c(0, 1.5), label_size = getOption("finemapr_label_size"), top_rank = getOption("top_rank"), ... ) ## S3 method for class 'Finemapr' extract_credible_set(x, ...) ## S3 method for class 'Finemapr' process_tab(x, tabs, ...) ## S3 method for class 'Finemapr' process_ld(x, lds, ...)
Colors: http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf
https://github.com/slowkow/proxysnps/blob/master/R/get_vcf.R
proxysnps_ref_ld( vcf, tol = 1e-10, measure = c("R.squared", "D.prime"), verbose = 0 )
proxysnps_ref_ld( vcf, tol = 1e-10, measure = c("R.squared", "D.prime"), verbose = 0 )
https://github.com/slowkow/proxysnps/blob/master/R/get_vcf.R
proxysnps_ref_vcf( chr = 16, start = 53767000, end = 53768000, pop = "EUR", snps = NULL, verbose = 0 )
proxysnps_ref_vcf( chr = 16, start = 53767000, end = 53768000, pop = "EUR", snps = NULL, verbose = 0 )
Read LD matrix from a file.
read_ld(file_ld, snps)
read_ld(file_ld, snps)
f1 <- system.file("extdata/region1.ld", package = "finemapr") ld <- read_ld(f1)
f1 <- system.file("extdata/region1.ld", package = "finemapr") ld <- read_ld(f1)
Read z-scores from a file.
read_zscore(file_zscore)
read_zscore(file_zscore)
f1 <- system.file("extdata/region1.z", package = "finemapr") ztab <- read_zscore(f1)
f1 <- system.file("extdata/region1.z", package = "finemapr") ztab <- read_zscore(f1)
Output file ('*_post'): column #1 is the variant name; column #2 is the posterior prob. that the variant is causal (https://github.com/fhormoz/caviar/issues/1#issuecomment-286521771); column #3 is the amount that this variant contributes to 95
run_caviar( tab, ld, dir_run = "run_caviar", tool = getOption("finemapr_caviar"), args = "" )
run_caviar( tab, ld, dir_run = "run_caviar", tool = getOption("finemapr_caviar"), args = "" )
ex <- example_finemap() out <- run_caviar(ex$tab1, ex$ld1, args = "-c 2") out <- run_caviar(ex$tab1, ex$ld1, args = "-c 0")
ex <- example_finemap() out <- run_caviar(ex$tab1, ex$ld1, args = "-c 2") out <- run_caviar(ex$tab1, ex$ld1, args = "-c 0")
Run FINEMAP.
run_finemap( tab, ld, n, dir_run = "run_finemap", tool = getOption("finemapr_finemap"), args = "" )
run_finemap( tab, ld, n, dir_run = "run_finemap", tool = getOption("finemapr_finemap"), args = "" )
ex <- example_finemap() out <- run_finemap(ex$tab1, ex$ld1, ex$n1, args = "--n-causal-max 3") out <- run_finemap(ex$tab1, ex$ld1, ex$n1, args = "--n-causal-max 1")
ex <- example_finemap() out <- run_finemap(ex$tab1, ex$ld1, ex$n1, args = "--n-causal-max 3") out <- run_finemap(ex$tab1, ex$ld1, ex$n1, args = "--n-causal-max 1")
Run Paintor.
run_paintor( tab, ld, n, annot, annotations, dir_run = "run_paintor", tool = getOption("finemapr_paintor"), args = "" )
run_paintor( tab, ld, n, annot, annotations, dir_run = "run_paintor", tool = getOption("finemapr_paintor"), args = "" )
ex <- example_finemap() out <- run_paintor(ex$tab1, ex$ld1)
ex <- example_finemap() out <- run_paintor(ex$tab1, ex$ld1)
https://data.broadinstitute.org/alkesgroup/sumstats_formatted/readme.txt https://github.com/bulik/ldsc/wiki/Partitioned-Heritability
sumstats_bmi()
sumstats_bmi()