joey711 / phyloseq

phyloseq is a set of classes, wrappers, and tools (in R) to make it easier to import, store, and analyze phylogenetic sequencing data; and to reproducibly share that data and analysis with others. See the phyloseq front page:
http://joey711.github.io/phyloseq/
577 stars 187 forks source link

filtering step #1590

Open aff30 opened 2 years ago

aff30 commented 2 years ago

Hi, I am new to the microbiome analysis and I have been trying to filter my microbiome data after decontam but have encountered some errors. I am in the part where I would like to remove taxa with a total relative abundance of less than 10e-5 using the following code and getting the following error below:

psr <- filter_taxa(pst, function(x) mean(x) > 1e-5, TRUE)

Error in validObject(.Object) : invalid class “otu_table” object: OTU abundance data must have non-zero dimensions.

I understand that it is filtering everything but I don't know how to change it. Could you help me with that? Thank you so much

ycl6 commented 2 years ago

Hi @aff30

Is pst an phyloseq object? What is the message shown in R when you type in pst and dim(otu_table(pst))

aff30 commented 2 years ago

Hi - when I type pst I get: phyloseq-class experiment-level object otu_table() OTU Table: [ 8897 taxa and 614 samples ] sample_data() Sample Data: [ 614 samples by 4 sample variables ] tax_table() Taxonomy Table: [ 8897 taxa by 6 taxonomic ranks ]

and, dim(otu_table(pst)) [1] 614 8897

Thank you!