How to set NCBI entrez to pipe or ignore errors?
0
0
Entering edit mode
15 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?

NCBI Entrez • 440 views
ADD COMMENT
1
Entering edit mode

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.

ADD REPLY

Login before adding your answer.

Traffic: 3146 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6