View source: R/phewasMetaModels.R
phewasMetaModels | R Documentation |
This function wraps the meta package's metagen
function to meta analyze phewas
results.
phewasMetaModels(results, ...)
results |
Data frame containing |
... |
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
.
Note that update.meta
can be used to alter individual metagen
objects.
A by
object with named entries containing the meta analysis models. Each entry is named in the form 'phenotype snp adjustment'.
phewasMeta
will return a data frame of results similar to phewas
output.
update.meta
will allow users to alter returned 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=2,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=2,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=phewasMetaModels(results)
results.meta$`250.2 rsEXAMPLE NA`
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.