Russel88 / DAtest

Compare different differential abundance and expression methods
GNU General Public License v3.0
49 stars 9 forks source link

DA.aov/DA.lao and DA.TukeyHSD #7

Closed DitteOL closed 6 years ago

DitteOL commented 6 years ago

Hi, I am a semi new user to the DAtest package and I am a phyloseq user. I use the DA.test first and find the method that is the best for my data (llm2) in this case. I ude the groupSig and determine the difference but are now are having some issues with the DA.aov and DA.TukeyHSD package.

I use the code: (BB_GF=phyloseq object) results <- DA.lao(BB_GF, predictor="Mouse_classification", allResults = TRUE)

output for one OTU

$OTU_166 Call: aov(formula = as.formula(form))

Terms: predictor Residuals Sum of Squares 8.187160e-07 1.721421e-05 Deg. of Freedom 1 27

Residual standard error: 0.0007984756 Estimated effects may be unbalanced

then use the TukeyHSD

res.tukey <- DA.TukeyHSD(results, variable = "predictor") Error in colnames<-(*tmp*, value = rownames(as.data.frame(TukeyHSD(results[[k]], : attempt to set 'colnames' on an object with less than two dimensions

I hope you can understand my issue even though it is not that well explained by me. What am I doing wrong? (I know I am definitely doing something wrong). Actually I am feeling a bit stupid!

Russel88 commented 6 years ago

Can you try running a Tukey test just on one of the OTUs: TukeyHSD(results[[1]]) Is there any output from this?

Also, what version of R and DAtest are you using?

DitteOL commented 6 years ago

I'm using version 2.7.11

t<-TukeyHSD(results[[1]])

Output: Tukey multiple comparisons of means 95% family-wise confidence level

Fit: aov(formula = as.formula(form))

$predictor diff lwr upr p adj GF-BB -2.033594e-07 -0.0001514614 0.0001510547 0.9978192

Russel88 commented 6 years ago

Ahh. With only two classes in the predictor (GF and BB) there is no need to run the TukeyHSD, it's designed for >2 classes.

testDA shouldn't run lao, aov and llm2 when you only have two classes in the predictor. Did you use another phyloseq object for this? If you did use the same object, try re-running testDA with the predictor converted to a character: sample_data(BB_GF)$Mouse_classification2 <- as.character(sample_data(BB_GF)$Mouse_classification) res <- testDA(BB_GF, "Mouse_classification2")

DitteOL commented 6 years ago

Ahh I'm sorry for my ignorance! It seem to be working now. Thank you for taking the time and answering me so quickly. I hope that if I encounter other problems I can contact you again. And I will of cause remember to cite the functions I'am ending up using from your package 👍