From 3d57e6f489bbe652663fc90769ef5935c97b7934 Mon Sep 17 00:00:00 2001 From: Arun Seetharam Date: Thu, 8 Mar 2018 10:15:11 -0600 Subject: [PATCH] added new scripts and modified histat2 to check completion of steps before proceeding --- runAlignmentStats.sh | 2 +- runHISAT2.sh | 29 ++++++++++++++++++----------- 2 files changed, 19 insertions(+), 12 deletions(-) diff --git a/runAlignmentStats.sh b/runAlignmentStats.sh index 46dc537..a7de85b 100755 --- a/runAlignmentStats.sh +++ b/runAlignmentStats.sh @@ -20,7 +20,7 @@ fi module load R module load java -module load picard +module load picard/2.9.0 module load samtools module load GIF/qualimap diff --git a/runHISAT2.sh b/runHISAT2.sh index 1001c50..b9b74c1 100755 --- a/runHISAT2.sh +++ b/runHISAT2.sh @@ -1,21 +1,28 @@ #!/bin/bash - module load hisat2 module load samtools -DBDIR="/data013/GIF/arnstrm/GENOMEDB" -GENOME="Mus_musculus.GRCm38.dna.toplevel_hisat2" - +DBDIR="/work/GIF/arnstrm/GENOMEDB" +GENOME="$1" +#GENOME="TAIR10" p=16 -R1_FQ="$1" -R2_FQ="$2" - +R1_FQ="$2" +R2_FQ="$3" OUTPUT=$(basename ${R1_FQ} |cut -f 1 -d "_"); - hisat2 \ -p ${p} \ -x ${DBDIR}/${GENOME} \ -1 ${R1_FQ} \ -2 ${R2_FQ} \ - -S ${OUTPUT}.sam &> ${OUTPUT}.log -samtools view --threads 16 -b -o ${OUTPUT}.bam ${OUTPUT}.sam -samtools sort -m 7G -o ${OUTPUT}_sorted.bam -T ${OUTPUT}_temp --threads 16 ${OUTPUT}.bam + -S ${OUTPUT}.sam &> ${OUTPUT}.log || { +echo >&2 "hisat2 alignment failed for ${OUTPUT}" +exit 1 +} +samtools view --threads 16 -b -o ${OUTPUT}.bam ${OUTPUT}.sam || { +echo >&2 "sam to bam conversion failed for ${OUTPUT}" +exit 1 +} +samtools sort -m 4G -o ${OUTPUT}_sorted.bam -T ${OUTPUT}_temp --threads 16 ${OUTPUT}.bam || { +echo >&2 "sorting bam failed for ${OUTPUT}" +exit 1 +} +