| Encoding: | UTF-8 |
| Type: | Package |
| Version: | 1.0.3 |
| Date: | 2019-05-15 |
| Title: | Bayesian Multivariate Analysis of Summary Statistics |
| Description: | Multivariate tool for analyzing genome-wide association study results in the form of univariate summary statistics. The goal of 'bmass' is to comprehensively test all possible multivariate models given the phenotypes and datasets provided. Multivariate models are determined by assigning each phenotype to being either Unassociated (U), Directly associated (D) or Indirectly associated (I) with the genetic variant of interest. Test results for each model are presented in the form of Bayes factors, thereby allowing direct comparisons between models. The underlying framework implemented here is based on the modeling developed in "A Unified Framework for Association Analysis with Multiple Related Phenotypes", M. Stephens (2013) <doi:10.1371/journal.pone.0065245>. |
| License: | GPL (≥ 3) |
| URL: | https://github.com/mturchin20/bmass |
| BugReports: | https://github.com/mturchin20/bmass/issues |
| Depends: | R (≥ 3.3.0) |
| Imports: | utils, stats |
| Suggests: | testthat, knitr, rmarkdown |
| LazyData: | true |
| NeedsCompilation: | no |
| RoxygenNote: | 6.1.1 |
| VignetteBuilder: | knitr |
| Packaged: | 2019-05-16 16:23:07 UTC; mturchin20 |
| Author: | Michael Turchin [aut, cre], Matthew Stephens [aut], Peter Carbonetto [ctb] |
| Maintainer: | Michael Turchin <mturchin20@uchicago.edu> |
| Repository: | CRAN |
| Date/Publication: | 2019-05-17 07:20:12 UTC |
Get Marginal {U,D,I} Posteriors
Description
Get marginal posteriors for how much every individualphenotype belongs to categories {U,D,I} across each SNP
Usage
GetMarginalPosteriors(DataSources, ListSNPs, Models, LogFile)Arguments
DataSources | A string indicating the variable names of theinput datafiles and phenotypes. |
ListSNPs | A list produced from running |
Models | A matrix describing the models being explored(default output from running |
LogFile | A matrix of string outputs for function loggingpurposes (default output from running |
Value
A list containing three matrices of SNPs x Phenotypesmarginal posteriors for each category {U,D,I}; this list is appended to the input ListSNPs as a new object,Marginals (the full returned object is a list containing the input ListSNPs and the input LogFile).
Examples
Phenotypes <- c("bmass_SimulatedData1", "bmass_SimulatedData2")bmassOutput <- bmass(Phenotypes, bmass_SimulatedSigSNPs)bmassOutput[c("PreviousSNPs", "LogFile")] <-GetMarginalPosteriors(Phenotypes, bmassOutput$PreviousSNPs,bmassOutput$Models, bmassOutput$LogFile)bmassOutput$PreviousSNPs$MarginalsGet Model Prior Matrix
Description
Creates a matrix containing the model descriptions andtheir associated priors.
Usage
GetModelPriorMatrix(DataSources, Models, ModelPriors, LogFile, SigmaAlphas = c(0.005, 0.0075, 0.01, 0.015, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.15))Arguments
DataSources | A string indicating the variable names of theinput datafiles and phenotypes. |
Models | A matrix describing the models being explored(default output from running |
ModelPriors | A vector containing the priors on each modelacross each tranche of sigma alpha (default output from running |
LogFile | A matrix of string outputs for function loggingpurposes (default output from running |
SigmaAlphas | A vector containing the different valuestraversed for this 'effect size controlling' hyperparameter (see"Prior on Sigma_Alpha" in Stephens 2013 PLoS ONE,https://doi.org/10.1371/journal.pone.0065245). |
Value
A matrix containing the original description of each modelsort by prior, each model's trained prior, the cummulative priordistribution, and the model's original order position.
Examples
Phenotypes <- c("bmass_SimulatedData1", "bmass_SimulatedData2")bmassOutput <- bmass(Phenotypes,bmass_SimulatedSigSNPs)bmassOutput[c("ModelPriorMatrix", "LogFile")] <- GetModelPriorMatrix(Phenotypes, bmassOutput$Models, bmassOutput$ModelPriors, bmassOutput$LogFile)head(bmassOutput$ModelPriorMatrix)Get Top Multivariate Models
Description
Get a summary of the top models per SNP across allmultivariate {U,D,I} combinations based on posterior probabilities.
Usage
GetTopModelsPerSNPViaPosteriors(DataSources, ListSNPs, ModelPriorMatrix, LogFile)Arguments
DataSources | A string indicating the variable names of theinput datafiles and phenotypes. |
ListSNPs | A list produced from running |
ModelPriorMatrix | A matrix detailing the models beingexplored and their associated priors (obtained by running |
LogFile | A matrix of string outputs for function loggingpurposes (default output from running |
Value
A matrix containing each model that was a SNP's top modelat least once, along with related information; this matrix isappended to the input ListSNPs as a new object,TopModels (the full returned object is a list containing the input ListSNPs andthe input LogFile).
Examples
Phenotypes <- c("bmass_SimulatedData1", "bmass_SimulatedData2")bmassOutput <- bmass(Phenotypes, bmass_SimulatedSigSNPs)bmassOutput[c("ModelPriorMatrix", "LogFile")] <- GetModelPriorMatrix(Phenotypes, bmassOutput$Models, bmassOutput$ModelPriors, bmassOutput$LogFile)bmassOutput[c("PreviousSNPs", "LogFile")] <- GetTopModelsPerSNPViaPosteriors(Phenotypes, bmassOutput$PreviousSNPs, bmassOutput$ModelPriorMatrix, bmassOutput$LogFile)head(bmassOutput$PreviousSNPs$TopModels)GlobalLipids2013 GWAS SNPs
Description
A list of the univariate GWAS significant SNPs fromthe GlobalLipids2013 dataset to be used in the second introductory bmass vignette.
Format
A data frame with 157 rows and 2 variables:
- Chr
chromosome
- BP
basepair position
Source
Supplementary Tables 2 and 3 fromhttps://doi.org/10.1038/ng.2797.
Bayesian multivariate analysis of summary statistics (bmass)
Description
Runbmass on a set of phenotypes that each haveunivariate GWAS statistics on the same set of SNPs
Usage
bmass(DataSources, GWASsnps = NULL, SNPMarginalUnivariateThreshold = 1e-06, SNPMarginalMultivariateThreshold = 1e-06, GWASThreshFlag = TRUE, GWASThreshValue = 5e-08, NminThreshold = 0, PrintMergedData = FALSE, PrintProgress = FALSE, ...)Arguments
DataSources | A string indicating the variable names of theinput datafiles and phenotypes. No default value. |
GWASsnps | A data.table containing rows of SNPs that wereunivariate genome-wide significant in the phenotypes being used foranalysis; |
SNPMarginalUnivariateThreshold | A numerical value indicatingthe univariate p-value threshold to use when collecting marginallysignificant SNPs for final |
SNPMarginalMultivariateThreshold | A numerical valueindicating the basic multivariate p-value threshold to use whencollecting marginally significant SNPs for final |
GWASThreshFlag | A logical |
GWASThreshValue | A numerical value indicating the univariatep-value threshold to use in conjunction with the |
NminThreshold | A numerical value that indicates a sample sizethreshold to use where SNPs below which are removed. Default is |
PrintMergedData | A logical |
PrintProgress | A logical |
... | Additional optional arguments. |
Value
A list containing model, SNP, and posterior information forboth the previously significant univariate SNPs (PreviousSNPs)and the newly significant multivariate SNPs (NewSNPs). For a full breakdown of thebmass output list structure, please see the associated vignettes.
Other Examples
bmass(c("HDL","LDL","TG","TC"), GWASsnps, NminThreshold = 50000)bmass(c("HDL","LDL","TG","TC"), GWASsnps, GWASThreshValue = 1e-8, NminThreshold = 50000, PrintProgress = TRUE)bmass(c("HDL", "LDL", "TG", "TC"), GWASsnps, GWASThreshFlag = FALSE, SNPMarginalUnivariateThreshold = 1e-4, SNPMarginalMultivariateThreshold = 1e-4, PrintMergedData = TRUE)bmassOutput <- bmass(c("HDL","LDL","TG","TC"), GWASsnps, NminThreshold = 50000)
Examples
Phenotypes <- c("bmass_SimulatedData1", "bmass_SimulatedData2")bmassOutput <- bmass(Phenotypes, bmass_SimulatedSigSNPs)summary(bmassOutput)bmassOutput$NewSNPs$SNPsbmass Simulated Dataset 1
Description
A manually created sample dataset for use in Roxygen2documents and vignettes.
Format
A data frame with 11 rows and 9 variables:
- Chr
chromosome
- BP
basepair position
- Marker
rsID# or other identifier
- MAF
Minor Allele Frequency
- A1
reference allele
- A2
alternative allele
- Direction
direction of associationeffect size, + or -
- pValue
p-Value of GWAS association
- N
sample size
Source
Manually created
bmass Simulated Dataset 2
Description
A manually created sample dataset for use in Roxygen2documents and vignettes.
Format
A data frame with 11 rows and 9 variables:
- Chr
chromosome
- BP
basepair position
- Marker
rsID# or other identifier
- MAF
Minor Allele Frequency
- A1
reference allele
- A2
alternative allele
- Direction
direction of associationeffect size, + or -
- pValue
p-Value of GWAS association
- N
sample size
Source
Manually created
bmass Simulated GWAS SNPs
Description
A manually created list of GWAS significant SNPs to beused in conjunction with 'bmass_SimulatedData1' and 'bmass_SimulatedData2'.
Format
A data frame with 2 rows and 2 variables:
- Chr
chromosome
- BP
basepair position
Source
Manually created
bmass Test Dataset 1
Description
A manually created sample dataset for use in unittests.
Format
A data frame with 11 rows and 9 variables:
- Chr
chromosome
- BP
basepair position
- Marker
rsID# or other identifier
- MAF
Minor Allele Frequency
- A1
reference allele
- A2
alternative allele
- Direction
direction of associationeffect size, + or -
- pValue
p-Value of GWAS association
- N
sample size
Source
Manually created
bmass Test Dataset 2
Description
A manually created sample dataset for use in unittests.
Format
A data frame with 11 rows and 9 variables:
- Chr
chromosome
- BP
basepair position
- Marker
rsID# or other identifier
- MAF
Minor Allele Frequency
- A1
reference allele
- A2
alternative allele
- Direction
direction of associationeffect size, + or -
- pValue
p-Value of GWAS association
- N
sample size
Source
Manually created
bmass Test GWAS SNPs
Description
A manually created list of GWAS significant SNPs to beused in conjunction with 'bmass_TestData1' and 'bmass_TestData2'.
Format
A data frame with 2 rows and 2 variables:
- Chr
chromosome
- BP
basepair position
Source
Manually created