# How to query NCBI (Nucleotide database) by a feature qualifier?

I cannot seem to find a way to query nucleotide database (https://www.ncbi.nlm.nih.gov/nuccore) by a specific qualifier of the feature. For example, by /host under the feature "source". For example, below is a part of one record, where the qualifier /host contains "Bemisia tabaci B". How could I search for all sequences that contain the word "Bemisia" in the qualifier \host?

FEATURES             Location/Qualifiers
source          1..351658
/organism="Candidatus Portiera aleyrodidarum BT-B-HRs"
/mol_type="genomic DNA"
/strain="BT-B"
/host="Bemisia tabaci B"
/db_xref="taxon:1206109"
gene            1..1926
/gene="dnaK"
/locus_tag="C530_RS00005"
/old_locus_tag="C530_001"
CDS             1..1926
/gene="dnaK"
/locus_tag="C530_RS00005"
/old_locus_tag="C530_001"
/inference="COORDINATES: similar to AA
sequence:RefSeq:WP_014894920.1"
/note="Derived by automated computational analysis using
gene prediction method: Protein Homology."
/codon_start=1
/transl_table=11
/product="molecular chaperone DnaK"
/protein_id="WP_014894920.1"
/translation="MIRIIGIDLGTTNSCVAVLENGKSRVIENSEGARTTPSIIAYTD
DNEILIGQTAKRQAVTNPSNTLYAIKRLIGRKFNDDIVQKDIKMVPYKIVSAENGDAW
VQVKNRKLAPPQISAEILKKMKKTAEDYLGEKITEAVITVPAYFNDSQRQATKDAGRI
MATNGDTFLGGEDFDLKLINYIVKQFKLESGVDLSGDSLAMQRLKEAAEKGKIELSSS
DDIILVGGQTRMPLVQKKVAEFFGKEARKDVNPDEAVAMGAAIQGGVLGGDVKDVLLL
DVTPLTLGIETMGGIMTPLIEKNTTIPTKKTQIFSTAEDNQTAVTIHALQGERKKALQ
NKSLGRFDLTDIPPAPRGTPQIEVAFDLDANGILNITAKDKATGKEQSIIIKSSGGLS
NNLEQTLKSDDIKTIKEDLNKLTEEYSTIYQKIYSEKKPQNHNSEPAQKNAEKSSSKK
EGDVVDAEYEEVNNKTK"
...


Best, Milan

• Doesn't it work if you just search for [host]"Bemisia tabaci B"? – terdon May 5 '20 at 14:55
• @terdon Unfortunately it does not. If I try exactly as you wrote, it says "The following terms were ignored: [, ]". If I reverse the query to be "Bemisia tabaci B"[host], then the response is "Unknown field was ignored: [host]." – hlex May 5 '20 at 17:26
• Yes, it says The following terms were ignored: [, ], but the results seem to be what you're looking for, are they not? – terdon May 6 '20 at 8:14
• Almost, it does include sequences that have the term in \host, but it also returns many sequences that do not have \host qualifier at all, but contain the term elsewhere, usually in the name of the sequence (DEFINITION). This is especially visible if you do [host]"Bemisia". – hlex May 6 '20 at 9:01

For this particular query, try host=Bemisia tabaci B[WORD]. However, you may also be interested in related queries like host=Bemisia tabaci B biotype[WORD].

But, I am not sure a general solution exists, as I do not believe all qualifiers are indexed.

Also, you can see how your query is interpreted on the right side under "Search details". For the original attempt ([host]"Bemisia tabaci B"), it is interpreted as:

host[All Fields] AND "Bemisia tabaci B"[All Fields]


while the goal is to produce

host=Bemisia tabaci B biotype[WORD]

• Thanks for confirming it to me, the issue is indeed that this qualifier is not indexed. In the end, I downloaded the results as GenBank file for a much wider search, and then locally imported into BioSQL database where I was able to write queries for every qualifier and get the result I needed. It takes some effort, but the flexibility of running complex queries was amazing to have. – hlex Nov 5 '20 at 13:37