-
Notifications
You must be signed in to change notification settings - Fork 1
/
slurm_salmon.sh
executable file
·44 lines (34 loc) · 1.21 KB
/
slurm_salmon.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
#!/bin/bash
# @Author: Tobias Jakobi <tjakobi>
# @Date: Friday, May 6, 2016 4:10 PM
# @Email: tobias.jakobi@med.uni-heidelberg.de
# @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 "salmon"
#SBATCH --mail-type=END,FAIL,TIME_LIMIT_80
#SBATCH --mail-user=tobias.jakobi@med.uni-heidelberg.de
module load salmon
# check if we have 5 arguments
if [ ! $# == 5 ]; then
echo "Usage: $0 [Salmon index] [Read 1 file] [Read 2 file] [target dir e.g. /tmp/] [Read 1 marker, e.g. R1]"
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, STAR will not do that for us
mkdir -pv $4/$target
# main mapping part
# Step 5: Run Salmon to quantify with respect to the above extended transcriptome. First, create Salmon index:
# quantify
salmon quant -l A -i ${1} -1 ${2} -2 ${3} -p 40 -o $4/$target/ --validateMappings