Skip to content

Commit

Permalink
HOTFIX: another error in phewas.data() when 0 rows found
Browse files Browse the repository at this point in the history
  • Loading branch information
tobyjohnson committed Jul 16, 2019
1 parent 1c08528 commit 5eb9068
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Package: gtx
Type: Package
Encoding: UTF-8
Title: Genetics ToolboX
Version: 2.1.5
Version: 2.1.6
Date: 2019-07-16
Authors@R: c(person("Toby", "Johnson", role = c("aut", "cre"), email = "Toby.x.Johnson@gsk.com"),
person("Karsten", "Sieber", role = c("ctb"), email = "karsten.b.sieber@gsk.com"),
Expand Down
10 changes: 6 additions & 4 deletions R/phewas.R
Original file line number Diff line number Diff line change
Expand Up @@ -351,10 +351,12 @@ phewas.data <- function(chrom, pos, ref, alt, rs,

# add chrom/pos/ref/alt columns to make easier to pass through to other functions, or to help interpretation if saved to a file
# (note, not added if v1<-NULL above)
res$chrom <- v1$chrom
res$pos <- v1$pos
res$ref <- v1$ref
res$alt <- v1$alt
if (nrow(res) > 0) {
res$chrom <- v1$chrom
res$pos <- v1$pos
res$ref <- v1$ref
res$alt <- v1$alt
}

# Fix labels for entities, finding labels for the NA ones then pasting on
tmpl <- unique(na.omit(res[ , c('entity', 'entity_type')]))
Expand Down

0 comments on commit 5eb9068

Please sign in to comment.