Entering edit mode
22 months ago
rijan_dhakal
▴
10
I am using the following one-liner with NCBI entrez
to query their databases from the terminal:
esearch -db assembly -query ${species name} | xtract -pattern ENTREZ_DIRECT -element Count
which works a charm but occasionally it sends an xml error that messes up the output.
Here is an example of the error:
FAILURE ( Fri Jan 27 01:12:44 PM CST 2023 )
nquire -url https://eutils.ncbi.nlm.nih.gov/entrez/eutils/ esearch.fcgi -retmax 0 -usehistory y -db assembly -term "Crepis commutata" -tool edirect -edirect 18.7 -edirect_os Linux -email {}
<ErrorList>
<PhraseNotFound>commutata</PhraseNotFound>
<PhraseNotFound>Crepis commutata[All Fields]</PhraseNotFound>
<ErrorList>
SECOND ATTEMPT
Entrez, unfortunately, does not have a man page or --help
entry on my installation for some reason and I am not quite sure where I should change the one-liner to change this behavior.
Does anyone have any clues?
My guess is that NCBI does not provide a mechanism to handle these/any errors gracefully. You may need to weed these errors out afterwards from output.