- Install
Entrez Direct
command line tool. See instructions here https://www.ncbi.nlm.nih.gov/books/NBK179288/ - Make a list of BioSample IDs, one line per sample
- Run the
efetch
,elink
andxtract
tools to fetch the SRA run IDs
cat biosample_ids.txt | while read SAMPLE ; do
SRR=`elink -db Biosample -id $SAMPLE -target sra \
| efetch -format docsum \
| xtract -pattern Runs -element Run@acc \
| tr '\n' ','`
echo $SAMPLE $SRR;
sleep 1;
done > sample2srr_map.txt