-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Description
Here are two issues:
(1) The documentation states that DNAm should be a matrix, but this is not correct - you are actually assuming/requiring that it be a data.frame, as this line does not work if DNAm is a matrix instead of a data.frame:
DNAm[, missingCpGs] <- NA
(2) There is an error here in the imputation code because datMeth is in the parent environment, and so has not been expanded to include the missingCpGs columns. Thus, this dies at this line:
datMeth[, missingCpGs[i]] <- imputeMissingBrainCpGs[missingCpGs[i]]
because it is trying to insert the mean CpG values in for the missingCpGs[i] that does not exist in the original datMeth.
Instead, the line should be
DNAm[, missingCpGs[i]] <- imputeMissingBrainCpGs[missingCpGs[i]]
So I think all mentions of datMeth should be replaced with DNAm instead. Here's a portion of the code:
DNAm[, missingCpGs] <- NA
if (!is.na(missingCpGs[1])) {
if (is.null(CpGImputation)) {
data("imputeMissingBrainCpGs")
for (i in 1:length(missingCpGs)) {
datMeth[, missingCpGs[i]] <- imputeMissingBrainCpGs[missingCpGs[i]]
}
}
else {
for (i in 1:length(missingCpGs)) {
datMeth[, missingCpGs[i]] <- CpGImputation[missingCpGs[i]]
}
}
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels