Skip to content

Commit

Permalink
added new scripts and modified histat2 to check completion of steps b…
Browse files Browse the repository at this point in the history
…efore proceeding
  • Loading branch information
aseetharam committed Mar 8, 2018
1 parent 34f1632 commit 3d57e6f
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 12 deletions.
2 changes: 1 addition & 1 deletion runAlignmentStats.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
29 changes: 18 additions & 11 deletions runHISAT2.sh
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 3d57e6f

Please sign in to comment.