-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added new scripts and modified histat2 to check completion of steps b…
…efore proceeding
- Loading branch information
1 parent
34f1632
commit 3d57e6f
Showing
2 changed files
with
19 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
|