cpbayes_cor {CPBayes}  R Documentation 
Run correlated version of CPBayes when the main genetic effect (beta/log(odds ratio)) estimates across studies/traits are correlated.
cpbayes_cor( BetaHat, SE, Corln, Phenotypes, Variant, UpdateSlabVar = TRUE, MinSlabVar = 0.6, MaxSlabVar = 1, MCMCiter = 7500, Burnin = 500 )
BetaHat 
A numeric vector of length K where K is the number of phenotypes. It contains the betahat values across studies/traits. No default is specified. 
SE 
A numeric vector with the same dimension as BetaHat providing the standard errors corresponding to BetaHat. Every element of SE must be positive. No default is specified. 
Corln 
A numeric square matrix of order K by K providing the correlation matrix of BetaHat.
The number of rows & columns of Corln must be the same as the length of BetaHat. No default
is specified. See 
Phenotypes 
A character vector of the same length as BetaHat providing the name of the phenotypes. Default is specified as trait1, trait2, . . . , traitK. Note that BetaHat, SE, Corln, and Phenotypes must be in the same order. 
Variant 
A character vector of length one providing the name of the genetic variant. Default is ‘Variant’. 
UpdateSlabVar 
A logical vector of length one. If TRUE, the variance of the slab distribution that presents the prior distribution of nonnull effects is updated at each MCMC iteration in a range (MinSlabVar – MaxSlabVar) (see next). If FALSE, it is fixed at (MinSlabVar + MaxSlabVar)/2. Default is TRUE. 
MinSlabVar 
A numeric value greater than 0.01 providing the minimum value of the variance of the slab distribution. Default is 0.6. 
MaxSlabVar 
A numeric value smaller than 10.0 providing the maximum value of the variance of the slab distribution. Default is 1.0. **Note that, a smaller value of the slab variance will increase the sensitivity of CPBayes while selecting the optimal subset of associated traits but at the expense of lower specificity. Hence the slab variance parameter in CPBayes is inversely related to the level of false discovery rate (FDR) in a frequentist FDR controlling procedure. For a specific dataset, an user can experiment different choices of these three arguments: UpdateSlabVar, MinSlabVar, and MaxSlabVar. 
MCMCiter 
A positive integer greater than or equal to 2200 providing the total number of iterations in the MCMC. Default is 7500. 
Burnin 
A positive integer greater than or equal to 200 providing the burn in period in the MCMC. Default is 200. Note that the MCMC sample size (MCMCiter  Burnin) must be at least 2000, which is 7000 by default. 
The output produced by cpbayes_cor
is a list which consists of various components.
variantName 
It is the name of the genetic variant provided by the user. If not specified by the user, default name is ‘Variant’. 
log10_BF 
It provides the log10(Bayes factor) produced by CPBayes that measures the evidence of the overall pleiotropic association. 
locFDR 
It provides the local false discovery rate (posterior probability of null association) produced by CPBayes which is a measure of the evidence of aggregatelevel pleiotropic association. Bayes factor is adjusted for prior odds, but locFDR is solely a function of the posterior odds. locFDR can sometimes be small indicating an association, but log10_BF may not indicate an association. Hence, always check both log10_BF and locFDR. 
subset 
It provides the optimal subset of associated/nonnull traits selected by CPBayes. It is NULL if no phenotype is selected. 
important_traits 
It provides the traits which yield a traitspecific posterior probability of association (PPAj) > 20%. Even if a phenotype is not selected in the optimal subset of nonnull traits, it can produce a nonnegligible value of PPAj. Note that, ‘important_traits’ is expected to include the traits already contained in ‘subset’. It provides both the name of the important traits and their corresponding value of PPAj. Always check 'important_traits' even if 'subset' contains a single trait. It helps to better explain an observed pleiotropic signal. 
auxi_data 
It contains supplementary data including the MCMC data which is used later
by

uncor_use 
'Yes' or 'No'. Whether the combined strategy of CPBayes (implemented for correlated summary statistics) used the uncorrelated version or not. 
runtime 
It provides the runtime (in seconds) taken by 
Majumdar A, Haldar T, Bhattacharya S, Witte JS (2018) An efficient Bayesian meta analysis approach for studying crossphenotype genetic associations. PLoS Genet 14(2): e1007139.
analytic_locFDR_BF_cor
, estimate_corln
, post_summaries
, forest_cpbayes
, analytic_locFDR_BF_uncor
, cpbayes_uncor
data(ExampleDataCor) BetaHat < ExampleDataCor$BetaHat BetaHat SE < ExampleDataCor$SE SE cor < ExampleDataCor$cor cor traitNames < paste("Disease", 1:10, sep = "") SNP1 < "rs1234" result < cpbayes_cor(BetaHat, SE, cor, Phenotypes = traitNames, Variant = SNP1) str(result)