This is a test version of Biostars. For the public version, visit https://www.biostars.org.
Get corresponding SRA accessions for very large list of Biosample accesions?

I have ~1000 Biosample accessions in a list and I want to get the SRA accession numbers for each of them without doing it manually. Any easy script to do this sort of thing?

I see searching biostars you can easily do the opposite with Enterez direct:

esearch -db sra -query 'SRR5437876' | elink -target biosample | efetch

but swapping out biosample and sra gives me too much extra data to sift through (see below):

esearch -db biosample -query 'SRR5437876' | elink -target sra | efetch

I just want the SRA number

Thanks!

ncbi enterez direct

1 answer

You can do this with EntrezDirect:

$ esearch -db sra -query SAMN06710536 | efetch -format runinfo | cut -f1 -d ","
Run
SRR5437874
SRR5437875
SRR5437876
SRR5437877

Log in to answer this question.