Download fastq files from SRA database using biosample identifier
1
1
Entering edit mode
7.6 years ago
Bade ▴ 40

Hi All,

I have a list of biosample identifiers like SAMN01096167, SAMN01096168 and SAMN01096169. Is there anyway I can download FASTQ files from SRA database using these identifiers? Usually, I use fastq-dump with SRR identifiers to download files like this:

fastq-dump -A SRR1642913 --split-files

But fastq-dump doesn't works for biosample identifiers. I would appreciate your suggestions.

Bade

SRA FASTQ • 4.4k views
ADD COMMENT
1
Entering edit mode
7.6 years ago
Jenez ▴ 540

This should work. Utilizes Entrez direct. ftp://ftp.ncbi.nlm.nih.gov/entrez/entrezdirect/

while read row; do sra_id=$(esearch -db sra -query $row </dev/null | efetch -format docsum | xtract -pattern Runs -element Run@acc); fastq-dump -A $sra_id --split-files; done < file_with_ids.txt

The /dev/null is necessary because esearch eats the stdin otherwise which causes the loop to only run once.

ADD COMMENT

Login before adding your answer.

Traffic: 1508 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6