-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path1_bwa_mem
46 lines (29 loc) · 1.62 KB
/
1_bwa_mem
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
#!/bin/bash
#SBATCH --job-name=bwa_mem_muscat_to_trayshed # Job name
#SBATCH --partition=highmem_p # Partition (queue) name
#SBATCH --ntasks=1 # Run on a single CPU
#SBATCH --mem=400gb # Job memory request
#SBATCH --time=150:00:00 # Time limit hrs:min:sec
#SBATCH --output=log_bwa.%j.out # Standard output log
#SBATCH --error=log_bwa.%j.err # Standard error log
#SBATCH --mail-type=END,FAIL # Mail events (NONE, BEGIN, END, FAIL, ALL)
#SBATCH [email protected] # Where to send mail
cd $SLURM_SUBMIT_DIR
index_tray='/scratch/gb92068/muscadine_snp_calling/muscat_of_alexandra_snp_calling/trayIndex/'
fastq='/scratch/gb92068/muscadine_snp_calling/muscat_of_alexandra_snp_calling/paired_fastq/'
sam='/scratch/gb92068/muscadine_snp_calling/muscat_of_alexandra_snp_calling/output/samDir/'
##Index the genome
ml BWA/0.7.17-GCC-8.3.0
time bwa index $index_tray/VITMroTrayshed_v2_0_ChrRenamed.fasta
##Index with picard tools
ml picard/2.16.0-Java-1.8.0_144
java -Xmx64g -jar $EBROOTPICARD/picard.jar CreateSequenceDictionary R=$index_tray/VITMroTrayshed_v2_0_ChrRenamed.fasta
##Index with SAMtools
ml SAMtools/1.10-iccifort-2019.5.281
time samtools faidx $index_tray/VITMroTrayshed_v2_0_ChrRenamed.fasta
##Run the alignment
ml BWA/0.7.17-GCC-8.3.0
time bwa mem -v 2 -M -t 10 $index_tray/VITMroTrayshed_v2_0_ChrRenamed.fasta $fastq/SRR5891985_1.fastq $fastq/SRR5891985_2.fastq > $sam/SRR5891985_paired.sam
##Convert SAM to BAM
ml SAMtools/1.10-iccifort-2019.5.281
time samtools view -b -S -o $sam/SRR5891985_paired.bam $sam/SRR5891985_paired.sam