Skip to content

Instantly share code, notes, and snippets.

@sjcockell
Last active November 7, 2021 14:35
Show Gist options
  • Save sjcockell/38026befbecb5bf1cbf7a6ecfa11d528 to your computer and use it in GitHub Desktop.
Save sjcockell/38026befbecb5bf1cbf7a6ecfa11d528 to your computer and use it in GitHub Desktop.
Script from Lockdown Learning #16 for downloading from SRA.
#!/bin/bash
VAR=$(tail -n +2 SraRunTable.txt | cut -d ',' -f 1)
# This is a loop for downloading the data
for i in ${VAR}
do
if [ -f ${i}.fastq.gz ]
then
echo "${i} already downloaded"
else
echo "(o) Downloading SRA entry: ${i}"
# downloading SRA entry
fastq-dump --gzip --defline-qual '+' ${i}
echo "(o) Done downloading ${i}"
fi
done
@1minDuan
Copy link

1minDuan commented Nov 7, 2021

Thank you Simon. You made it seem so easy and straight forward for people not so talented like me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment