Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mooreryan
Last active November 29, 2021 18:01
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 mooreryan/b17888a1318ff5aad14667c7f6f9937d to your computer and use it in GitHub Desktop.
Save mooreryan/b17888a1318ff5aad14667c7f6f9937d to your computer and use it in GitHub Desktop.
Download reads from the SRA
#!/bin/bash
if [[ $# -ne 3 ]]; then
>&2 echo "usage: download_sra_reads <acc_list.txt> <outdir> <num_threads>"
exit 1
fi
NUM_THREADS="${3}"
OUTDIR="${2}"
ACC_LIST="${1}"
parallel --jobs ${NUM_THREADS} --retries 3 \
fastq-dump \
--defline-seq "'@\$ac \$sn/\$ri'" \
--defline-qual "'+\$ac \$sn/\$ri'" \
--split-e \
--disable-multithreading \
--outdir ${OUTDIR} \
{} \
<${ACC_LIST}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment