phewasMeta: Perform meta-analysis of PheWAS results

Description Usage Arguments Details Value See Also Examples

View source: R/phewasMeta.R

Description

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

Usage

1
phewasMeta(results, fixed=T, keep.both=T, ...)

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.

fixed

Use the fixed effects model results in columns p, OR, beta, and SE? Default is TRUE.

keep.both

If FALSE, remove the specified fixed effects and random effects results columns (e.g., p.fixed and p.random). Default is TRUE.

...

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. 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.

Value

A data frame containing meta-analysis results. Includes most phewas result columns and summary information on the meta analysis.

See Also

phewasMetaModels will return a by object of complete metagen objects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
#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)

PheWAS/PheWAS documentation built on Nov. 16, 2018, 6:28 p.m.