-
Notifications
You must be signed in to change notification settings - Fork 0
/
bwa_alignment.pbs
73 lines (52 loc) · 4.27 KB
/
bwa_alignment.pbs
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
#!/bin/bash
#PBS -q bigmem
#PBS -l select=1:ncpus=64:mem=500GB
#PBS -l walltime=168:00:00
#PBS -W group_list=x-ccast-prj-hulke
#PBS -N bwaAlignmentFun
cd /mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha
source /mmfs1/home/senta.kryzer/miniconda3/bin/activate pairtools_env
module load samtools
#/mmfs1/projects/brent.hulke/Software/bwa-mem2/bwa-mem2 mem -5SP -T0 -t64 ./HifiOmniCAssembly/alignment/Sunflower_1_Hetero_Red_withOmniC.asm.hic.p_ctg.fasta LAID_OmniC_NA_NA_TTCCAAGG_Sunflower_Hetero_Red-Sunflower_OmniC_I1381_L1_R1.fastq.gz LAID_OmniC_NA_NA_TTCCAAGG_Sunflower_Hetero_Red-Sunflower_OmniC_I1381_L1_R2.fastq.gz| \
#pairtools parse --min-mapq 40 --walks-policy 5unique --max-inter-align-gap 30 --nproc-in 32 --nproc-out 32 --chroms-path ./HifiOmniCAssembly/alignment/Sunflower_1_Hetero_Red_withOmniC_genome | \
#pairtools sort --tmpdir=/mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/temp_folder --nproc 64|pairtools dedup --nproc-in 32 \
#--nproc-out 32 --mark-dups --output-stats ./HifiOmniCAssembly/alignment/stats.txt \
#--output /mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/dedup.pairsam /mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/sorted.pairsam \
#|pairtools split --nproc-in 32 --nproc-out 32 --output-pairs /mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/mapped.pairs \
#--output-sam -|samtools view -bS -@64 -o /mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/temp_folder/temp.bam| \
#samtools sort -@64 -T /mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/temp_folder/temp.bam -o mapped.PT.bam unsorted.bam;samtools index mapped.PT.bam
########################Alignment step by step###############################
#1. Actual alignment
#/mmfs1/projects/brent.hulke/Software/bwa-mem2/bwa-mem2 mem -5SP \
# -T0 \
# -t64 \
# ./HifiOmniCAssembly/alignment/Sunflower_1_Hetero_Red_withOmniC.asm.hic.p_ctg.fasta \
# LAID_OmniC_NA_NA_TTCCAAGG_Sunflower_Hetero_Red-Sunflower_OmniC_I1381_L1_R1.fastq.gz LAID_OmniC_NA_NA_TTCCAAGG_Sunflower_Hetero_Red-Sunflower_OmniC_I1381_L1_R2.fastq.gz \
# -o ./HifiOmniCAssembly/alignment/aligned_omnic.sam
#took about 3 hours
#2. Finding ligation junctions - Parsing step
#pairtools parse --min-mapq 40 \
# --walks-policy 5unique \
# --max-inter-align-gap 30 \
# --nproc-in 32 --nproc-out 32 \
# --chroms-path ./HifiOmniCAssembly/alignment/Sunflower_1_Hetero_Red_withOmniC_genome ./HifiOmniCAssembly/alignment/aligned_omnic.sam > ./HifiOmniCAssembly/alignment/parsed_omnic.pairsam
# took about 6 hours
#3. Sort the parsed pairs
#pairtools sort --tmpdir=/mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/temp_folder \
# --nproc 64 \
# ./HifiOmniCAssembly/alignment/parsed_omnic.pairsam > ./HifiOmniCAssembly/alignment/sorted_omnic.pairsam
#took about 3 1/2 hours
#4.Mark duplicates
#pairtools dedup --nproc-in 32 --nproc-out 32 --mark-dups --output-stats ./HifiOmniCAssembly/alignment/stats.txt \
# --output ./HifiOmniCAssembly/alignment/dedup.pairsam ./HifiOmniCAssembly/alignment/sorted_omnic.pairsam
#took a few minutes
#5. Split pairsam into two files
#pairtools split --nproc-in 32 --nproc-out 32 --output-pairs ./HifiOmniCAssembly/alignment/mapped_omnic.pairs \
# --output-sam ./HifiOmniCAssembly/alignment/unsorted_omnic.bam ./HifiOmniCAssembly/alignment/dedup.pairsam
#took a few minutes
#6. Generating the final bam file
#samtools sort -@64 -T/mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiOmniCAssembly/alignment/temp_folder/temp.bam \
# -o ./HifiOmniCAssembly/alignment/mapped_omnic.PT.bam ./HifiOmniCAssembly/alignment/unsorted_omnic.bam
#took a few minutes
#7. Indexing of bam file
samtools index ./HifiOmniCAssembly/alignment/mapped_omnic.PT.bam