How can I change the default path to which SRA files are downloaded?
5
11
Entering edit mode
8.6 years ago
Cacau ▴ 520

By default, SRA files will be downloaded to ~/ncbi/ncbi_public/sra by using sratoolkit from ncbi. However, there is limited space. So I want to change the path. Is there a way to download SRA files using sratoolkit (fastq-dump) or can I download the SRA files directly without parsing converting it into fastq files?

RNA-Seq • 25k views
ADD COMMENT
11
Entering edit mode
8.6 years ago
piet ★ 1.8k

Yes, one of the shortcomings of sratoolkit is, that it stores huge temporary files in your home directory, which may have limited space and my be mounted via NFS.

The official way for changing several settings is to use vdb-config. This program simply creates a config file named $HOME/.ncbi/user-settings.mkfg. But its much easier to create and edit this file with a text editor or on the command line.

The following will change the cache directory to /tmp:

echo '/repository/user/main/public/root = "/tmp"' > $HOME/.ncbi/user-settings.mkfg
ADD COMMENT
8
Entering edit mode
8.6 years ago
sunhanice ▴ 240

I always downloaded SRA files directly using wget, and then converted them to fastq.tar.gz locally with fastq-dump.

The file address for SRA file is like this format:

/sra/sra-instant/reads/ByRun/sra/{SRR|ERR|DRR}/<first 6 characters of accession>/<accession>/<accession>.sra

For example:

ftp://ftp-trace.ncbi.nih.gov/sra/sra-instant/reads/ByRun/sra/SRR/SRR119/SRR1192353/SRR1192353.sra

ADD COMMENT
0
Entering edit mode

This is simple! Thanks!

ADD REPLY
0
Entering edit mode

This is super easy, but you still have to extract the FASTQ files from the SRA file using fastq-dump. So it might be just easier to just use fastq-dump, changing the default save directory, according to piet's post.

[UPDATE] Funny enough, just because I posted this, I changed the configuration as by piet's post (which it has worked for me in the past), but now files are still being saved to my home directory for no reason.. gah... downloading SRA files and extracting fastq locally using fastq-dump will probably be the way to move forward.

ADD REPLY
0
Entering edit mode

Unfortunately, NCBI recommends against directly downloading files as of 2019. Basically, prefetch everything.

ADD REPLY
4
Entering edit mode
ADD COMMENT
1
Entering edit mode
8.1 years ago
Tao ▴ 530

You will find the answer here and here.

ADD COMMENT
0
Entering edit mode

So complicated! Thanks!

ADD REPLY

Login before adding your answer.

Traffic: 2407 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