77
Computational Skill for Modern Biology Research Department of Biology Chungbuk National University 10th Lecture 2015.11.17 NGS Analysis III : RNA quantification with kallisto & DE

생물학 연구를 위한 컴퓨터 활용기술 제 10강

Embed Size (px)

Citation preview

Page 1: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Computational Skill for Modern Biology Research

Department of BiologyChungbuk National University

10th Lecture 2015.11.17

NGS Analysis III : RNA quantification with kallisto & DE

Page 2: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Syllabus주 수업내용1주차 Introduction : Why we need to learn this stuff?

2주차 Basic of Unix and running BLAST in your PC

3주차 Unix Command Prompt II and shell scripts

4주차 Basic of programming (Python programming)

5주차 Python Scripting II and sequence manipulations

6주차 Ipython Notebook and Pandas

7주차 Basic of Next Generation Sequencings and Tutorial

8주차9주차 Next Generation Sequencing Analysis I

10주차 Next Generation Sequencing Analysis II

11주차 Next Generation Sequencing Analysis III

12주차 Bioconductor I

13주차 Bioconductor II

14주차 Network analysis

Page 3: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Conventional RNA-Seq Analysis

Sequencing Read Mapping on reference genome

Read Quantifications

Calcuration of FPKM

Differential Expression Analysis

Bottleneck

Too much time consumptions

Page 4: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

30 million paired-end. All processing was done using 20 cores with programs being run with 20 threads

http://arxiv.org/pdf/1505.02710v2.pdf

Even in 20 core CPU server, it tooks serious time..

Page 5: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

More efficient way to quantify transcriptome needed..

https://pachterlab.github.io/kallisto/Kallisto : Near-optimal RNA-Seq quantification http://arxiv.org/abs/1505.02710

Page 6: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Do we really need to align RNA sequencing read to Genome?

Most transcriptome size is far smaller than genome

Sometime we only need to know which reads is corresponding to the specific isoforms

Page 7: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 8: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Download and install

https://pachterlab.github.io/kallisto/download.html

Page 9: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

cd ~wget https://github.com/pachterlab/kallisto/releases/download/v0.42.4/kallisto_mac-v0.42.4.tar.gztar –xvzf kallisto_mac-v0.42.4.tar.gz

Then add kallisto path into PATH (~/.bash_profile)

kallisto 0.42.4

Usage: kallisto <CMD> [arguments] ..

Where <CMD> can be one of:

index Builds a kallisto index quant Runs the quantification algorithm h5dump Converts HDF5-formatted results to plaintext version Prints version information

Page 10: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Transcriptome index

You need to generate index for transcriptome

http://bio.math.berkeley.edu/kallisto/transcriptomes/

It is just fasta file contains all of mRNA in your genome.

Page 11: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Download mouse transcriptome

http://bio.math.berkeley.edu/kallisto/transcriptomes/Mus_musculus.GRCm38.rel79.cdna.all.fa.gz

Generate index

kallisto index -i mouse Mus_musculus.GRCm38.rel79.cdna.all.fa.gz

Index Name Transcriptome fasta file

Now it is time to download some NGS data from SRA archive.

Page 12: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

http://sra.dnanexus.com

Input Keywords

Confine search type as ‘Transcriptome Analysis’

Page 13: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 14: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Select Run and download SRA URLS

Open download_sra_urls txt file

Add wget –c

Page 15: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

bash download_sra_urls.txt --2015-11-16 13:28:38-- ftp://ftp-trace.ncbi.nlm.nih.gov/sra/sra-instant/reads/ByRun/sra/SRR/SRR128/SRR1286228/SRR1286228.sra => ‘SRR1286228.sra’Resolving ftp-trace.ncbi.nlm.nih.gov (ftp-trace.ncbi.nlm.nih.gov)... 130.14.250.7, 2607:f220:41e:250::13Connecting to ftp-trace.ncbi.nlm.nih.gov (ftp-trace.ncbi.nlm.nih.gov)|130.14.250.7|:21... connected.Logging in as anonymous ... Logged in!==> SYST ... done. ==> PWD ... done.==> TYPE I ... done. ==> CWD (1) /sra/sra-instant/reads/ByRun/sra/SRR/SRR128/SRR1286228 ... done.==> SIZE SRR1286228.sra ... 3488089695==> PASV ... done. ==> RETR SRR1286228.sra ... done.Length: 3488089695 (3.2G) (unauthoritative)

SRR1286228.sra 0%[ ] 67.01K 48.8KB/s

Download SRA

Convert them as fastq

fastq-dump –split-files –gzip SRR1286228.sra

Page 16: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Run kallisto

kallisto quant -t 4 -b 100 -o SRR1171560 –i mouse.idx SRR1171560_1.fastq.gz SRR1171560_2.fastq.gz

Fastq file

Generated index

DirectoryOutput saved

(Two file : paired end)

[quant] fragment length distribution will be estimated from the data[index] k-mer length: 31[index] number of targets: 88,198[index] number of k-mers: 82,099,631[index] number of equivalence classes: 297,305[quant] running in paired-end mode[quant] will process pair 1: SRR1171560_1.fastq.gz SRR1171560_2.fastq.gz[quant] finding pseudoalignments for the reads ...

Depends on transcriptome and Read sizes, it would took 5-10 min in ordinary PC

Page 17: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Transcripts abundance

It is tab-seperated text file. Like other bioinformatics data, you can read them in ipython Notebook

Page 18: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Analyze transcript abundance with iPython and Pandas

Gene Name : Ensembl Read count on gene tpm

Tpm : transcripts number per million transcript

Page 19: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Sort based on the tpm

Highly expressed

Lower expressed

Without transcript annotation, it is difficult to understand.

Page 20: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Transcripts annotation data

Transcript id was done as ensembl

Go to http://asia.ensembl.org/index.htmlredirect=no

Select ‘BioMart’

Page 21: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Select Ensembl Gene 82

Select Mouse

Then click ‘Attributes’

Page 22: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Add informations you want to see

Add more informations

Page 23: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Press ‘Go’

File will be saved and download as mart-export.txt

Page 24: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

mart-export.txt

Copy to directory where iPython Notebook is

Page 25: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Read mart_export.txt in annotation DataFrame

Now we have two dataFrame to connect

Page 26: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Merge annotation dataframe into abundance based on transcripts id

Some of data has ‘NaN’ (Not available). Fill them as ‘blank’

Page 27: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Save them as ‘abundance_plus’.

Some counting : transcripts TPM>1 TPM>10

Page 28: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Sort based on TPM

Same as before. But this time we have gene name and Descriptions

Page 29: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Most abundant transcripts in your samples..

Page 30: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 31: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

If we want to find all of transcripts involved in the specific biological process?

Page 32: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

GO : Gene Ontology

Keyword and classification systems of biological entity (Protein, gene, transcripts)

http://geneontology.org

Page 33: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

http://www.ebi.ac.uk/QuickGO/GProtein?ac=O88569

Many keyword is associated withSpecific Proteins

Page 34: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

1. Retrieve data of all transcripts and its corresponding Go term association

2. Search using Go term name

3. Find out list of genes containing specific GO terms

4. Find out genes in transcripts abundance table

Process

Page 35: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

GO Term – Transcript associations

Go back to ensembl – BioMart, Select Gene and Mus musculus

Page 36: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Results and Export data

Page 37: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

‘Press Go’ and download file

Page 38: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Open mart_export.txt

Rename it as GO.txt and copy to working directory where iPython notebook is

Many Terms is asociated in a gene or transcript

Page 39: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Read GO – Transcript Associations

Page 40: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Transcripts associated with Go Term Name ‘Cell Cycle’

Page 41: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Search ‘Go Term Name’ contains Cell Cycle

Find out unique Transcript ID

Save them as cellcycleDF

Page 42: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

cellcycleDF

Transcripts associated GO Term‘cell cycle’

Abundance_plus

Whole Transcriptome

TranscriptomeAssociated with ‘Cell Cycle’

Page 43: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

transcriptJoin based on target_id

Only include Common data

Page 44: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Using two GO term Name

“I want to search transcripts associated with ‘cell cycle’ and ‘actin’”

First, generate DataFrame containing transcripts associated with ‘actin’

Page 45: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

cellcycleDFactinDF

205 Transcripts

Page 46: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 47: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Differential Gene Expression (DGE)

Observing one transcriptome is informative..

But comparing two or more transcriptome would be more informative..

Differential Stages..

WT vs Mutant?Different treatment

Page 48: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

You may think like this..

Quantificaiton of Each Samples

Sample A Sample B

Just find out Gene lists higher at Sample A. Simple!

Not really…

Page 49: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Two factors

Repeat

Although RNA-Seq contain numerous informations, single RNA-Seq is just ONE experimentsYou need to repeat them and show statistical significance between them!

Multiple Comparison

“OK. We repeated treated and control for three time each. Compare TPM of each genesAnd do statistical test for each seperately and if p<0.05, it is significantly different”

“If you compare many thing simulataneously, something should be different”

“If you have many comparison, you should adjust stringency higher”

-> Not good

Page 50: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Inference of Differential Expression is not trivial

In the case of kallisto-generated quantification, uses sleuth

http://pachterlab.github.io/sleuth/

Page 51: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Installation of R and Rstudio

First, install R https://www.r-project.org

Page 52: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Rstudio is environment for R and Applications

https://www.rstudio.com

Page 53: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Launch RStudio

Page 54: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Install Sleuth and Dependency

source("http://bioconductor.org/biocLite.R")

biocLite("rhdf5")

Page 55: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

install.packages("devtools")

devtools::install_github("pachterlab/sleuth")

Page 56: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 57: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Differential Expression Datasets

Three datasets for mouse oocytes (SRR1286228, SRR1286230, SRR1286231)

Page 58: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

http://sra.dnanexus.com/studies/SRP009468/runs

Three datasets for Two cell mouse embryos(SRR385622, SRR385623, SRR385624)

Download and convert as fastq

Page 59: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Convert as fastq and run kallisto

And make text file describing samples

MII Oocyte datasets (3 set)

2 Cell datasets (3 set)

And organize kallisto output directory like this

And save them as study_design.txt

Page 60: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Download this scripts and save into working directory

https://gist.github.com/madscientist01/a49574b7fba18e65818a

Change here as your working directory

Study-design should be same directory

https://gist.github.com/madscientist01/a49574b7fba18e65818a

Page 61: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Open Anal.R file

Page 62: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 63: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 64: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

If analysis is done without problem….

Page 65: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 66: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 67: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 68: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Quality Check

Variations between repeats?

Page 69: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Much Better Correlation between repeats

Page 70: 생물학 연구를 위한 컴퓨터 활용기술 제 10강
Page 71: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Higher ExpressionLower expression

High Fold Change

No Change

Differentially expressed

Not Differentially expressed

Page 72: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Q : False Discovery Rate

Log Fold change

Page 73: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Search by gene name

Page 74: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Gene Level Expressions

One Isofomrs

Page 75: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Second Isoform has much higher Expression levels.

Abnormality?

Page 76: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Download table and you can analye them in Pandas..

Continues…

Page 77: 생물학 연구를 위한 컴퓨터 활용기술 제 10강

Assignments

• Install kallisto, sleuth (R and R Studio)• Download sra datasets SRR385622• Run Kallisto for the sample