# Filtering features

**URL:** https://forum.qiime2.org/t/filtering-features/31247
**Category:** User Support
**Tags:** taxonomy, filter-features, filtering
**Created:** [August 27, 2024, 6:48am UTC](https://forum.qiime2.org/t/filtering-features/31247 "2024-08-27T06:48:52Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![joannakolodz](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/ebca7d/32.png) [@joannakolodz](https://forum.qiime2.org/u/joannakolodz)
#### Post date: [August 27, 2024, 6:48am UTC](https://forum.qiime2.org/t/filtering-features/31247/1 "2024-08-27T06:48:52Z")

</div>

Hi!  
Hope you’re doing fine.  
I have question regarding filtering. I use this command:

qiime taxa filter-table   
--i-table table.qza   
--i-taxonomy taxonomy.qza   
--p-exclude Alveolata   
--o-filtered-table table-filt.qza

But I struggle to remove features like this:  
d\_\_Eukaryota; **;** ; **;** ;\_\_ (only general taxa)  
without removing all features like this: d\_\_Eukaryota;p\_\_Apicomplexa;c\_\_Conoidasida;o\_\_Coccidia;f\_\_Eimeriorina;g\_\_Cystoisospora

Best,  
Joanna

---

<div class="post-metadata">

### Author: ![salias](https://forum.qiime2.org/user_avatar/forum.qiime2.org/salias/32/18594_2.png) [@salias](https://forum.qiime2.org/u/salias)
#### Post date: [August 27, 2024, 10:40am UTC](https://forum.qiime2.org/t/filtering-features/31247/2 "2024-08-27T10:40:31Z")

</div>

**Edited August 28, 2024**

Hello!

If you want to remove general taxa, you can use the command so it keeps only annotations with at least a given taxonomic level. For example, if you want your annotations to have at least the phylum level (i.e., we don't want annotations that only say `d __Eukaryota;;;;;;`, or `d__ Eukaryota;p__;;;;;`), you can do something similar to:

```bash
qiime taxa filter-table
  --i-table table.qza \
  --i-taxonomy taxonomy.qza \
  --p-mode contains \
  --p-include p__ \
  --p-exclude 'p__;' \
  --o-filtered-table table-filt.qza

```

The `qiime taxa filter-table` command allows you to be creative with your filters. There are parameters like `--p-mode` that you may find helpful in further filtering. You can check the [official documentation](https://docs.qiime2.org/2024.5/plugins/available/taxa/filter-table/) for more info. Moreover, [here](https://docs.qiime2.org/jupyterbooks/cancer-microbiome-intervention-tutorial/030-tutorial-downstream/020-taxonomy.html#filtering-filters-based-on-their-taxonomy) you can find more useful tips and use cases.

Let us know if that works for you!

Cheers,

Sergio

---

<div class="post-metadata">

### Author: ![joannakolodz](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/j/ebca7d/32.png) [@joannakolodz](https://forum.qiime2.org/u/joannakolodz)
#### Post date: [August 28, 2024, 6:56pm UTC](https://forum.qiime2.org/t/filtering-features/31247/6 "2024-08-28T18:56:38Z")

</div>

It was exactly what I needed! Thanks:)

Best,  
Joanna

---

<div class="post-metadata">

### Author: ![system](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/3X/2/1/21af5fe23cb6f4579467c66a9ed94e55274ca7bd.svg) [@system](https://forum.qiime2.org/u/system)
#### Post date: [September 29, 2024, 12:56am UTC](https://forum.qiime2.org/t/filtering-features/31247/7 "2024-09-29T00:56:52Z")

</div>

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