I am trying to perform DMP with a dataset of 92 observations in 3 levels. When I run champ.DMP I get the following output:
[ Section 1: Check Input Pheno Start ] You pheno is factor type. Your pheno information contains following groups. >> <Buffy>:33 samples. <Polymorphonuclear>:29 samples. <Lymphocytes>:30 samples. [The power of statistics analysis on groups contain very few samples may not strong.] pheno contains 3 phenotypes compare.group parameter is NULL, EACH PAIR of phenotypes will be added into Compare List. Buffy_to_Polymorphonuclear compare group : Buffy, Polymorphonuclear Buffy_to_Lymphocytes compare group : Buffy, Lymphocytes Polymorphonuclear_to_Lymphocytes compare group : Polymorphonuclear, Lymphocytes [ Section 1: Check Input Pheno Done ] [ Section 2: Find Differential Methylated CpGs Start ] ----------------------------- Start to Compare : Buffy, Polymorphonuclear Contrast Matrix Contrasts Levels pLymphocytes-pBuffy pBuffy -1 pLymphocytes 1 pPolymorphonuclear 0 Coefficients not estimable: pLymphocytes Error in contrasts.fit(fit, contrast.matrix) : trying to take contrast of non-estimable coefficient In addition: Warning message: Partial NA coefficients for 412481 probe(s)
Please note that the contrast matrix is incorrectly created for the group tested. Supplying the compare.group parameter makes no difference unless I put in the Lymphocytes-Buffy pair which is always tested.
Reading the code I assume the error is in the function CalculateDMP, specifically this line:
contrast.matrix <- makeContrasts(contrasts = paste(colnames(design)[2:1], collapse = "-"), levels = colnames(design))
colnames(design)[2:1] seems fixed regardless of the pair. Any chance this can be fixed relatively easily?