It took me a while to figure it out (although in hindsight it seems obvious) but when the dat DataFrame contains rows which are entirely zero the result returned by combat() will contain all NaNs.
Perhaps it's worth to a) specify that in the manual or b) check for that and drop those rows (with a warning) while running the function. If you think b) makes sense I would be happy to add that and open a PR.
Unrelated, it seems that ComBat() in R has changed, the line
cdata = ComBat(dat=edata, batch=as.factor(pheno$batch), mod=mod, numCov=match("age", colnames(mod)))
returns
Error in ComBat(dat = edata, batch = as.factor(pheno$batch), mod = mod, : unused argument (numCov = match("age", colnames(mod))) Execution halted
It took me a while to figure it out (although in hindsight it seems obvious) but when the
dat
DataFrame contains rows which are entirely zero the result returned by combat() will contain all NaNs.Perhaps it's worth to a) specify that in the manual or b) check for that and drop those rows (with a warning) while running the function. If you think b) makes sense I would be happy to add that and open a PR.
Unrelated, it seems that
ComBat()
in R has changed, the linecdata = ComBat(dat=edata, batch=as.factor(pheno$batch), mod=mod, numCov=match("age", colnames(mod)))
returnsError in ComBat(dat = edata, batch = as.factor(pheno$batch), mod = mod, : unused argument (numCov = match("age", colnames(mod))) Execution halted
Cheers,
Wouter