# Import RDP classifier output taxonomy file into qiime2

**URL:** <https://forum.qiime2.org/t/import-rdp-classifier-output-taxonomy-file-into-qiime2/20304>\
**Category:** Technical Support\
**Tags:** import, taxonomy\
**Created:** [July 27, 2021, 4:24am UTC](https://forum.qiime2.org/t/import-rdp-classifier-output-taxonomy-file-into-qiime2/20304 "2021-07-27T04:24:19Z")\
**Posts on this page:** 3\
**Page:** 2

<div class="post-metadata">

**Author:** ![yileiwu](https://forum.qiime2.org/user_avatar/forum.qiime2.org/yileiwu/32/11444_2.png) [@yileiwu](https://forum.qiime2.org/u/yileiwu)\
**Post date:** [July 29, 2021, 4:09pm UTC](https://forum.qiime2.org/t/import-rdp-classifier-output-taxonomy-file-into-qiime2/20304/23 "2021-07-29T16:09:42Z")

</div>

`python3 script.py` will print out the usage.

---

<div class="post-metadata">

**Author:** ![SoilRotifer](https://forum.qiime2.org/user_avatar/forum.qiime2.org/soilrotifer/32/21071_2.png) [@SoilRotifer](https://forum.qiime2.org/u/SoilRotifer)\
**Post date:** [July 30, 2021, 5:01pm UTC](https://forum.qiime2.org/t/import-rdp-classifier-output-taxonomy-file-into-qiime2/20304/24 "2021-07-30T17:01:36Z")

</div>

> [@YuZhang](#):
>
> My previous analysis procedure was to remove all categories other than bacteria after the classification,

Thanks for this clarification. It was a bit unclear to me which step you were referring, making a reference database for your classifier, or filtering your data after classification. It seems like there are two separate discussions occurring here.

> [@YuZhang](#):
>
> So,what I should do to filter sequence correctly ?

If you only care about filtering _after_ classification, then it seems you are already doing everything correctly as you have:

```auto
qiime taxa filter-table \
    --i-table table-dada2-4.qza \
    --i-taxonomy ncbi-taxonomy-4.qza \
    --p-include k__Bacteria \
    --o-filtered-table ncbi-Bacteria-dada2-table-4.qza \

```

I'd suggest the more explicit approach of filtering by exclusion. As it is easier to say what you'd removed. But that is just my personal preference. 🙂

`--p-exclude d __Archaea,d__ Eukaryota,Unclassified`

An easier and more consistent way to filter you sequence file would be to use your new table to keep the matching sequences. That is, instead of doing this:

```auto
qiime taxa filter-seqs \
  --i-sequences rep-seq-dada2-4.qza \
  --i-taxonomy ncbi-taxonomy-4.qza \
  --p-include d__Bacteria \
  --o-filtered-sequences ncbi-Bacteria-sequences-4.qza

```

Do this:

```auto
qiime feature-table filter-seqs \
    --i-data ./rep-seq-dada2-4.qza \
    --i-table ./ncbi-Bacteria-dada2-table-4.qza \
    --o-filtered-data ./ncbi-Bacteria-sequences-4.qza

```

This way you do not have to worry about typing the same filtering commands twice.

> [@YuZhang](#):
>
> My understanding is that it has something to do with the categories contained in the database? If the database contains more categories, will it be more credible to remove unwanted categories?

I assume you mean how to you remove multiple unwanted features with unreliable taxonomy, etc? Take a look at the examples referenced here:

> [@multiple fasta files data-import](https://forum.qiime2.org/t/multiple-fasta-files-data-import/19832/13):
>
> Hi @Nisha, Would you mind posting your solution, so that others on the forum can benefit? There are a variety of ways to do this as outlined in the [filtering documentation](https://docs.qiime2.org/2021.4/tutorials/), specifically about [filtering sequences](https://docs.qiime2.org/2021.4/tutorials/filtering/#filtering-sequences). For example if you wanted to remove plastid sequences you could do: qiime taxa filter-table \ --i-table ./table.qza \ --i-taxonomy ./taxonomy.qza \ --p-mode 'contains' \ --p-include 'p\_\_' \ --p-exclude 'p\_\_;,Eukaryota,Chloroplast,Mitochondria,Unassigned,Uncla…

-Mike

---

<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:** [August 30, 2021, 11:01pm UTC](https://forum.qiime2.org/t/import-rdp-classifier-output-taxonomy-file-into-qiime2/20304/25 "2021-08-30T23:01:45Z")

</div>

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

[Previous page](https://forum.qiime2.org/t/import-rdp-classifier-output-taxonomy-file-into-qiime2/20304.md?page=1)
