Question: Download fastq files from SRA database using biosample identifier
0
gravatar for Bade
2.2 years ago by
Bade30
United States
Bade30 wrote:

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

fastq sra • 1.4k views
ADD COMMENTlink modified 2.2 years ago by Jenez510 • written 2.2 years ago by Bade30
0
gravatar for Jenez
2.2 years ago by
Jenez510
Sweden
Jenez510 wrote:

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 COMMENTlink written 2.2 years ago by Jenez510
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 2.3.0
Traffic: 894 users visited in the last hour