Skip to content

Commit

Permalink
fix ihh return matrix without snps
Browse files Browse the repository at this point in the history
  • Loading branch information
paulstaab committed Oct 22, 2015
1 parent cf87151 commit dcd39f9
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions R/sumstat_ihh.R
Expand Up @@ -9,8 +9,7 @@ stat_ihh_class <- R6Class("stat_ihh", inherit = sumstat_class,
population = NULL,
max_snps = Inf,
use_ihs = FALSE,
empty_matrix = matrix(0, 0, 3,
dimnames = list(NULL, c("IHHa", "IHHd", "IES"))),
empty_matrix = NULL,
get_snp = function(positions, locus, model) {
if (is.na(private$position)) return(seq(along = positions))
pos <- conv_middle_to_trio_pos(private$position, model, locus,
Expand All @@ -29,6 +28,14 @@ stat_ihh_class <- R6Class("stat_ihh", inherit = sumstat_class,
private$position <- position
private$max_snps <- max_snps
private$use_ihs <- calc_ihs
if (calc_ihs) {
private$empty_matrix <-
matrix(0, 0, 4, dimnames =
list(NULL, c("IHHa", "IHHd", "IES", "iHS")))
} else {
private$empty_matrix <-
matrix(0, 0, 3, dimnames = list(NULL, c("IHHa", "IHHd", "IES")))
}
super$initialize(name)
},
calculate = function(seg_sites, trees, files, model) {
Expand Down

0 comments on commit dcd39f9

Please sign in to comment.