Last active
March 7, 2024 20:29
-
-
Save slavailn/aecceebc43b898860e734dce5b72d29b to your computer and use it in GitHub Desktop.
Download raw fastq files from SRA with sra tools
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Taken from https://www.biostars.org/p/111040/ | |
# Examine and save metadata | |
esearch -db sra -query PRJNA484081 | efetch -format runinfo > bioproj.csv | |
# The first column of comma separated runinfo file are run ids | |
cat bioproj.csv | cut -d ',' -f 1 | head | |
# Download first 4 files as an example | |
cat bioproj.csv | cut -d ',' -f 1 | grep 'SRR' # Check of we are selecting right files | |
# Download the files | |
cat bioproj.csv | cut -d ',' -f 1 | grep 'SRR' | xargs fastq-dump --split-files | |
# Run in parallel | |
cat bioproj.csv | cut -d ',' -f 1 | grep 'SRR' | xargs -n 1 -P 12 fastq-dump --split-files --gzip --skip-technical |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment