-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathslurm_hisat2.sh
executable file
·55 lines (42 loc) · 1.49 KB
/
slurm_hisat2.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#!/bin/bash
# @Author: Tobias Jakobi <tjakobi>
# @Date: Friday, May 6, 2016 4:10 PM
# @Email: [email protected]
# @Project: University Hospital Heidelberg, Section of Bioinformatics and Systems Cardiology
# @Last modified by: tjakobi
# @Last modified time: Friday, May 6, 2016 4:22 PM
# @License: CC BY-NC-SA
#SBATCH -n 1
#SBATCH -N 1
#SBATCH -c 40
#SBATCH --mem=250G
#SBATCH -J "HISAT2 alignment"
#SBATCH --mail-type=END,FAIL,TIME_LIMIT_80
#SBATCH [email protected]
module load hisat2
# check if we have 6 arguments
if [ ! $# == 6 ]; then
echo "Usage: $0 [HISAT2 index] [Read 1 file] [Read 2 file] [target dir e.g. /tmp/] [Read 1 marker, e.g. R1] [GTF file]"
exit
fi
# $1 -> Genome index
# $2 -> Read 1
# $3 -> Read 2
# $4 -> Target directory
# remove the file extension and potential "R1" markings
# (works for double extension, e.g. .fastq.gz)
target=`expr ${2/$5/} : '\(.*\)\..*\.'`
# create the target directory, HISAT2 will not do that for us
mkdir -pv $4/$target
OLD_PATH=`pwd`
hisat2 --time -p 40 -x ${1} -1 ${2} -2 ${3} -S $4/$target/Aligned.out.sam \
--summary-file \
--new-summary \
--un-conc-gz $4/$target/ \
--novel-splicesite-outfile $4/$target/novel_splice_sites.csv \
--known-splicesite-infile ${6} \
--rna-strandness FR
cd $4/$target/
samtools view -bS Aligned.out.sam | samtools sort -@ 20 -m 10G -T tempo -o Aligned.out.bam /dev/stdin
samtools index Aligned.out.bam
rm -f Aligned.out.sam