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