...
Save a list of SRA accession numbers to download in a file called SraAccList.txt
Code Block |
---|
|
SRR1039508
SRR1039509
SRR1039510
SRR1039511
SRR1039512
SRR1039513
SRR1039514
SRR1039515
SRR1039516
SRR1039517
SRR1039518
SRR1039519
SRR1039520
SRR1039521
SRR1039522
SRR1039523 |
Use the following PBS Pro submission script to fetch the FASTQ files for all listed samples. Note, data will be downloaded to the folder where the job is submitted. Example script (fetch_SraAccList.pbs).
Option 1:
Code Block |
---|
|
#!/bin/bash
#usage: ./fetch_SraAccList.sh SraAccList.txt
for r1 in `cat $1`;
do
qsub <<EOF
#!/bin/bash -l
#PBS -N sra_fetch$(basename $r1)
#PBS -l walltime=810:00:00
#PBS -l mem=8gb8G
#PBS -l ncpus=4
cd $PBS_O_WORKDIR
#activate conda environment
conda activate sra
#fetch FASTQ files
prefetch $r1
fastq-dump --split-files $r1
EOF
done |
Option 2:
Code Block |
---|
|
#!/bin/bash
#PBS -mN baeSRA
###PBS#PBS -M email@hostl walltime=12:00:00
#PBS -jl oemem=8G
#PBS #Usage: qsub fetch_SraAccList.pbs-l ncpus=4
cd $PBS_O_WORKDIR
#activate conda environment
conda activate sra
LIST='SraAccList.txt'
#fetch FASTQ files
for i in `cat SraAccList.txt`$LIST`;
do
echo $i
prefetch $i
fastq-dump --split-files $i
done |
Submit the job to the HPC cluster:
Code Block |
---|
|
./fetch_SraAccList.sh SraAccList.txt |
Monitor jobs: