phewasMetaModels: Perform meta-analysis of PheWAS results

View source: R/phewasMetaModels.R

phewasMetaModelsR Documentation

Perform meta-analysis of PheWAS results

Description

This function wraps the meta package's metagen function to meta analyze phewas results.

Usage

phewasMetaModels(results, ...)

Arguments

results

Data frame containing phewas results. This data frame should include an additional column, study, identifying which study the results are for. See details and examples for more information.

...

Additional parameters to be passed to metagen.

Details

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.

Value

A by object with named entries containing the meta analysis models. Each entry is named in the form 'phenotype snp adjustment'.

See Also

phewasMeta will return a data frame of results similar to phewas output. update.meta will allow users to alter returned metagen objects.

Examples


#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`


PheWAS/PheWAS documentation built on July 3, 2023, 3:40 p.m.