Skip to content

Commit 860ec36

Browse files
committed
simpler fix of test problem
- I think the r/qtl2 function always puts the NA in the 3rd column, so I only need to fix the lm-based estimates, where in some cases the NA is in the 3rd column and in others it's in the 2nd column.
1 parent 3c9919d commit 860ec36

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

tests/testthat/test-scan1coef_pg.R

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -105,22 +105,18 @@ test_that("scan1coef_pg for grav", {
105105
# include covariate
106106
covar <- cbind(chr3=pr[["3"]][,2,"CC.266L"])
107107
est <- scan1coef(pr[,"3"], phe, K, covar, se=FALSE, zerosum=FALSE)
108-
est <- swap_nas(est, also_se=FALSE)
109108
est_lm <- eff_via_lm(pr[["3"]], phe, K, covar)
110109
est_lm <- swap_nas(est_lm)
111110
expect_equivalent(est, est_lm)
112111

113112
est <- scan1coef(pr[,"3"], phe, K, covar, se=TRUE, zerosum=FALSE)
114-
est <- swap_nas(est)
115113
expect_equivalent(est, est_lm)
116114
expect_equivalent(attr(est, "SE"), attr(est_lm, "SE"))
117115

118116
# pre-computed eigen decomp
119117
est <- scan1coef(pr[,"3"], phe, Ke, covar, zerosum=FALSE)
120-
est <- swap_nas(est, also_se=FALSE)
121118
expect_equivalent(est, est_lm) ## <- fix problem here
122119
est <- scan1coef(pr[,"3"], phe, Ke, covar, se=TRUE, zerosum=FALSE)
123-
est <- swap_nas(est)
124120
expect_equivalent(est, est_lm) ## <- fix problem here
125121
expect_equivalent(attr(est, "SE"), attr(est_lm, "SE")) ## <- fix problem here
126122

@@ -145,22 +141,18 @@ test_that("scan1coef_pg for grav", {
145141
# two covariates
146142
covar <- cbind(covar, chr4=pr[["4"]][,2,"CD.329C-Col"])
147143
est <- scan1coef(pr[,"3"], phe, K, covar, se=FALSE, zerosum=FALSE)
148-
est <- swap_nas(est, also_se=FALSE)
149144
est_lm <- eff_via_lm(pr[["3"]], phe, K, covar)
150145
est_lm <- swap_nas(est_lm)
151146
expect_equivalent(est, est_lm)
152147

153148
est <- scan1coef(pr[,"3"], phe, K, covar, se=TRUE, zerosum=FALSE)
154-
est <- swap_nas(est)
155149
expect_equivalent(est, est_lm)
156150
expect_equivalent(attr(est, "SE"), attr(est_lm, "SE"))
157151

158152
# pre-computed eigen decomp
159153
est <- scan1coef(pr[,"3"], phe, Ke, covar, zerosum=FALSE)
160-
est <- swap_nas(est, also_se=FALSE)
161154
expect_equivalent(est, est_lm)
162155
est <- scan1coef(pr[,"3"], phe, Ke, covar, se=TRUE, zerosum=FALSE)
163-
est <- swap_nas(est)
164156
expect_equivalent(est, est_lm)
165157
expect_equivalent(attr(est, "SE"), attr(est_lm, "SE"))
166158

0 commit comments

Comments
 (0)