Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove problematic whitespace in example #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 10 additions & 9 deletions phecodeX_PheWAS_example_R_script.txt
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
library(PheWAS)
set.seed(1)
 

## make sure you add the right path!
phecodeX_labels = read.csv('phecodeX_R_labels.csv')
phecodeX_rollup_map = read.csv('phecodeX_R_rollup_map.csv')
phecodeX_map = read.csv('phecodeX_R_map.csv')
phecodeX_sex = read.csv('phecodeX_R_sex.csv')
 

#Generate some example data
ex=generateExample()

Expand All @@ -21,16 +21,17 @@ id.sex=ex$id.sex
#Note the vocabulary.map and rollup.map are set to
#phecodeX files
phenotypesX = createPhenotypes(id.vocab.code.count,
                            aggregate.fun=sum, id.sex=id.sex,
                            vocabulary.map=phecodeX_map,
                            rollup.map=phecodeX_rollup_map, sex.restriction=phecodeX_sex)

aggregate.fun=sum, id.sex=id.sex,
vocabulary.map=phecodeX_map,
rollup.map=phecodeX_rollup_map,
sex.restriction=phecodeX_sex)

#Combine the data
data = inner_join(inner_join(phenotypesX,genotypes),id.sex)
 

#Run the PheWAS
results = phewas_ext(data,phenotypes=names(phenotypesX)[-1], genotypes=c("rsEXAMPLE"), covariates=c("sex"))
 

## Add phecode_labels
results_annotated = merge(phecodeX_labels, results, by='phenotype')

Expand All @@ -39,4 +40,4 @@ phenotypeManhattan(results_annotated,
title="My Example PheWAS Manhattan Plot",
annotate.phenotype.description=T,
sort.by.category.value=F, x.group.labels=T,
use.color=T)
use.color=T)