only retain phylum info for tree building

hello developers,

I want to plot a phylogenetic tree in phylum level by "qiime phylogeny align-to-tree-mafft-fasttree", how can I filter phylum info from both feature-table and sequence data?

I noticed there is a filtering related command here to filter both features and sequence. but " --p-include p__" will retain all taxa with phylum information, what I want is only the phylum, not the sub-taxa below the phylum. Is there any tools to achieve the goal?
qiime taxa filter-table
--i-table grouped-table.qza
--i-taxonomy taxonomy.qza
--p-include p__
--o-filtered-table filtered-table.qza

qiime taxa filter-seqs
--i-sequences sequences.qza
--i-taxonomy taxonomy.qza
--p-include p__
--p-exclude e__
--o-filtered-sequences filtered-sequences.qza

Hello @suqianwei3,

Check out qiime taxa collapse.

1 Like

hi @colinvwood ,

I checked qiime taxa collapse, I notice that it only output a collapsed feature table, is there a way to get collapsed sequence in phylum level, or get the collapsed phylogenetic relationship in phylum level? so that I can plot a tree with the phylums.

could you give me some more suggestions?

Hello @suqianwei3,

To make sure I understand correctly, does one of the following describe what you want to accomplish?

  • A phylogeny from only features that were classified to the phylum level
  • A phylogeny of all features but with each annotated by only its phylum
  • A phylogeny from all features, but only informed by phylum-level annotation

The last option wouldn't be an alignment-based tree but just a cladogram.

Can you explain a little more what you mean by "is there a way to get collapsed sequence in phylum level"?


Hi Colin! I am working on a similar problem and I think the second point you mentioned is the closest for me.

I am trying to generate a circular phylogenetic tree through iTOL but it is getting too big/complicated. It is not possible to auto collapse/choose to display data up to a certain taxonomic level in iTOL as easily as the taxa bar plot qzv generated through QIIME2. Therefore, retaining information upto a phylum level to plug into iTOL would be very helpful.

Hope this helps.

Hi @macrobiome,

Have you tried using q2-empress?

If needed, you can always use the edit-taxonomy action of q2-rescript to truncate the taxonomy strings in the taxonomy file, down to phylum, and use that.

EDIT: Keep in mind, that taxonomy does not always map well to phylogeny.

1 Like

Hi, I am running QIIME2-2023.2 in a conda environment.

I was wondering if it is possible to generate rooted-tree or taxonomy files that only contain data upto, let's say, the family level. I am trying to generate phylogenetic trees (using iTOL) that are getting very complicated and I am unable to collapse specific classes within iTOL.

I was wondering if there is a way to do something like this through QIIME2 where the generated rooted-tree through beta diversity or taxonomic analyses can be limited to a particular class level.

Hi Mike!

No I haven't tried q2-empress. My goal is to generate figures such as fig 4(d) and 4(e). Would q2-empress be able to do that?

Also, could you clarify what you mean by taxonomy does not always map well to phylogeny? Sorry I am new to this area. Thank you!

What are you referring to? Please provide a reference.

As we sequence more genomes of microbes and other organisms, we sometimes find that their proposed relationships are not what we thought. This additional sequence information provides better resolution on the phylogenetic relatedness of these organisms. This has resulted in many taxonomic inconsistencies with respect to phylogeny. For example, Firmicutes is not a monophyletic group.

There are efforts by many groups to resolve this. For example, the Genome Taxonomy Database (GTDB) strives to make a phylogenetically consistent taxonomy.


Hi @SoilRotifer ! Sorry, here is the image. Trying to replicate figures d and e. What would you suggest would be the best way to go about it?

@macrobiome, please avoid duplicate posting. I've answered these questions here.

1 Like

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.