phewasMeta | R Documentation |
This function wraps the meta package's metagen
function to meta analyze phewas
results.
phewasMeta(results, fixed=T, keep.both=T, cores=1, ...)
results |
Data frame containing |
fixed |
Use the fixed effects model results in columns |
keep.both |
If |
cores |
The number of cores to use in the parallel socket cluster implementation. If |
... |
Additional parameters to be passed to |
This function uses by
to split results
into groups of studies based on phenotype, snp,
and adjustment
. phewasMeta
forces NA
adjustment values to be a character string "NA" due to by
restrictions on the INDICES
.
The results dataframe must contain an additional column, study
, which contains a study identifier for the meta analysis. Adding a study
column for each set of phewas results followed by an rbind
joining them together would create a functional results
parameter. See the examples section.
A data frame containing meta-analysis results. Includes most phewas result columns and summary information on the meta analysis.
phewasMetaModels
will return a by
object of complete metagen
objects.
#Generate some example data
ex=generateExample(hit="335")
#Extract the two parts from the returned list
id.icd9.count=ex$id.icd9.count
genotypes=ex$genotypes
#Create the PheWAS code table- translates the icd9s, adds exclusions, and reshapes to a wide format
phenotypes=createPhewasTable(id.icd9.count)
#Run the PheWAS
results.1=phewas(phenotypes,genotypes,cores=4,significance.threshold=c("bonferroni"))
#Set up a study identifier
results.1$study="335"
#Perform another PheWAS
ex=generateExample(hit="250.2")
id.icd9.count=ex$id.icd9.count
genotypes=ex$genotypes
phenotypes=createPhewasTable(id.icd9.count)
results.2=phewas(phenotypes,genotypes,cores=4,significance.threshold=c("bonferroni"))
results.2$study="250.2"
#Join the two sets of PheWAS results
results=rbind(results.1,results.2)
#Perform the meta analysis, and do not assume fixed effects.
results.meta=phewasMeta(results, fixed=FALSE, keep.both=FALSE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.