I wish to efficiently search nuccore to retrieve only annotated sequences.
By "annotated" I mean that the nuccore entry contains annotation information.
An equivalent definition (if I understand correctly) is that the entry's
Feature Table isn't empty.
The table can be downloaded by clicking
Send to in the web page of the nuccore entry.
Alternatively, the table can be downloaded using Biopython:
Entrez.efetch(db='nuccore', id=nuccore_id, rettype='ft')
This definition suggests one answer to my question: Search nuccore normally, then for each entry download its
Feature Table, and discard each nuccore entry whose table is empty.
The problem is that this would be very inefficient.
My best idea thus far is to add
gene[Feature key] to my search term.
E.g., instead of
"escherichia coli"[Primary Organism], use
("escherichia coli"[Primary Organism]) AND gene[Feature key].
This seems to work, but also feels like a quite dirty hack.
Is this a good idea? Or am I missing something crucial here?
Another idea I had was using (Biopython)
Entrez.esummary(db='nuccore', id=nuccore_id), and hopefully finding there a
is_sequence_annotated flag or something similarly wonderful. One of the fields
Entrez.esummary returns is
Flags, but I have no idea how to parse it. I asked about it in another question.