Skip to content

Instantly share code, notes, and snippets.

@danielecook
Last active August 29, 2015 14:02
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 danielecook/abd4cd73097304e375b3 to your computer and use it in GitHub Desktop.
Save danielecook/abd4cd73097304e375b3 to your computer and use it in GitHub Desktop.
Download all of the sequence Runs for a given experiment from the sequence read archive (SRA); Requires edirect and the sra-toolkit.
function SRX_fetch_fastq() {
sra_set=`esearch -db sra -query $1 | efetch -format docsum | xtract -element Run@acc`
echo "Downloading Run $1:"
echo ${sra_set}
echo "-------"
for SRA in $sra_set; do
echo "Downloading $SRA"
fastq-dump $SRA
done;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment