forked from ISUgenomics/common_analyses
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrunBowtie2.sh
More file actions
19 lines (18 loc) · 782 Bytes
/
runBowtie2.sh
File metadata and controls
19 lines (18 loc) · 782 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
module load bowtie2
module load samtools
module load picard
module load R
GENOMEDIR="/work/GIF/arnstrm/GENOMEDB"
GNAME="$1"
REF="$GENOMEDIR/${GNAME%.*}"
THREADS="16"
READ1="$2"
READ2="$3"
MAXINSERT="300"
SAM=$(basename ${READ1%.*} | cut -f 1-2 -d "_")
bowtie2 --end-to-end --maxins ${MAXINSERT} --threads ${THREADS} -x ${REF} -1 ${READ1} -2 ${READ2} -S ${SAM}_bt.sam
samtools view --threads 16 -b -o ${SAM}_bt.bam ${SAM}_bt.sam
samtools sort -m 5G -o ${SAM}_bt_sorted.bam -T ${SAM}_bt_temp --threads 16 ${SAM}_bt.bam
picard CollectInsertSizeMetrics I=${SAM}_bt_sorted.bam O=${SAM}_insert_size_metrics.txt H=${SAM}_insert_size_histogram.pdf M=0.5
picard CollectAlignmentSummaryMetrics REFERENCE_SEQUENCE=${REF} INPUT=${SAM}_bt_sorted.bam OUTPUT=${SAM}_alignment.stats