Given two genes AGTGATG and GTTAG, how similar are they? One of the methods to measure the similarity of two genes is called alignment. In an alignment, spaces are inserted, if necessary, in appropriate positions of the genes to make them equally long and score the resulting genes according to a scoring matrix. For example, one space is inserted into AGTGATG to result in AGTGAT-G, and three spaces are inserted into GTTAG to result in –GT--TAG. A space is denoted by a minus sign (-). The two genes are now of equal length. These two strings are aligned: AGTGAT-G -GT--TAG In this alignment, there are four matches, namely, G in the second position, T in the third, T in the sixth, and G in the eighth. Each pair of aligned characters is assigned a score according to the following scoring matrix.

前期准备工作(包括相关工具或所使用的原料等)eclipse-luna-32 win732bit and jdk1.7 DELL 显示器 QQ截图工具 详细的操作方法或具体步骤
算法分析

相似度得分计算主要功能:

辅助函数1:

辅助函数2

测试main函数:

运行结果:

增加功能:

输出结果:


注意事项如果一直出现数组越界的问题就要单步调试认真检查程序中的递增递减变量的符号是否正确?谢谢支持经验内容仅供参考,如果您需解决具体问题(尤其法律、医学等领域),建议您详细咨询相关领域专业人士。作者声明:本教程系本人依照真实经历原创,未经许可,谢绝转载。
- 评论列表(网友评论仅供网友表达个人看法,并不表明本站同意其观点或证实其描述)
-
