This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Problem using efetch -format acc, not the right accessions returned

I am trying to download a large list of SRA accessions through a search.

esearch -db sra -query "txid28901[Organism:exp]

returns 560039 entries. However, when I pipe it to efetch, the SRAs returned are not part of the results.

esearch -db sra -query "txid28901[Organism:exp]" | efetch -format acc -start 1 -stop 2

returns BZ591349.1 and BZ590319.1, which are not the organism I want. I only used start/stop as an example, but without it this command seemingly downloads ALL the SRA accessions.

Using

esearch -db sra -query "txid28901[Organism:exp]" | efetch -format runinfo -start 1 -stop 2

returns the correct runs but I only want the first column, the Run without having to download the whole file, which is large for 500k.

Am I using efetch incorrectly?

efetch esearch edirect entrez

1 answer

Try this:

$ esearch -db sra -query "txid28901[Organism:exp]" | efetch -format runinfo -mode xml | xtract -pattern Row -element Run

SRR24015960
SRR24015937
SRR24015945
SRR24015948
SRR24015939

That worked thank you!! Now the slow process of downloading...

Log in to answer this question.