danielecook
6/10/2014 - 7:14 PM

Download all of the sequence Runs for a given experiment from the sequence read archive (SRA); Requires edirect and the sra-toolkit.

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;
}