Welcome to “Sequencing read mapping to reference genome” Tutorial

cd ~

mkdir bowtie2example

cd bowtie2example

ls -al

Quality Control with FASTQC

First, install FASTQC https://www.howtoinstall.me/ubuntu/18-04/fastqc/

sudo apt-get update -y
sudo apt-get install -y fastqc

Install bowtie2

Download bowtie2 from https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.4.4/

wget https://sourceforge.net/projects/bowtie-bio/files/bowtie2/2.4.4/bowtie2-2.4.4-source.zip

unzip bowtie2-2.4.4-source.zip

export PATH=~/bowtie2example/bowtie2-2.4.4/:$PATH

Build index file of the reference genome

bowtie2-build bowtie2-2.4.4/example/reference/lambda_virus.fa LVindex

Align reads to genome

bowtie2 -x LVindex bowtie2-2.4.4/example/reads/reads_1.fq,bowtie2-2.4.4/example/reads/reads_2.fq -S virus.align.sam

Install conda - Only once if not already.


https://repo.anaconda.com/miniconda/Miniconda3-py37_4.10.3-Linux-x86_64.sh

bash ~/Downloads/Miniconda3-py37_4.10.3-Linux-x86_64.sh

Create an environment and activate

conda create --name dablab

Check out this conda cheat sheet for more options: https://docs.conda.io/projects/conda/en/4.6.0/_downloads/52a95608c49671267e40c689e0bc00ca/conda-cheatsheet.pdf

Now activate the environment you just created.

conda activate dablab

To exit from that, use conda deactivate

Installing tools with conda

Download samtools from http://sourceforge.net/projects/samtools/files/samtools/

conda install -c bioconda samtools=1.9 --force-reinstall

samtools

Convert SAM to bam

samtools view -b virus.align.sam > virus.align.bam

Sort a bam file

samtools sort virus.align.bam -o virus.align.sorted.bam

Index a sorted bam file

samtools index virus.align.sorted.bam

Visualization with IGV.

First, install IGV software using conda

conda install -c bioconda igv

Then, you need to start it by executing this command on the terminal

igv

This will open a new GUI (graphical user interphase) for IGV software. We will load a reference genome to start. Next, load the sorted and indexed bam alignment file.

Here is a screenshot from IGV.