| cs | R Documentation |
Computes a Bayesian credible set from GWAS summary statistics using Wakefield-style approximate Bayes factors.
cs(tbl, b = "Effect", se = "StdErr", log_p = NULL, cutoff = 0.95)
tbl |
A data.frame containing summary statistics. |
b |
Name of column containing effect sizes. |
se |
Name of column containing standard errors. |
log_p |
Optional column name containing log p-values. If supplied, z-scores are derived from p-values instead of effect sizes and standard errors. |
cutoff |
Cumulative posterior probability threshold. Default is 0.95 (95% credible set). |
Credible set is often used in fine-mapping.
Posterior probabilities are computed from z-statistics using a numerically stable log-sum-exp implementation from matrixStats.
A subset of tbl containing variants in the credible set,
ordered by decreasing posterior probability of association.
## Not run:
\preformatted{
zcat ~/rds/results/private/proteomics/scallop-inf1/4E.BP1-1.tbl.gz | \
awk 'NR==1 || ($1==4 && $2 >= 187158034 - 1e6 && $2 < 187158034 + 1e6)' > 4E.BP1.z
}
tbl <- within(read.delim("4E.BP1.z"),{logp <- logp(Effect/StdErr)})
z <- cs(tbl)
l <- cs(tbl,log_p="logp")
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.