kblin / ncbi-acc-download

Download files from NCBI Entrez by accession
Apache License 2.0
111 stars 8 forks source link

Accession range support? #16

Open peterjc opened 4 years ago

peterjc commented 4 years ago

For a continuous range of accessions, the following range notation is common both in human readable text like data availablitlity sections in papers, and in NCBI cross-references. Could the tool spot this and expand the range automatically? e.g.

$ ncbi-acc-download EF590893-EF590896

Internally expand this to:

$ ncbi-acc-download EF590893 EF590894 EF590895 EF590896

Workaround, handy if you just have a couple of ranges to fetch:

for i in {590893..590896}; do ncbi-acc-download EF${i}; done

(Updated to fix typo, range was not increasing)

kblin commented 4 years ago

There's some logic in ncbi-acc-download that already knows how to do this for WGS record recursive downloads. Should be easy to expand to this use case, I'll give this a look.