Rosalind第97题:Global Alignment with Scoring Matrix and Affine Gap Penalty

Problem

An affine gap penalty is written as , where  is the length of the gap,  is a positive constant called the gap opening penalty, and  is a positive constant called the gap extension penalty.

We can view the gap opening penalty as charging for the first gap symbol, and the gap extension penalty as charging for each subsequent symbol added to the gap.

For example, if  and , then a gap of length 1 would be penalized by 11 (for an average cost of 11 per gap symbol), whereas a gap of length 100 would have a score of 110 (for an average cost of 1.10 per gap symbol).

Consider the strings "PRTEINS" and "PRTWPSEIN". If we use the BLOSUM62 scoring matrix and an affine gap penalty with  and , then we obtain the following optimal alignment.

 PRT---EINS
 |||   |||
 PRTWPSEIN-

Matched symbols contribute a total of 32 to the calculation of the alignment's score, and the gaps cost 13 and 11 respectively, yielding a total score of 8.

Given: Two protein strings  and  in FASTA format (each of length at most 100 aa).

Return: The maximum alignment score between  and , followed by two augmented strings  and  representing an optimal alignment of  and . Use:

一个仿射缺口罚写为,在哪里  是间隙的长度, 是一个正常数,称为空位开放罚分,并且是一个正的常数,称为缺口延伸罚分

我们可以将空位开放罚分视为对第一个空位符号的收费,并将空位延伸罚分视为对添加至该空位的每个后续符号的收费。

例如,如果  和 ,那么长度为1的缺口将受到11的惩罚(每个缺口符号的平均成本为11),而长度为100的缺口将得到110的分数(每个缺口符号的平均成本为1.10)。

考虑字符串“ PRTEINS”和“ PRTWPSEIN”。如果我们使用BLOSUM62 评分矩阵 和仿射间隙罚分 和 ,则我们获得以下最佳对齐方式。

 PRT --- EINS 
 |||    ||| 
 PRTWPSEIN -

匹配的符号对路线分数的计算总共贡献32,缺口的成本分别为13和11,总分数为8。

给出:两个蛋白质串  和 以FASTA格式(每个长度最大为100aa)。

返回值:之间的最大对齐分数 和 ,然后是两个增强字符串  和  代表  和 。采用:

Sample Dataset

>Rosalind_49
PRTEINS
>Rosalind_47
PRTWPSEIN

Sample Output

8
PRT---EINS
PRTWPSEIN-
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值