forked from bcrone/5-RACE
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_alignment.sh
More file actions
47 lines (38 loc) · 1.36 KB
/
run_alignment.sh
File metadata and controls
47 lines (38 loc) · 1.36 KB
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
#!/bin/bash
cat <<EOF
#!/bin/bash
#SBATCH --job-name=${1}.${2}.${3}.run_alignment
#SBATCH --cpus-per-task=1
#SBATCH --nodes=1
#SBATCH --ntasks-per-node=1
#SBATCH --mem-per-cpu=20g
#SBATCH --time=5:00:00
#SBATCH --account=
#SBATCH --partition=
#SBATCH --output=logs/%x.log
module load Bioinformatics
module load minimap2/2.14-jvscyil
module load samtools
REF_FA="/path/to/hg38_no_alt.mmi"
SPLICE_FA="/path/to/GCA_000001405.15_GRCh38_no_alt_analysis_set.fna"
DATA_DIR=""
EXP="$1"
SAMPLE="$2"
PRIMER="$3"
SAMPLE_FASTQ="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.fastq.gz"
SAMPLE_SAM="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.sam"
SPLICE_SAM="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.splice.sam"
SORTED_BAM="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.sorted.bam"
SORTED_BAI="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.sorted.bai"
SPLICE_BAM="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.splice.sorted.bam"
SPLICE_BAI="\${DATA_DIR}/\${EXP}/\${SAMPLE}_\${PRIMER}.splice.sorted.bai"
minimap2 -ax map-ont --secondary=no \${REF_FA} \${SAMPLE_FASTQ} > \${SAMPLE_SAM}
samtools sort \${SAMPLE_SAM} | samtools view -bS > \${SORTED_BAM}
samtools index \${SORTED_BAM}
rm \${SAMPLE_SAM}
minimap2 -ax splice --secondary=no \${SPLICE_FA} \${SAMPLE_FASTQ} > \${SPLICE_SAM}
samtools sort \${SPLICE_SAM} | samtools view -bS > \${SPLICE_BAM}
samtools index \${SPLICE_BAM}
rm \${SPLICE_SAM}
exit
EOF