-
Notifications
You must be signed in to change notification settings - Fork 0
/
alignment_scaff_hap1.pbs
71 lines (53 loc) · 5.93 KB
/
alignment_scaff_hap1.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
#!/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 index ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/yahs.out_scaffolds_hap1_final.fa
#/mmfs1/projects/brent.hulke/Software/bwa-mem2/bwa-mem2 mem -5SP \
# -T0 \
# -t64 \
# ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/yahs.out_scaffolds_hap1_final.fa \
# 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 ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/triobinning_aligned_scaffolding_hap1.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 ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/scaffolding_hap1.genome ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/triobinning_aligned_scaffolding_hap1.sam > ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/parsed_trio_scaffolding_hap1.pairsam
# took about 6 hours
#3. Sort the parsed pairs
#pairtools sort --tmpdir=/mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/temp_folder_scaffolding_hap1 \
# --nproc 64 \
# ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/parsed_trio_scaffolding_hap1.pairsam > ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/sorted_trio_scaffolding_hap1.pairsam
#took about 3 1/2 hours
#4.Mark duplicates
#pairtools dedup --nproc-in 32 --nproc-out 32 --mark-dups --output-stats ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/stats_trio_scaffolding_hap1.txt \
# --output ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/dedup_trio_scaffolding_hap1.pairsam ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/sorted_trio_scaffolding_hap1.pairsam
#took a few minutes
#5. Split pairsam into two files
#pairtools split --nproc-in 32 --nproc-out 32 --output-pairs ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/mapped_trio_scaffolding_hap1.pairs \
# --output-sam ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/unsorted_trio_scaffolding_hap1.bam ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/dedup_trio_scaffolding_hap1.pairsam
#took a few minutes
#6. Generating the final bam file
#samtools sort -@64 -T/mmfs1/projects/brent.hulke/MutagenesisSmart/HudsonAlpha/HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/temp_folder_scaffolding_hap1/temp_scaffolding_hap1.bam \
# -o ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/mapped_trio_scaffolding_hap1.PT.bam ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/unsorted_trio_scaffolding_hap1.bam
#took a few minutes
#7. Indexing of bam file
samtools index ./HifiParentalIlluminaOmniCAssembly/alignment_triobinning_scaffolding/alignment_scaffolding_hap1/mapped_trio_scaffolding_hap1.PT.bam