Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove mitochondrial and chloroplastic taxons from my phyloseq object #1750

Open
pailloufat-stack opened this issue May 14, 2024 · 0 comments

Comments

@pailloufat-stack
Copy link

pailloufat-stack commented May 14, 2024

Hi,

I have my ps object :

phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 19747 taxa and 322 samples ]
sample_data() Sample Data:       [ 322 samples by 6 sample variables ]
tax_table()   Taxonomy Table:    [ 19747 taxa by 7 taxonomic ranks ]

I need to reduce this dataset, in order to infer a phylogeny later. What I did is to remove the chloroplastic and mitochondrials taxons from it (and the eukaryotic and unclassified taxons) :

ps %>%
  phyloseq::subset_taxa(Order != "Chloroplast") %>%
  phyloseq::subset_taxa(Family != "Mitochondria") %>%
  phyloseq::subset_taxa(Kingdom == "Bacteria") %>%
  phyloseq::subset_taxa(Phylum != "Unclassified ")

phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 14923 taxa and 322 samples ]
sample_data() Sample Data:       [ 322 samples by 6 sample variables ]
tax_table()   Taxonomy Table:    [ 14923 taxa by 7 taxonomic ranks ]

I would like to know what is the difference with this command and which one is the good one :

ps %>% 
 subset_taxa( Kingdom == "Bacteria" &   
                      Family!= "Mitochondria" | is.na(Family) &
                      Order!="Chloroplast" | is.na(Order) & 
                      Phylum != "Unclassified")

phyloseq-class experiment-level object
otu_table()   OTU Table:         [ 18308 taxa and 322 samples ]
sample_data() Sample Data:       [ 322 samples by 6 sample variables ]
tax_table()   Taxonomy Table:    [ 18308 taxa by 7 taxonomic ranks ]

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant