# Custom BLAST database fails to assign taxonomy

**URL:** https://forum.qiime2.org/t/custom-blast-database-fails-to-assign-taxonomy/12872
**Category:** User Support
**Tags:** taxonomy
**Created:** [December 13, 2019, 12:51am UTC](https://forum.qiime2.org/t/custom-blast-database-fails-to-assign-taxonomy/12872 "2019-12-13T00:51:20Z")
**Posts on this page:** 1
**Showing post:** 2

<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: [December 13, 2019, 12:59am UTC](https://forum.qiime2.org/t/custom-blast-database-fails-to-assign-taxonomy/12872/2 "2019-12-13T00:59:00Z")

</div>

Hi @laura.d,  
Thanks for posting examples of your reference data! Allows me to very quickly diagnose the issue: consensus taxonomic assignment is failing because your reference taxonomy consists of only one level, and so when a query sequence hits two distinct reference taxa the result is "unassigned" — this classifier is not simply using BLAST, it follows the BLAST alignment with a consensus assignment step in q2-feature-classifier. See this topic for more details on this diagnosis and some potential fixes:

> [@Extracting sequences identified as a certain taxa and classifying with another database](https://forum.qiime2.org/t/extracting-sequences-identified-as-a-certain-taxa-and-classifying-with-another-database/11860/12):
>
> Thanks for sharing your files, @c.older! I was able to replicate this issue and I think I found the problem. So your taxonomy file consists of only one level, the species designation. There is not basal taxonomy or semicolon-delimited lineage. So the vsearch classifier is reporting "unassigned" because it cannot find any consensus among the multiple hits. So let me break down what is happening: Your query sequence 49792e... is being compared against the reference database and grabs up to N hit…

So you have two fixes:

1. Fix the reference taxonomy to contain multiple levels, as described in that topic
2. Maybe you don't want to have multiple levels? Maybe you cannot? You could always set `--p-maxaccepts 1` so that BLAST just returns the top hit... not what I recommend but just clarifying that's how to do that if that's what you are after.

I personally recommend the `classify-consensus-vsearch` in q2-feature-classifier instead of BLAST... among other reasons it has a top hits only option that could be put to good use with your custom database.

> [@laura.d](#):
>
> I also performed the same process in Geneious - created a BLAST database then performed a BLAST search of the sequences used to create the database against that database and it worked just fine.

Probably because Geneious is performing top-hit BLAST instead of the consensus step that q2-feature-classifier has implemented.

Give that a spin and let me know how it goes!

---

_[View the full topic](https://forum.qiime2.org/t/custom-blast-database-fails-to-assign-taxonomy/12872)._
