This is a test version of Biostars. For the public version, visit https://www.biostars.org.
phyloseq_filter_prevalence, non zero dimension

I'm using the function phyloseq_filter_prevalence to filter a phyloseq data. I got an error OTU abundance data must have non-zero dimensions...

df<-phyloseq_filter_prevalence(physeq = myphylo, prev.trh = 0.3, abund.trh = NULL) Error in validObject(.Object) : “otu_table” object: OTU abundance data must have non-zero dimensions.

Could you please help me with a solution to my problem? Thank you.

phyloseq

1 answer

It also happened to me. Here is an alternative way: prevalence<-rowMeans(phy_object@otu_table>0); phy_object1<-prune_taxa(row.names(phy_object@otu_table[prevalence >= 0.05,]), phy_object) is equal to phy_object1<-phyloseq_filter_prevalence(phy_object, prev.trh = 0.05)

Hope it is helpful

Log in to answer this question.