Question: Download fastq files from SRA database using biosample identifier
0
gravatar for Bade
20 months ago by
Bade20
United States
Bade20 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.0k views
ADD COMMENTlink modified 20 months ago by Jenez500 • written 20 months ago by Bade20
0
gravatar for Jenez
20 months ago by
Jenez500
Sweden
Jenez500 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 20 months ago by Jenez500
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: 2035 users visited in the last hour