phyloseq icon indicating copy to clipboard operation
phyloseq copied to clipboard

remove mitochondria and chloroplast taxa

Open bioinfonext opened this issue 5 years ago • 4 comments

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

bioinfonext avatar May 26 '19 12:05 bioinfonext

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.

mikemc avatar May 26 '19 15:05 mikemc

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

Kind Regards Yogesh

bioinfonext avatar May 27 '19 20:05 bioinfonext

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

sghignone avatar Jan 05 '21 12:01 sghignone

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

Thank you

c-sayuri avatar Apr 06 '23 11:04 c-sayuri