-
Notifications
You must be signed in to change notification settings - Fork 1
/
leafcutterFilePrep.sh
49 lines (42 loc) · 1.64 KB
/
leafcutterFilePrep.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
#!/bin/bash
### UVA-CPHG MILLER LAB'S LEAFCUTTER FILE PREP PIPELINE ###
#Flags:
main_dir="PATH_TO_DATA"
BAM_dir="PATH_TO_BAM_FILES"
JUNC_dir="PATH_JUNC_FILES"
##################################################################################################
### INDEX BAM FILES WITH SAMTOOLS ###
module load samtools/1.10
cat ${main_dir}/samples.txt | while read sample || [[ -n $line ]];
do
sbatch -A "GROUP" \
-p parallel \
-t 1:00:00 \
--mem=10g \
-N 2 \
-n 20 \
--job-name=${sample}_index_log.out \
--wrap="samtools index ${BAM_dir}/${sample}_Aligned.sortedByCoord.out.bam"
done
##################################################################################################
##################################################################################################
### JUNCTION FILE CREATION ###
cat ${main_dir}/samples.txt | while read sample || [[ -n $line ]];
do
sbatch -A "GROUP" \
-p parallel \
-t 1:00:00 \
--mem=10g \
-N 2 \
-n 20 \
--job-name=${sample}_junc_log.out \
--wrap="regtools junctions extract \
-a 8 \
-m 50 \
-s 0 \
-M 100000 \
${BAM_dir}/${sample}_Aligned.sortedByCoord.out.bam \
-o ${JUNC_dir}/${sample}.bam.junc"
done
##################################################################################################
#Make sure to filter unwanted/unknown chromosomes from junc files and then gzip them