美文网首页
2020-01-13 序列比对(二):算法

2020-01-13 序列比对(二):算法

作者: 王子威PtaYoth | 来源:发表于2020-01-13 22:31 被阅读0次

直观全局比对和局部比对

安装帮助脚本,通过命令行演示全局比对和局部比对。

# Store the program in the bin folder.
mkdir -p ~/bin

# Install the wrapper for the EMBOSS alignment tools.
curl http://data.biostarhandbook.com/align/global-align.sh > ~/bin/global-align.sh
curl http://data.biostarhandbook.com/align/local-align.sh > ~/bin/local-align.sh

# Make the scripts executable.
chmod +x ~/bin/*-align.sh
#chmod +x表示更改文件或目录的权限
#测试脚本
local-align.sh TCGATCG TNGATCG
local-align.sh THISLINE ISALIGNED
#还可以将两个需要比对的FASTA文件传递给该脚本
local-align.sh sequence1.fa sequence2.fa

#还可以使用自定义的scoring matrix
wget -nc ftp://ftp.ncbi.nlm.nih.gov/blast/matrices/BLOSUM30
local-align.sh THISLINE ISALIGNED -data BLOSUM30 -gapopen 5

BLOSUM30为scoring matrix
-gapopen 5为设置gap open罚分为5分
脚本包括下列参数:
-gapopengapopen罚分
-gapextendgapextend罚分
-data 传递自定义scoring matrix

全局比对(global alignment)

两个序列在整个长度上进行彼此匹配。
第一序列的每个碱基与第二序列的另一个碱基或“缺口”匹配,如:
global-align.sh THISLINE ISALIGNED(“THISLINE ISALIGNED”,一个字母代表一种氨基酸)


更改gap的罚分会改变全局比对的结果:
global-align.sh THISLINE ISALIGNED -gapopen 7

全局比对用于在两个序列的整个长度上寻找相似性。

局部比对

当我们需要找到两个序列之间的最大相似性区域时,使用局部比对。
执行局部比对时,算法会寻找两个序列之间比对得分最高的部分。
local-align.sh THISLINE ISALIGNED

使用其它的scoring matrix进行比对:
# DNA matrices
# This matrix is the "standard" EDNAFULL substitution matrix.
wget ftp://ftp.ncbi.nlm.nih.gov/blast/matrices/NUC.4.4

# Protein matrices
# Get the BLOSUM30, BLOSUM62, and BLOSUM90 matrices.
wget ftp://ftp.ncbi.nlm.nih.gov/blast/matrices/BLOSUM30
wget ftp://ftp.ncbi.nlm.nih.gov/blast/matrices/BLOSUM62
wget ftp://ftp.ncbi.nlm.nih.gov/blast/matrices/BLOSUM90
#【注意】:用比对核酸的scoring matrix比对氨基酸序列也是有比对结果的。。。但显然是错误的

如何选择正确的矩阵

半全局比对

综合了全局比对和局部比对
半全局比对用于将短序列同长序列进行比对,实践中用于将测序仪产生的短序列同参考基因组进行比对。全局和半全局比对常用free-end-gap法,即序列末端比对出的gap和gap extend罚分较低。
多数采取全局比对和局部比对的工具使用free-end-gap法,但使用前最好还是检查一下。(老生常谈)

相关文章

网友评论

      本文标题:2020-01-13 序列比对(二):算法

      本文链接:https://www.haomeiwen.com/subject/qfnnactx.html