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/
579 stars 188 forks source link

remove mitochondria and chloroplast taxa #1152

Open bioinfonext opened 5 years ago

bioinfonext commented 5 years ago

In my phyloseq object, chloroplast is present as class whereas mitochondria present as family: is it correct taxonomy in phyloseq object?

ntaxa(physeq) [1] 67405 physeq0 <- subset_taxa(physeq, (Class!="Chloroplast") | is.na(Class)) ntaxa(physeq0) [1] 66946 physeq1 <- subset_taxa(physeq0, (Class!="mitochondria") | is.na(Class)) ntaxa(physeq1) [1] 66946 physeq1 <- subset_taxa(physeq0, (Family!="mitochondria") | is.na(Class)) ntaxa(physeq1) [1] 64545

mikemc commented 5 years ago

Phyloseq simply provides a container for a table that contains taxonomy information in a way that can be linked to the otu table and (optionally) reference sequences and phylogeny. It does not perform taxonomic assignment or determine what is "correct taxonomy". Your question seems to have to do with whatever program or method you used to assign taxonomy, not with phyloseq. Unless you are asking specifically if the taxonomy information got messed up when you imported into phyloseq, and for that we'd need to know how you assigned taxonomy and did the importing.

bioinfonext commented 5 years ago

Thanks, In 16s database itself, chloroplast present as class and mitochondria as family.

Kind Regards Yogesh

sghignone commented 3 years ago

This works for me: physeq <- physeq %>% subset_taxa( Family!= "mitochondria" | is.na(Family) & Class!="Chloroplast" | is.na(Class) )

c-sayuri commented 1 year ago

I had the same issue, and it worked for me doing one per time like @sghignone

Thank you