Package 'finemapr'

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-10-01 03:52:21 UTC
Source: https://github.com/remlapmot/finemapr

Help Index


Run GCTA-COJO.

Description

http://gcta.freeforums.net/thread/178/conditional-joint-analysis-using-summary

Usage

cojo(
  tab,
  bed,
  method = c("select", "cond"),
  cmd = "",
  snps_cond = NULL,
  dir_run = "run_cojo",
  tool = getOption("finemapr_cojo"),
  args = ""
)

Details

tab <- "~/git/hemostat/scc/results/sumstats-cojo/sumstats-1.cojo" bed <- "~/git/hemostat/scc/data/FineMapping/forGCTA_onco_r1.bed"


S3 class FinemaprFinemap.

Description

S3 class FinemaprFinemap.

Usage

## 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.

Description

S3 class FinemaprPaintor.

Usage

## 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.

Description

Run FINEMAP.

Usage

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")
)

Examples

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.

Description

S3 class FinemaprCaviar.

Usage

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"),
  ...
)

Package finemapr.

Description

R wrapper to fine-mappers.


S3 class Finemapr.

Description

S3 class Finemapr.

Usage

## 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, ...)

Note

Colors: http://www.stat.columbia.edu/~tzheng/files/Rcolor.pdf


https://github.com/slowkow/proxysnps/blob/master/R/get_vcf.R

Description

https://github.com/slowkow/proxysnps/blob/master/R/get_vcf.R

Usage

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

Description

https://github.com/slowkow/proxysnps/blob/master/R/get_vcf.R

Usage

proxysnps_ref_vcf(
  chr = 16,
  start = 53767000,
  end = 53768000,
  pop = "EUR",
  snps = NULL,
  verbose = 0
)

Read LD matrix from a file.

Description

Read LD matrix from a file.

Usage

read_ld(file_ld, snps)

Examples

f1 <- system.file("extdata/region1.ld", package = "finemapr")
ld <- read_ld(f1)

Read z-scores from a file.

Description

Read z-scores from a file.

Usage

read_zscore(file_zscore)

Examples

f1 <- system.file("extdata/region1.z", package = "finemapr")
ztab <- read_zscore(f1)

Run CAVIAR.

Description

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

Usage

run_caviar(
  tab,
  ld,
  dir_run = "run_caviar",
  tool = getOption("finemapr_caviar"),
  args = ""
)

Examples

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.

Description

Run FINEMAP.

Usage

run_finemap(
  tab,
  ld,
  n,
  dir_run = "run_finemap",
  tool = getOption("finemapr_finemap"),
  args = ""
)

Examples

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.

Description

Run Paintor.

Usage

run_paintor(
  tab,
  ld,
  n,
  annot,
  annotations,
  dir_run = "run_paintor",
  tool = getOption("finemapr_paintor"),
  args = ""
)

Examples

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

Description

https://data.broadinstitute.org/alkesgroup/sumstats_formatted/readme.txt https://github.com/bulik/ldsc/wiki/Partitioned-Heritability

Usage

sumstats_bmi()