NCBI-Hackathons / EDirectCookbook

MIT License
159 stars 53 forks source link

Retrieve Bioproject IDs and related SRAs within given timerange #50

Closed tbmz closed 4 years ago

tbmz commented 4 years ago

Hi,

I would like to retrieve all NCBI bioproject IDs and the related SRAs for bioprojects that were created within a certain timeframe. I saw the code that retrieves the SRAs for a given bioproject which works, however, I don't manage to limit my search to a specific timeframe.

What I tried to only retrieve bioproject IDs within a given timeframe:

  1. esearch -db bioprojects -query "Mycobacterium tuberculosis" retmax = 10000 | efilter -mindate 2020/02/21 -maxdate 2020/05/01 -datetype crdt --> no error message, but the efilter is ignored
  2. esearch -db bioproject -query "Mycobacterium tuberculosis" -mindate "2020/02/21" -maxdate "2020/05/01" -datetype "CRDT"

Does someone know what I am doing wrong/how I am able to retrieve only results from a specific time range?

vkkodali commented 4 years ago

May be use Registration Date?

esearch -db bioproject -query '"Mycobacterium tuberculosis"[organism] AND "2020/01/01"[Registration Date] : "2020/01/31"[Registration Date]'
tbmz commented 4 years ago

That seems to work, thanks!