# clarification/verification of taxonomy classifiers

**URL:** <https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124>\
**Category:** User Support\
**Created:** [May 20, 2022, 7:44am UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124 "2022-05-20T07:44:33Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rob\_DNA](https://forum.qiime2.org/user_avatar/forum.qiime2.org/rob_dna/32/18558_2.png) [@Rob\_DNA](https://forum.qiime2.org/u/Rob_DNA)\
**Post date:** [May 20, 2022, 7:44am UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124/1 "2022-05-20T07:44:33Z")

</div>

Hello,

for the first time I'm using the taxonomy classifiers in QIIME2 for the taxonomy assignment to my fungal (18S) and bacterial (16S) MiSeq sequences. For now, I'd like to use the SILVA database. I've worked with metabarcoding before, but training a classifier is new to me.

If I get it right, I have two options:

1. Using the pre-trained " [Silva 138 99% OTUs full-length sequences](https://data.qiime2.org/2022.2/common/silva-138-99-nb-classifier.qza)" file, found at the top of: [Data resources — QIIME 2 2022.2.0 documentation](https://docs.qiime2.org/2022.2/data-resources/)

This classifier is not trained on my specific primers. So to get this classifier, all reference sequences of SILVA where included to train the classifier, instead of first extracting your own reads? (in contrary to option 2 below ) This is a file that can be used for classifying all 16S/18S sequences right? Are there any downsides for using this classifier for taxonomic assignment of fungal/bacterial 18S/16S sequences? (apart from that it does not focus on your region of interest, such as option 2 below)

I've googled/searched the forum for some more information on training a classifier, but I still do not fully understand it. I know that using a trained classifier improves performance, but why is this exactly? Why not 'just' use a non trained reference database such as the silva database?

1. I can extract the reads from the SILVA database of with my particular primers and then train the classifier:

For that I would first download " [Silva 138 SSURef NR99 full-length sequences](https://data.qiime2.org/2022.2/common/silva-138-99-seqs.qza)" and [Silva 138 SSURef NR99 full-length taxonomy](https://data.qiime2.org/2022.2/common/silva-138-99-tax.qza) from [Data resources — QIIME 2 2022.2.0 documentation](https://docs.qiime2.org/2022.2/data-resources/) under "Marker Gene reference Databases".

Do I understand it correcly that the downloads under the "Marker Gene reference database" are "raw" databases, from which you can extract your own reads?

Then I would extract my region of interest:

```auto
qiime feature-classifier extract-reads \
 --i-sequences silva-138-99-seqs.qza \
  --p-f-primer GTGCCAGCMGCCGCGGTAA \
  --p-r-primer GGACTACHVGGGTWTCTAAT \
  --p-identity 0.8 \
  --p-min-length 175 \
  --p-max-length 500 \
  --o-reads silva-138-99_ref-seqs_extracted.qza

```

and then train the classifier:

```auto
qiime feature-classifier fit-classifier-naive-bayes \
  --i-reference-reads silva-138-99_ref-seqs_extracted.qza \
  --i-reference-taxonomy silva-138-99-tax.qza \
  --o-classifier classifier.qza

```

Now I have a fully functional classifier trained on my specific region of interest, which I can use for taxonomic assignment of my reads.

This is the correct way right?

Thank you very much!

---

<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:** [May 20, 2022, 1:55pm UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124/2 "2022-05-20T13:55:09Z")

</div>

Hi @Rob_DNA, let's see if we can get you sorted. 🙂

> [@Rob\_DNA](#):
>
> This classifier is not trained on my specific primers. So to get this classifier, all reference sequences of SILVA where included to train the classifier, instead of first extracting your own reads?

This depends on which classifier you are using. The pre-made SILVA classifiers were constructed from the [NR99 SSU](https://www.arb-silva.de/projects/ssu-ref-nr/) version of the database, after some additional quality control via [RESCRIPt](https://github.com/bokulich-lab/RESCRIPt), you can check out the [tutorial](https://forum.qiime2.org/t/processing-filtering-and-evaluating-the-silva-database-and-other-reference-sequence-data-with-rescript/15494). You can use the RESCRIPt plugin to download the full, raw SILVA database instead of the NR99.

> [@Rob\_DNA](#):
>
> This is a file that can be used for classifying all 16S/18S sequences right? Are there any downsides for using this classifier for taxonomic assignment of fungal/bacterial 18S/16S sequences?

Correct. The main downside, is a practical one... that is, the file size and memory footprint of the full-length classifiers can be quite large. Preventing their use on machines that lack appropriate resources. The amplicon-specific versions are much smaller. Depending on your taxa of interest, you might lose a tiny bit of classification accuracy compared to the amplicon-specific versions, but this has been minimal for the data sets that I've worked with. Though your mileage may vary. 🚘 You can always compare the outputs.

> [@Rob\_DNA](#):
>
> I've googled/searched the forum for some more information on training a classifier, but I still do not fully understand it. I know that using a trained classifier improves performance, but why is this exactly? Why not 'just' use a non trained reference database such as the silva database?

Great questions! I refer you to these great papers. Several of these also discuss the benefit of constructing an amplicon-specific region classifiers. But in a nutshell, there are many cases in which several different organisms have identical DNA sequence over the amplicon region. Making it hard to disambiguate between taxa. That is BLAST, for example, might return all equivalent hits, which may not be helpful. We would prefer that consensus taaxonomy, or lowest common ancestor (LCA), be returned for our query sequence. 📚

- [Using the RDP Classifier to Predict Taxonomic Novelty and Reduce the Search Space for Finding Novel Organisms](http://dx.doi.org/10.1371/journal.pone.0032491)
- [Optimizing taxonomic classification of marker-gene amplicon sequences with QIIME 2’s q2-feature-classifier plugin | Microbiome | Full Text](http://dx.doi.org/10.1186/s40168-018-0470-z)
- [http://dx.doi.org/10.1038/ismej.2011.82](http://dx.doi.org/10.1038/ismej.2011.82)
- [Frontiers | Beating Naive Bayes at Taxonomic Classification of 16S rRNA Gene Sequences](http://dx.doi.org/10.3389/fmicb.2021.644487)
- [RESCRIPt: Reproducible sequence taxonomy reference database management](http://dx.doi.org/10.1371/journal.pcbi.1009581)
- [Species abundance information improves sequence taxonomy classification accuracy | Nature Communications](http://dx.doi.org/10.1038/s41467-019-12669-6)

> [@Rob\_DNA](#):
>
> Do I understand it correcly that the downloads under the "Marker Gene reference database" are "raw" databases, from which you can extract your own reads?

Yes. Although we provide the raw files that were used to make the classifiers, and the classifiers themselves (for the full-length and V4 region of the SSU gene), you can use RESCRIPt (linked above) to choose among several versions of the SILVA database and curate as you'd like. 🏗 Many on the forum have made their own V3V4 classifier for example.

> [@Rob\_DNA](#):
>
> Now I have a fully functional classifier trained on my specific region of interest, which I can use for taxonomic assignment of my reads.
> 
> This is the correct way right?

Yep.

Finally, RESCRIPt provides some tools to help you compare the various reference databases and classifiers you generate. 📏

-Cheers!  
-Mike

---

<div class="post-metadata">

**Author:** ![Rob\_DNA](https://forum.qiime2.org/user_avatar/forum.qiime2.org/rob_dna/32/18558_2.png) [@Rob\_DNA](https://forum.qiime2.org/u/Rob_DNA)\
**Post date:** [May 20, 2022, 2:23pm UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124/3 "2022-05-20T14:23:30Z")

</div>

Hi Mike,

thank you very much for your elaborate response! It is really nice to experience that people at the QIIME2 are so helpful ! 😄

I have a follow up question, based on your response:

> Yes. Although we provide the raw files that were used to make the classifiers, and the classifiers themselves (for the full-length and V4 region of the SSU gene), you can use RESCRIPt (linked above) to choose among several versions of the SILVA database and curate as you'd like. 🏗 Many on the forum have made their own V3V4 classifier for example.

Alright so these files _- see 2 files selected in grey in the picture below to make sure we are talking about the same files -_ are not actually the ''raw'' files, but have first been processed by RESCRIPt to make them more QIIME-compatible (as is stated on the page).

You mention that RESCRIPt can be used for own curation of the SILVA database etc. However, for "general usage" (how one would define this), the 2 files I use are suitable for creating a trained classifier based on extracted reads using own primers, right?

 ![image](https://forum-qiime2-org.s3.dualstack.us-west-2.amazonaws.com/original/2X/8/80dff235a2f6084d5b2aed3973917becf04714d7.png)

Thank you very much!

---

<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:** [May 20, 2022, 2:53pm UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124/4 "2022-05-20T14:53:06Z")

</div>

> [@Rob\_DNA](#):
>
> Alright so these files _- see 2 files selected in grey in the picture below to make sure we are talking about the same files -_ are not actually the ''raw'' files, but have first been processed by RESCRIPt to make them more QIIME-compatible (as is stated on the page).

Correct. We made use of the processing steps as outlined in the tutorial.

> [@Rob\_DNA](#):
>
> You mention that RESCRIPt can be used for own curation of the SILVA database etc. However, for "general usage" (how one would define this)

This is explained, in detail, through the RESCRIPt SILVA tutorial I linked in my initial response.

> [@Rob\_DNA](#):
>
> the 2 files I use are suitable for creating a trained classifier based on extracted reads using own primers, right?

This would be the quickest way to proceed, as much of the general processing has been performed for you. In effect, you would be continuing from [this step of the tutorial](https://forum.qiime2.org/t/processing-filtering-and-evaluating-the-silva-database-and-other-reference-sequence-data-with-rescript/15494#heading--sixth-header).

Again, if you do not agree with the processing steps outlined in the tutorial you can start from scratch and process as you'd like. _Also, I think the pre-made files are using SILVA 138 and not the updated 138.1 version. This is now the default version in RESCRIPt, i.e. `rescript get-silva-data ...` ._

---

<div class="post-metadata">

**Author:** ![Rob\_DNA](https://forum.qiime2.org/user_avatar/forum.qiime2.org/rob_dna/32/18558_2.png) [@Rob\_DNA](https://forum.qiime2.org/u/Rob_DNA)\
**Post date:** [May 23, 2022, 6:57am UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124/5 "2022-05-23T06:57:23Z")

</div>

Thank you very much 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:** [June 23, 2022, 12:57pm UTC](https://forum.qiime2.org/t/clarification-verification-of-taxonomy-classifiers/23124/6 "2022-06-23T12:57:38Z")

</div>

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