Closed yk-tanigawa closed 5 years ago
I tried to fix this issue with the patch: https://github.com/junyangq/snpnet/pull/16
but it looks like there is another issue around this topic.
I got this error:
Error in cbind2(1, newx) %*% nbeta :
Cholmod error 'X and/or Y have wrong dimensions' at file ../MatrixOps/cholmod_sdmult.c, line 90
Calls: snpnet_fit_main ... NextMethod -> predict.glmnet -> as.matrix -> %*% -> %*%
Execution halted
I think this error is from this line of the code (my best guess is it will through an error when features.val == NULL
):
https://github.com/junyangq/snpnet/blob/d965bf8d7bd8c4989c9b2a66f8ade1eee8324514/R/snpnet.R#L319
Note that I observe this issue only when the computation started with --prevIter X
where X
is an integer greater than 0. (i.e. --prevIter 0
worked fine).
With the current commit, it seems this bug is fixed. Thank you!
When
prevIter
> 0 and validation set is specified, the current implementation tries to execute this line.https://github.com/junyangq/snpnet/blob/d965bf8d7bd8c4989c9b2a66f8ade1eee8324514/R/snpnet.R#L195
However, this would lead to the following error:
This is because
features.val
isNULL
as defined here:https://github.com/junyangq/snpnet/blob/d965bf8d7bd8c4989c9b2a66f8ade1eee8324514/R/snpnet.R#L126
I think there should be one more condition in
if
clause to prevent this in this linehttps://github.com/junyangq/snpnet/blob/d965bf8d7bd8c4989c9b2a66f8ade1eee8324514/R/snpnet.R#L195