Jun's Blog

Output, activities, memo and etc.

Sequencing: Run mapping by bowtie2 and view it on IGV

Previously I ran mapping by Hisat2, and did view it by IGV

This time, I try to do mapping by another tool Bowtie2. It seems that Bowtie2 has simpler functions than Hisat2.

At first, see Bowtie2's official web site [1]. The source code on Github is here [2].

Bowtie2

Install

The installation is easy on Mac. I might introduce it before.

$ brew install bowtie2

That's it.

Prepare index file.

To do mapping by Bowtie2, the index file for the reference genome is necessary. The file can be created by bowtie2-build command from the raw reference genome file [3]. But this time, just download the file from the Bowtie2 official web site [1]. Go to [1]. Then right side Indexes section "H. sapiens, UCSC hg19", click or copy the linked URL.

$ wget ftp://ftp.ccb.jhu.edu/pub/data/bowtie2_indexes/hg19.zip

$ unzip hg19.zip

$ mkdir hg19

$ mv <extracted_files> hg19/

The files are like this.

$ ls /Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19*
/Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19.1.bt2
/Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19.2.bt2
/Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19.3.bt2
/Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19.4.bt2
/Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19.rev.1.bt2
/Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19.rev.2.bt2
$ cd /path/to/read_files_directory

$ mkdir bowtie2_out

Then run mapping. The command line options are same with Hisat2.

$ bowtie2 -x /Users/jun.aruga/doc/dev/bio/reference_genome/hg19/hg19 -1 SRR747784_1_val_1.fq -2 SRR747784_2_val_2.fq -S bowtie2_out/SRR747784.sam
847491 reads; of these:
  847491 (100.00%) were paired; of these:
    48974 (5.78%) aligned concordantly 0 times
    714077 (84.26%) aligned concordantly exactly 1 time
    84440 (9.96%) aligned concordantly >1 times
    ----
    48974 pairs aligned concordantly 0 times; of these:
      451 (0.92%) aligned discordantly 1 time
    ----
    48523 pairs aligned 0 times concordantly or discordantly; of these:
      97046 mates make up the pairs; of these:
        90541 (93.30%) aligned 0 times
        3201 (3.30%) aligned exactly 1 time
        3304 (3.40%) aligned >1 times
94.66% overall alignment rate

IGV

View the outputted sam file

Menu: Tools -> Run igvtools

Command: Sort
Input file: SRR747784.bam
Output file: SRR747784.sorted.sam
Command: Index
Input file: SRR747784.sorted.sam

=> SRR747784.sorted.bam.sai is created.

Menu: File -> Load from file Specify SRR747784.sorted.sam.

f:id:happybirthday:20180620052532p:plain

Mark Zuckerberg's Speech at Harvard

news.harvard.edu

My favorite parts in the speech.

"I’ve sat with children in juvenile detention and opioid addicts, who told me their lives could have turned out differently if they just had something to do, an after school program or somewhere to go."

"We can all make time to give someone a hand. Let’s give everyone the freedom to pursue their purpose — not only because it’s the right thing to do, but because when more people can turn their dreams into something great, we’re all better for it."

"The greatest successes come from having the freedom to fail."