Skip to content

Instantly share code, notes, and snippets.

@slavailn
Last active March 7, 2024 20:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save slavailn/aecceebc43b898860e734dce5b72d29b to your computer and use it in GitHub Desktop.
Save slavailn/aecceebc43b898860e734dce5b72d29b to your computer and use it in GitHub Desktop.
Download raw fastq files from SRA with sra tools
# 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