This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Extract locus length given locus accession number

Hello, I want to find a simple way (API or batch query) to extract locus length from locus accession number.

For example: Given JF752342.1 I want to extract 59320 which is the length of this locus.


https://www.ncbi.nlm.nih.gov/nuccore/JF752342.1

Any API or any batch query?

Regards,

genome ncbi api

1 answer

Using EntrezDirect:

$ esearch -db nuccore -query "JF752342" | esummary | xtract -pattern DocumentSummary -element Caption,Slen
JF752342    59320

Log in to answer this question.