Last active
November 7, 2021 14:35
-
-
Save sjcockell/38026befbecb5bf1cbf7a6ecfa11d528 to your computer and use it in GitHub Desktop.
Script from Lockdown Learning #16 for downloading from SRA.
This file contains 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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you Simon. You made it seem so easy and straight forward for people not so talented like me.