ChiLiubio / microeco

An R package for data analysis in microbial community ecology
GNU General Public License v3.0
195 stars 56 forks source link

can you add method =" euclidean” of microtable$cal_betadiv? #351

Closed milyzhou closed 4 months ago

milyzhou commented 5 months ago

Hi chi, I use trans_norm provides several data normalization. Then, I want to creat PCOA by use the "clr" microtable object. but it didn't work. I readed the microeco_tutorial. It It describes it can be used(method default NULL; a character vector with one or more elements; c("bray", "jaccard") is used when method = NULL; See the method parameter in vegdist function for more available options, such as 'aitchison' and 'robust.aitchison'.).

the code like this. t1 <- trans_norm$new(dataset = dataset) d2 <- t1$norm(method = "clr") d2$taxa_abund$Species[d2$taxa_abund$Species==0] <- 0.0000000001 d2$sample_table <- subset(d2$sample_table, time == "T0"|time=="T48") d2$tidy_dataset() d2$cal_betadiv() print(d2) t1 <- trans_beta$new(dataset = d2,group = "group",method="euclidean") Error in initialize(...) : 参数没有用(method = "euclidean"). hope can get your help. Thanks a lot.

ChiLiubio commented 5 months ago

The matrix calculation is in cal_betadiv function of microtable class, not trans_beta, e.g. d2$cal_betadiv(method="euclidean").