Permalink
Switch branches/tags
Nothing to show
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 48 lines (32 sloc) 776 Bytes
#!/bin/bash
# module init required when running on non-OSG resources, and has to sourced
# before set -e as sometimes it exits non-0 when a module environment is
# already set up
. /cvmfs/oasis.opensciencegrid.org/osg/sw/module-init.sh
set -e
module load java/8u25
module load sra/2.8.0
if [ "$#" -eq 4 ] ; then
SRA_ID=$1
FORWARD=$2
REVERSE=$3
LAYOUT=$4
elif [ "$#" -eq 3 ] ; then
SRA_ID=$1
FORWARD=$2
LAYOUT=$3
fi
if [ $LAYOUT = "paired" ] ; then
fastq-dump --split-files --gzip $SRA_ID
mv ${SRA_ID}_1.fastq.gz $FORWARD
mv ${SRA_ID}_2.fastq.gz $REVERSE
echo
ls -lh
echo
elif [ $LAYOUT = "single" ] ; then
fastq-dump --gzip $SRA_ID
mv ${SRA_ID}.fastq.gz $FORWARD
echo
ls -lh
echo
fi