Open SonWende opened 2 years ago
Okay, its working for me now
Just to give you a little update, Here' s what i managed to find out:
I noticed that the tax_table()
from the marker results did not contain the full taxonomy string when i ran lefse with a tax_rank like this
run_lefse(ps,
taxa_rank = "Family",
wilcoxon_cutoff = 0.01,
group = "Treatment",
multigrp_strat = TRUE,
kw_cutoff = 0.01,
norm = "CPM"))
For all other plots except plot_cladogram()
this did not pose an issue,but i guess without the full tax string there can be no cladogram
When i ran a tax_glom() before lefse, the marker tax_table() had the full path, but did not actually work on the desired Family level. tax_glom()
aggregates taxa on a certain levels, but the higher taxonomic levels still remain as columns of "NA"
in the taxonomy table, which seems to cause issues.
tax_glom(ps, "Family") %>% run_lefse(
wilcoxon_cutoff = 0.01,
group = "Trichoderma",
multigrp_strat = TRUE,
kw_cutoff = 0.01,
norm = "CPM"))
So the removal of the leftover columns after running tax_glom fixed this issue for me.
my_tax_glom <- function(ps, level = "Family"){
cols <- colnames(tax_table(ps))
remove_cols <- cols[seq(from = which(level == cols)+1, to = length(cols))]
prep <- tax_glom(ps, level)
tax_table(prep) <- tax_table(prep) %>% data.frame %>% select(-remove_cols) %>% as.matrix
return(prep)
}
mm.lefse<- my_tax_glom(ps, "Family) %>% run_lefse(...)
All the best wishes, Sonja
Hello,
Thank you for your support and creating and maintaining this package.
When I try to make cladograms for more my data after running lefse with the command
plot_cladogram(mm.lefse.root.noT, color=c("red","green", "yellow", "blue"))
i get the following error message:When running plot_cladogram() with the supplied kostic_crc testdata is works fine.
I attached an rds file with the mm object used. example.zip
Here is the Session Info: