Bioinformatics Tutorial
Files Needed
  • Getting Started
    • Setup
    • Run jobs in a Docker
    • Run jobs in a cluster [Advanced]
  • Part I. Programming Skills
    • 1.Linux
      • 1.1.Basic Command
      • 1.2.Practice Guide
      • 1.3.Linux Bash
    • 2.R
      • 2.1.R Basics
      • 2.2.Plot with R
    • 3.Python
  • PART II. BASIC ANALYSES
    • 1.Blast
    • 2.Conservation Analysis
    • 3.Function Analysis
      • 3.1.GO
      • 3.2.KEGG
      • 3.3.GSEA
    • 4.Clinical Analyses
      • 4.1.Survival Analysis
  • Part III. NGS DATA ANALYSES
    • 1.Mapping
      • 1.1 Genome Browser
      • 1.2 bedtools and samtools
    • 2.RNA-seq
      • 2.1.Expression Matrix
      • 2.2.Differential Expression with Cufflinks
      • 2.3.Differential Expression with DEseq2 and edgeR
    • 3.ChIP-seq
    • 4.Motif
      • 4.1.Sequence Motif
      • 4.2.Structure Motif
    • 5.RNA Network
      • 5.1.Co-expression Network
      • 5.2.miRNA Targets
      • 5.3. CLIP-seq (RNA-Protein Interaction)
    • 6.RNA Regulation - I
      • 6.1.Alternative Splicing
      • 6.2.APA (Alternative Polyadenylation)
      • 6.3.Chimeric RNA
      • 6.4.RNA Editing
      • 6.5.SNV/INDEL
    • 7.RNA Regulation - II
      • 7.1.Translation: Ribo-seq
      • 7.2.RNA Structure
    • 8.cfDNA
      • 8.1.Basic cfDNA-seq Analyses
  • Part IV. MACHINE LEARNING
    • 1.Machine Learning Basics
      • 1.1 Data Pre-processing
      • 1.2 Data Visualization & Dimension Reduction
      • 1.3 Feature Extraction and Selection
      • 1.4 Machine Learning Classifiers/Models
      • 1.5 Performance Evaluation
    • 2.Machine Learning with R
    • 3.Machine Learning with Python
  • Part V. Assignments
    • 1.Precision Medicine - exSEEK
      • Help
      • Archive: Version 2018
        • 1.1.Data Introduction
        • 1.2.Requirement
        • 1.3.Helps
    • 2.RNA Regulation - RiboShape
      • 2.0.Programming Tools
      • 2.1.RNA-seq Analysis
      • 2.2.Ribo-seq Analysis
      • 2.3.SHAPE Data Analysis
      • 2.4.Integration
    • 3.RNA Regulation - dsRNA
    • 4.Single Cell Data Analysis
      • Help
  • 5.Model Programming
  • Appendix
    • Appendix I. Keep Learning
    • Appendix II. Databases & Servers
    • Appendix III. How to Backup
    • Appendix IV. Teaching Materials
    • Appendix V. Software and Tools
    • Appendix VI. Genome Annotations
Powered by GitBook
On this page
  • 1) 简介
  • 2) 文件格式
  • 2a) Inputs
  • 2b) Outputs
  • 3) Blast in Terminal
  • 3a) Prepare
  • 3b) Pairwise sequence alignment
  • 3c) Align a sequence to a remote database
  • 3d) Align a sequence to a local database
  • 4) Tips/Utilities for blast in Terminal
  • 4a) View the results
  • 4b) A better view of fasta file
  • 4c) install blast (including blastn, blastp, etc)
  • 5) Blast online
  • 5a) Input sequence
  • 5b) Select database
  • 5c) Select algorithm
  • 5d) Output results
  • 5e) Output table
  • 5f) Alignment details
  • 6) Homework
  • 7) Teaching Videos
  • Have a break

Was this helpful?

Edit on GitHub
  1. PART II. BASIC ANALYSES

1.Blast

Previous3.PythonNext2.Conservation Analysis

Last updated 2 years ago

Was this helpful?

1) 简介

  • 同源搜索是生物信息最基本的分析之一。blast在很多年来都是用来实现这一任务的一个很受欢迎的工具。

  • 在本节中,我们将学习如何利用网页版和本地版的blast进行蛋白和核酸的同源搜索。

2) 文件格式

  • fasta文件是存储生物序列最常见的一种文件格式。下面就展示了一个包含一条蛋白质序列的fasta文件的内容:

>gi|47115317|emb|CAG28618.1| VIM [Homo sapiens]
MSTRSVSSSSYRRMFGGPGTASRPSSSRSYVTTSTRTYSLGSALRPSTSRSLYASSPGGVYATRSSAVRL
  • 一个fasta文件可以包含多条序列。在fasta文件中,以">"开头的行记录了序列id等相关的信息,这一行之后直到下一个以">"开头的行之前,记录着该序列id对应的序列数据。

  • 一条序列可以横跨多行,但是在这种情况下每行包含序列的最大长度通常是固定的。

>AALT01209640.1:567:377
AUCGCUUCUCGGCCUUUUGGCUAAGAUCAUGUGUAGUAUCUGUUCUUAUCAGUUUAAUAUCUGAUACGUC
CUCUAUCAGAGGACAAUAUAUUAAAUGGAUUUUUGGAAUUAGGAGUUGGAAUAGGAGCUUGCUCCGUCCA
CUCCACGCAUCGACCUGGUAUUGCAGUACUUCCAGGAACGGUGCACCCCCU
>AAFR03033875.1:20528:20718
AUCGCUUCUCGGCCUUUUGGCUAAGAUCAAGUGUAGUAUCUGUUCUUAUCAGUUUAAUAUCUGAUACGUC
CUCUAUCCGAGGACAAUAUAUUAAAUGGAUUUUUGAAACAGGGAGUCGGAAUAGGAGCUUGCUCCGUCCA
CUCCACGCAUCGACCUGGUAUUGCAGUACUUCCAGGAACGGUGCACUUCCC

2a) Inputs

Format
Description
Notes

fasta

contains gene name and sequence

gene name start with >

2b) Outputs

Format
Description
Notes

blastp

query aligned to database

-

3) Blast in Terminal

3a) Prepare

Step 1: 进入到docker容器

docker exec -it bioinfo_tsinghua bash

Step 2: 进入到工作目录

以下步骤均在 /home/test/blast/ 下进行

cd /home/test/blast/

Step 3: 准备一个输出目录

mkdir output

3b) Pairwise sequence alignment

Protein sequence alignment

利用 blastp 进行蛋白质比对

blastp  -query protein/VIM.fasta  -subject protein/NMD.fasta   -out output/blastp

VIM.fasta 与 NMD.fasta 分别是金属beta酶家族的两个蛋白的序列。

  • 蛋白的同源搜索通常比基于核酸的序列搜索更灵敏。

  • query和subject都是fasta文件,可以包含多个序列

  • 如果不提供-out参数,blastn会将结果输出到终端屏幕上。

  • blastp可以指定输出的格式,如果不需要输出序列具体通过哪种方式比对到一起,只需要输出对每个hit对应query和subject的区域,以及显著性等信息,可以指定-outfmt 6参数。

  • blastp有大量可选的参数,大家有兴趣可以通过blastn -help自行了解。

DNA sequence alignment

利用 blastn 进行核酸序列比对

blastn -query dna/H1N1-HA.fasta -subject dna/H7N9-HA.fasta -out output/blastn

H1N1-HA.fasta 与 H7N9-HA.fasta 是两种流感病毒的序列。

3c) Align a sequence to a remote database

我们也可以在命令行搜索ncbi的远程数据库。在网络环境不好的时候容易报错,可以跳过。

用蛋白序列在pdb数据库远程进行同源搜索

blastp  -query protein/VIM.fasta  -db pdb -remote -out output/blastp_remote

用核酸序列在nt数据库远程进行同源搜索

blastn  -query dna/H1N1-HA.fasta  -db nt -remote -out output/blastn_remote

3d) Align a sequence to a local database

例如:在yeast基因组序列中搜索Yeast.fasta序列

Step 1: 建立blast的数据库

makeblastdb -dbtype nucl -in dna/YeastGenome.fa -out database/YeastGenome
  • -dbtype: 待建库的类型(核酸:nucl,蛋白:prot)

  • -in: 待建库的序列文件

  • -out: 数据库前缀

Step 2: 比对

blastn -query dna/Yeast.fasta -db database/YeastGenome -out output/Yeast.blastn

4) Tips/Utilities for blast in Terminal

4a) View the results

你可以利用 more, less等命令或者利用vi等文本编辑工具查看结果文件。

4b) A better view of fasta file

less -S dna/H1N1-HA.fasta  # chop long lines rather than wrap them (记得按 q 退出)

4c) install blast (including blastn, blastp, etc)

Note: Docker 中已经装好

安装方式1-自动安装(推荐方式)

Ubuntu 自动安装软件方法: sudo apt-get install ncbi-blast+

这里 blast 由 ncbi-blast+ 提供

安装方式2-手动安装

寻找类似如下文件:

  • 32位计算机(老机器)安装文件:如 ncbi-blast-2.2.28+-ia32-linux.tar.gz

  • 64位机器安装文件: 如 ncbi-blast-2.2.28+-x64-linux.tar.gz

可以通过 uname -a 查看机器类型是64还是32位

5) Blast online

5a) Input sequence

Input the following sequences:

MSTRSVSSSSYRRMFGGPGTASRPSSSRSYVTTSTRTYSLGSALRPSTSRSLYASSPGGVYATRSSAVRL

5b) Select database

Select "Non-redundant Protein Sequences (nr)"

5c) Select algorithm

Select "blastp"

5d) Output results

5e) Output table

5f) Alignment details

6) Homework

对于序列MSTRSVSSSSYRRMFGGPGTASRPSSSRSYVTTSTRTYSLGSALRPSTSRSLYASSPGGVYATRSSAVRL:

1) 请使用网页版的 blastp, 将上面的蛋白序列只与 mouse protein database 进行比对, 设置输出结果最多保留10个, E 值最大为 0.5。将操作过程和结果截图,并解释一下 E value和 P value 的实际意义。

2) 请使用 Bash 脚本编程:将上面的蛋白序列随机打乱生成10个, 然后对这10个序列两两之间进行 blast 比对,输出并解释结果。(请上传bash脚本,注意做好重要code的注释;同时上传一个结果文件用来示例程序输出的结果以及你对这些结果的解释。)

注: blast的网站会提供多个mouse的databases,可以任选1个进行比对;也可以重复几次,每次选一个不同的database看看不同的输出结果,可以在作业中比较和讨论一下输出结果不同的原因。

3)解释blast 中除了动态规划(dynamic programming)还利用了什么方法来提高速度,为什么可以提高速度。

Figure 83. Atlas of Protein Sequence and Structure, Suppl 3, 1978, M.O. Dayhoff, ed. National Biomedical Research Foundation, 1979

7) Teaching Videos

Have a break

Jim Kent

Jim Kent 1960年生于夏威夷,在旧金山长大。

Kent的编程生涯始于23岁,1983年Kent开始在Island Graphic Inc工作。当时Kent为Amiga家用电脑编写了一个能够结合3D渐变效果与2D简单动画的软件。

1985年他干脆自己开了一家软件公司 Dancing Flame, 将之前自己写的动画程序创建成为一个汇集各种动画和绘画功能的程序Cyber Paint,为CAD-3D开发提供便利。这是是第一个允许用户跨时间制作压缩视频的软件。之后他还开发了软件Autodesk Animator用于个人电脑中,可以为各种视频游戏创作艺术作品。 2000年Kent在攻读加州大学圣克鲁兹生物学博士学位,此时人类基因组计划进行到后期,他写出了GigAssembler, 帮助人类基因组项目能够拼装和发布人类基因组序列。

在GigAssembler之后,Kent继续编写BLAT(BLAST-like alignment tool)和参与维护UCSC Genome Browser 来帮助分析重要的基因组数据。目前,Kent仍然在UCSC工作,主要是在网络工具上帮助理解人类基因组。他帮助维护和升级浏览器,并致力于比较基因组学, Parasol,UCSC kilocluster的运营和ENCODE项目。

docker images的下载链接如所示

首先,进入NCBI官网在线,显示如下图所示界面,选择一种序列比对类型,然后根据提示进行序列比对。

4)我们常见的PAM250有如下图所示的两种(一种对称、一种不对称),请阅读一下 "Symmetry of the PAM matrices" @ ,再利用Google/wikipedia等工具查阅更多资料,然后总结和解释一下这两种(对称和不对称)PAM250不一样的原因及其在应用上的不同。

PAM matrices are also used as a scoring matrix when comparing DNA sequences or protein sequences to judge the quality of the alignment. This form of scoring system is utilized by a wide range of alignment software including . — wikipedia

:

:

see Videos in the ****

Download link
BLAST
wikipedia
BLAST
对称的PAM250
不对称的PAM250
Files needed
附表
对称的PAM250
不对称的PAM250
Jim Kent