YuLab-SMU / MicrobiotaProcess

:microbe: A comprehensive R package for deep mining microbiome
https://www.sciencedirect.com/science/article/pii/S2666675823000164
183 stars 37 forks source link

Possible to calculate diff_analysis with less than 5 sample per group ? #113

Open UpalabdhaD opened 11 months ago

UpalabdhaD commented 11 months ago

Hi , I was interesented in calculating diff analysis. My dataset include 6 sample, 3 per group.

So i was wondering is it possible to run diff analysis for less than 5 sample per group ?

Error: The sample number of each groups is smaller than 5.
Traceback:

1. diff_analysis(obj = rf_pseq_obj, classgroup = "Status", mlfun = "lda", 
 .     filtermod = "pvalue", firstcomfun = "kruskal_test", firstalpha = 0.05, 
 .     strictmod = TRUE, secondcomfun = "wilcox_test", subclmin = 3, 
 .     subclwilc = TRUE, secondalpha = 0.01, lda = 3)
2. diff_analysis.phyloseq(obj = rf_pseq_obj, classgroup = "Status", 
 .     mlfun = "lda", filtermod = "pvalue", firstcomfun = "kruskal_test", 
 .     firstalpha = 0.05, strictmod = TRUE, secondcomfun = "wilcox_test", 
 .     subclmin = 3, subclwilc = TRUE, secondalpha = 0.01, lda = 3)
3. diff_analysis.data.frame(obj = otuda, sampleda = sampleda, taxda = taxda, 
 .     ...)
4. diffclass(datasample = datameta, features = varsfirst, comclass = compareclass, 
 .     classgroup = classgroup, fcfun = fcfun, secondcomfun = secondcomfun, 
 .     classmin = clmin, clwilc = clwilc, pfold = secondalpha, ...)
5. get_gfc_wilc(datasample = datatmp, fun1 = fcfun, classlevelsnum = clsize, 
 .     vars = features, classname = classgroup, minnum = classmin, 
 .     fun2 = secondcomfun, wilc = clwilc, ...)
6. stop_wrap("The sample number of each groups is smaller than ", 
 .     minnum, ".")
7. stop(msg, call. = FALSE)

Thanks in advance

jianlingfan commented 4 months ago

I have the same probelm. Have you solved it?

xiangpin commented 4 months ago

please check whether each group's sample number is smaller than the clmin argument. PS: We suggest using mp_diff_analysis to replace diff_analysis, you can refer to the vignettes