This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Entrez direct does not give output sometimes

Does anyone know why sometimes my Entrez direct command gives no output at all?

I installed Entrez direct using the commands listed on the website:

sh -c "$(curl -fsSL ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/install-edirect.sh)"

export PATH=${PATH}:${HOME}/edirect

Then, my below command sometimes gives my desired output (all the gene tables corresponding to that protein ID), but now it doesn't give any output at all.

esearch -db protein -query NP_001013036.1 | elink -target gene | efetch -format gene_table > whole_table.txt

If anyone know why this is happening please let me know... Any input would be greatly appreciated, thank you

entrez_direct entrez

1 answer

Did you sign up for NCBI_API_KEY? Use it when you do these queries.

NCBI is a public resource so if you are doing a large number of queries put a pause between query blocks. Even with NCBI API Key you are allowed a certain number of queries per unit time.

The query above does work.

$ esearch -db protein -query NP_001013036.1 | elink -target gene | efetch -format gene_table
APP amyloid beta precursor protein[Pan troglodytes]
Gene ID: 473931, updated on 31-Mar-2023


Reference NHGRI_mPanTro3-v1.1-hic.freeze_pri NC_072419.1  (minus strand) from: 24584412 to: 24299610
mRNA transcript variant X4 XM_009452766.4, 16 exons,  total annotated spliced exon length: 3430
protein isoform X4 XP_009451041.1, 16 coding  exons,  annotated AA length: 695

Exon table for  mRNA  XM_009452766.4 and protein XP_009451041.1
Genomic Interval Exon       Genomic Interval Coding     Gene Interval Exon      Gene Interval Coding        Exon Length Coding Length   Intron Length
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
24584412-24584130       24584186-24584130       1-283       227-283     283     57      58502
24525627-24525460       24525627-24525460       58786-58953     58786-58953     168     168     21867
24503592-24503463       24503592-24503463

It is possible that some ID's may not work for various reasons (e.g. they could be deprecated). Entrezdirect does not have a good error handling mechanism built-in so you will need to deal with the errors after the search.

Log in to answer this question.