Odd behaviour - NCBI Eutils
1
0
Entering edit mode
9 months ago
npb27 • 0

Hi,

I'm having some weird behaviour for esearch interpreting variables from the bash command line. I have a list of NCBI protein IDs, and I want to obtain the nucleotide database ID for the associated genome/contig as well as the genome length

This works:

esearch -db protein -query "GIR74039.1" | elink -target nuccore | efetch -format docsum

This works:

i="GIR74039.1"
esearch -db protein -query $i | elink -target nuccore | efetch -format docsum

This doesn't work:

INPUT contains only the protein sequence ID shown above

cat INPUT | while read i
do
echo $i
esearch -db protein -query ${i} | elink -target nuccore | efetch -format docsum > temp
done

Here's the error I'm getting

WARNING:  FAILURE ( Mon  4 Mar 15:58:07 GMT 2024 )
 -tool edirect -edirect 16.2 -edirect_os Linux -email XXX@XXX.ac.uk0 -usehistory y -db protein -term GIR74039.1
<ERROR>Empty term and query_key - nothing todo</ERROR>
SECOND ATTEMPT
 WARNING:  FAILURE ( Mon  4 Mar 15:58:09 GMT 2024 )
 -tool edirect -edirect 16.2 -edirect_os Linux -email XXX@XXX.ac.uk0 -usehistory y -db protein -term GIR74039.1
<ERROR>Empty term and query_key - nothing todo</ERROR>
LAST ATTEMPT
 ERROR:  FAILURE ( Mon  4 Mar 15:58:11 GMT 2024 )
 -tool edirect -edirect 16.2 -edirect_os Linux -email XXX@XXX.ac.uk0 -usehistory y -db protein -term GIR74039.1
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE eSearchResult>
<eSearchResult>
  <ERROR>Empty term and query_key - nothing todo</ERROR>
</eSearchResult>
QUERY FAILURE
 ERROR:  WebEnv value not found in elink input
 ERROR:  Missing -db argument

(I censored my email from the output)

I've tried all combinations I can think of single/double quotes and {} around the $i variable, none help

I think the record is still being found by esearch as it's mentioned in the error. This seems like an odd error from esearch

NCBI Eutils esearch Eutilities efetch • 613 views
ADD COMMENT
0
Entering edit mode
9 months ago
GenoMax 148k

Can you provide a list of ID's that are failing? Do they work if you try them individually without the while loop?

You may want to use epost method instead of the loop.

ADD COMMENT
0
Entering edit mode

One ID that isn't working is shown in the question, they work individually

Many thanks, I wasn't aware of epost but this solved the issue

This now works:

head -n1 INPUT | while read i
do
echo $i
echo $i | epost -db protein  | elink -target nuccore | efetch -format docsum > temp
done
ADD REPLY
0
Entering edit mode

Same problem here :

esearch -db pubmed -query "(RAB5C-AS1)OR(ENSG00000267658)"

With the error :

WARNING:
FAILURE ( lun. déc.  9 12:15:32 CET 2024 )
nquire -url https://eutils.ncbi.nlm.nih.gov/entrez/eutils/ esearch.fcgi -retmax 0 -usehistory y -db pubmed -term \(RAB5C-AS1\)OR\(ENSG00000267658\) -tool edirect -edirect 14.9 -edirect_os Linux -email xxxx
<ErrorList>
  <PhraseNotFound>RAB5C-AS1</PhraseNotFound>
  <PhraseNotFound>ENSG00000267658</PhraseNotFound>
<ErrorList>
ADD REPLY
0
Entering edit mode

Following produces a result:

$ esearch -db pubmed -query "RAB5C antisense RNA 1"
<ENTREZ_DIRECT>
  <Db>pubmed</Db>
  <QueryKey>1</QueryKey>
  <Count>25</Count>
  <Step>1</Step>
</ENTREZ_DIRECT>
ADD REPLY
0
Entering edit mode

I agree, I had indeed noticed that you could access the result by modifying certain formulations. However, this doesn't answer the question "what's stopping the query from working?" because I have a very large number of queries that don't work. I can't afford to do manual checks for automatic querying ...

ADD REPLY
0
Entering edit mode

Only way would be to report this to NCBI help desk. They will respond but be ready to wait for a few business days.

ADD REPLY

Login before adding your answer.

Traffic: 1996 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