# Feature-classifier with Blast reference dataset

**URL:** <https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891>\
**Category:** User Support\
**Tags:** feature-classifier\
**Created:** [July 5, 2018, 2:18am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891 "2018-07-05T02:18:44Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benedict](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/ecd19e/32.png) [@Benedict](https://forum.qiime2.org/u/Benedict)\
**Post date:** [July 5, 2018, 2:18am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/1 "2018-07-05T02:18:44Z")

</div>

Dear Qiime2 users,

May I know if there's any method to do the taxonomy assignment of query sequences against NCBI database? I have executed taxonomy assignment against Greengenes classifier as exactly way as the tutorial, yet I would like to compare the result with other accountable databases for a more reliable data.

So far as I know, there's a link being annotated to each unique features for direct blast to NCBI website, but it's super time-consuming. Would like to look for a more prompt way to blast them together? Take for an instance, download the 16S database from NCBI web and trim to V3-V4 region of ref seqs and train it to a usable classifier? If so, any database in NCBI will you recommend? If training into classifier, a robust taxonomy reference will be needed as well, where can I obtain it?

I tried to train my SILVA classifier targeting V3-V4 region of 16S rRNA, yet it was failed due to memory error. I found that there's a pre-trained full length SILVA classifier available in Qiime resource page, may I know if this classifier can be applied to assign the query sequences for V3-V4 region?

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [July 5, 2018, 3:13am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/2 "2018-07-05T03:13:09Z")

</div>

Hi @Benedict,

Have you had a chance to look through this new awesome [tutorial](https://docs.qiime2.org/2018.6/tutorials/overview/#taxonomy-classification-and-taxonomic-analyses) that discusses the various taxonomic classifications available in qiime2 including classifying against Blast using the [classify-consensus-blast](https://docs.qiime2.org/2018.6/plugins/available/feature-classifier/classify-consensus-blast/) plugin? This should cover a lot of the questions you have.

> [@Benedict](#):
>
> may I know if this classifier can be applied to assign the query sequences for V3-V4 region?

This may certainly be used but it may just take a bit longer since it's going through the full region. There may be some small improvements if you were to use a classifier trained to that specific region but I think those differences will be minor, especially with a larger region like V3-V4. The tutorial linked above does discuss this a bit more. Have a go through those and let us know if anything doesn't make sense.

---

<div class="post-metadata">

**Author:** ![Benedict](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/ecd19e/32.png) [@Benedict](https://forum.qiime2.org/u/Benedict)\
**Post date:** [July 10, 2018, 9:10am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/3 "2018-07-10T09:10:19Z")

</div>

Hi,  
Thank you for your response. I just go through the new tutorial as mentioned above. However, I still have some perplexity as listed beneath:-

1. What's means by MAXIMUM NUMBER OF HITS to keep for each query? Should I follow the default setting as 10?
2. What does it mean by Minimum fraction of assignments must match top hit to be accepted as consensus assignment? The default setting is 0.51? What's this figure implies for?
3. May I know any website to download the reference seq and reference taxonomy? I'm doing bacterial community associated with plant, targeting V3-V4 region of 16S rRNA. I tried out NB classifier with Greengenes database, yet, there're too many assignment without specific name.

---

<div class="post-metadata">

**Author:** ![ebolyen](https://forum.qiime2.org/user_avatar/forum.qiime2.org/ebolyen/32/11_2.png) [@ebolyen](https://forum.qiime2.org/u/ebolyen)\
**Post date:** [July 10, 2018, 4:45pm UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/4 "2018-07-10T16:45:31Z")

</div>



---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [July 11, 2018, 3:46am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/8 "2018-07-11T03:46:08Z")

</div>

Hi @Benedict,  
You can read about the default parameters and their description and implications in [this paper](https://microbiomejournal.biomedcentral.com/articles/10.1186/s40168-018-0470-z).  
In this method you're basically comparing your reference databases taxonomy assignment of your query to the top hits of blast and coming to a 'consensus' level for which you will assign taxonomy to that feature. Starting at the Kingdom level and descending until there is no longer a consensus.

> [@Benedict](#):
>
> What’s means by MAXIMUM NUMBER OF HITS to keep for each query? Should I follow the default setting as 10?

This is the number of the top hits from Blast that you are going to look at when comparing to your reference database.

> [@Benedict](#):
>
> What does it mean by Minimum fraction of assignments must match top hit to be accepted as consensus assignment? The default setting is 0.51? What’s this figure implies for?

This is the minimum fraction of those hits that must match to your reference assignment before you reach 'consensus'.

> [@Benedict](#):
>
> May I know any website to download the reference seq and reference taxonomy? I’m doing bacterial community associated with plant, targeting V3-V4 region of 16S rRNA.

Have a look through [this section](https://docs.qiime2.org/2018.6/data-resources/) for some popular reference databases.

> [@Benedict](#):
>
> I tried out NB classifier with Greengenes database, yet, there’re too many assignment without specific name.

Can you clarify what you mean by without specific name? Do you mean that there is no assignment at all (Unassigned) or perhaps only at Kingdom level? Or you're simply not getting species level? If the former, then there might be some more concerning problems with your feature table, for example if your primers/barcodes were not removed from your reads prior to denoising. If the latter, then consider that not reaching species level resolution is very common for 16S short-target amplicon sequencing as the read length simply may not be long enough to differentiate taxa at the species level.

---

<div class="post-metadata">

**Author:** ![Mehrbod\_Estaki](https://forum.qiime2.org/user_avatar/forum.qiime2.org/mehrbod_estaki/32/4001_2.png) [@Mehrbod\_Estaki](https://forum.qiime2.org/u/Mehrbod_Estaki)\
**Post date:** [July 11, 2018, 3:51am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/9 "2018-07-11T03:51:26Z")

</div>



---

<div class="post-metadata">

**Author:** ![Benedict](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/ecd19e/32.png) [@Benedict](https://forum.qiime2.org/u/Benedict)\
**Post date:** [July 11, 2018, 4:04am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/10 "2018-07-11T04:04:35Z")

</div>

Hi,

That's mean the greengenes reference seq can be used in classify-consensus-blast? I thought the dataset can be obtained from ncbi\>download\>FTP only. Sorry go off on a tangent, do you have any suggestion to download the v3-v4 region of 16S rRNA from NCBI website? Any keyword suggested? (I'm too new in Bioinfo world...)  
And regarding to the question pertaining to unspecific name of some assignment, it was the latter explanation - not getting down to species lvl. Will take your justification into my deliberation, thanks!

---

<div class="post-metadata">

**Author:** ![thermokarst](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/t/8e7dd6/32.png) [@thermokarst](https://forum.qiime2.org/u/thermokarst)\
**Post date:** [July 11, 2018, 5:51pm UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/12 "2018-07-11T17:51:47Z")

</div>



---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 11, 2018, 6:19pm UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/13 "2018-07-11T18:19:59Z")

</div>

> [@Benedict](#):
>
> That’s mean the greengenes reference seq can be used in classify-consensus-blast?

Yes. Any fasta sequence data, in fact, can be used (with accompanying taxonomy in the same format used by greengenes). Once it is imported as a QIIME2 `FeatureData[Sequence]` artifact.

The reason: classify-consensus-blast is **NOT** the same as NCBI BLAST. Read the paper that @Mehrbod_Estaki linked to — the `classify-consensus-*` methods wrap an alignment algorithm (blast+ or vsearch) for database searching, but then use a LCA method to find consensus taxonomy. So the same underlying algorithm for database searching, but with some code to determine taxonomic consensus among hits.

The database is searched for matches to a query sequence. The top `maxaccepts` hits in the database are retained that have ≥ `perc-identity` to the query; consensus taxonomy is assigned by finding the deepest taxonomic rank where `min-consensus` of the hits share the same assignment. So the default parameters find the 10 best hits in the database with ≥ 80% identity to the query, and taxonomy is assigned to the rank where more than half of these hits share the same lineage.

Those parameter names (obviously excluding those used for LCA consensus assignment) are the same used by `blastn` — so you can check out the blastn documentation for more details on the underlying algorithm.

The default parameters are based on the results of that paper that @Mehrbod_Estaki linked to. You can alter these to exclude the LCA consensus assignment by setting `maxaccepts` to 1.

> [@Benedict](#):
>
> regarding to the question pertaining to unspecific name of some assignment, it was the latter explanation - not getting down to species lvl.

So that is the intended behavior of this method, to prevent "overclassification". Short DNA segments (e.g., V3-V4) can only contain so much information, and it is very difficult to reliably classify to species level (read that paper @Mehrbod_Estaki linked to). Doing something like top BLAST hit is a bad idea, because that is just the closest match, not the right match (or even necessarily better than other hits that are equally close) — it will give you a species name even though that is probably not correct, and other similar species may be equally close to the query. That is what we call "overclassification". To prevent that, we use methods that incorporate prediction confidence (e.g., `classify-sklearn`) or LCA consensus assignment to figure out the most specific lineage that a sequence may _reliably_ belong to. For 16S rRNA gene amplicons, this is most frequently genus level (when classified correctly!) which is at times unsatisfying but technically correct.

If you are not worried about overclassifying, check out that paper to see parameter settings that will allow you to overclassify with some degree of safety.

> [@Benedict](#):
>
> do you have any suggestion to download the v3-v4 region of 16S rRNA from NCBI website?

For 16S I would just recommend using the Greengenes or SILVA databases, because otherwise you will need to format your own taxonomy strings from NCBI sequences.

I would also recommend just downloading the full 16S sequences and then trimming to V3-V4 (e.g., with `qiime feature-classifier extract-reads`)

Good luck!

---

<div class="post-metadata">

**Author:** ![Nicholas\_Bokulich](https://forum.qiime2.org/user_avatar/forum.qiime2.org/nicholas_bokulich/32/19937_2.png) [@Nicholas\_Bokulich](https://forum.qiime2.org/u/Nicholas_Bokulich)\
**Post date:** [July 11, 2018, 6:20pm UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/14 "2018-07-11T18:20:04Z")

</div>



---

<div class="post-metadata">

**Author:** ![Benedict](https://forum.qiime2.org/letter_avatar_proxy/v4/letter/b/ecd19e/32.png) [@Benedict](https://forum.qiime2.org/u/Benedict)\
**Post date:** [July 12, 2018, 1:53am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/15 "2018-07-12T01:53:03Z")

</div>

Thank you @Nicholas_Bokulich. It's really informative explanation which make my mind crystal clear on the operation of classify-consensus!

---

<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 12, 2018, 7:53am UTC](https://forum.qiime2.org/t/feature-classifier-with-blast-reference-dataset/4891/16 "2018-08-12T07:53:09Z")

</div>

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