Skip to content

Hcc1359 alignment bowtie2

Use BOWTIE2 to Align hcc1395 FASTQ Files to the Genome

BOWTIE2 is a non-splice aware aligner that is used for analyzing DNA sequences. The hcc1395 FASTQ files will be aligned to the human chromosome 22 reference genome to compare the differences between the alignment outcome obtained from a splice aware aligner (HISAT2) and a non-splice aware aligner such as BOWTIE2.

module load bowtie2

Build BOWTIE2 Reference Index

Similar to HISAT2, BOWTIE2 requires that users index the reference genome prior to alignment. To create the index, use the following:

bowtie2-build references/22.fa references/22

Listing the contents of the references folder will reveal the BOWTIE2 indices with extension .bt2.

Perform the BOWTIE2 Alignment

cat hcc1395_sample_ids.txt | parallel "bowtie2 -x references/22 -1 reads/{}_R1.fq -2 reads/{}_R2.fq -S hcc1395_bowtie2/{}.sam"

Change into hcc1395_bowtie2 and remove hcc1395 from the SAM alignment outputs.

cd hcc1395_bowtie2
for file in *; 
do new=$( (echo $file | cut -f2-3 -d '_') ); 
mv $file $new; 
done

Convert BOWTIE2 SAM Output to BAM

Create sorted BAM.

cat ../hcc1395_sample_ids1.txt | parallel "samtools sort -o {}.bam {}.sam"

Create BAM index.

cat ../hcc1395_sample_ids1.txt | parallel "samtools index -b {}.bam {}.bam.bai"

Convert BOWTIE2 BAM Files to bigWig

cat hcc1395_sample_ids1.txt | parallel "bedtools genomecov -ibam hcc1395_bowtie2/{}.bam -split -bg > hcc1395_bowtie2/{}.bg"
cat hcc1395_sample_ids1.txt | parallel "bedGraphToBigWig hcc1395_bowtie2/{}.bg references/22.fa.fai hcc1395_bowtie2/{}.bw"