有没有办法用Python从下面的BLAT结果中得到不匹配的位置号?在
00000001 taaaagatgaagtttctatcatccaaaaaatgggctacagaaacc 00000045
<<<<<<<< ||||||||||||||||||||||||||| |||||||||||||||| <<<<<<<<
41629392 taaaagatgaagtttctatcatccaaagtatgggctacagaaacc 41629348
我们可以看到,上面的输出有两个不匹配。我们可以用Python得到不匹配/变异的位置号吗。这也是它在源代码中的显示方式。所以我有点搞不清该怎么办。 非常感谢。在
可以使用字符串的
.find
方法找到不匹配项。不匹配用空格('')表示,所以我们在blat输出的中间行中查找它。我个人不了解blat,所以我不确定输出是否总是以三元组行的形式出现,但是假设是这样,下面的函数将返回一个位置不匹配的列表,每个位置在顶部序列中表示为不匹配位置的元组,而在底部序列中则是相同的。在产生
^{pr2}$告诉我们位置28和29(根据顶部序列索引)或位置41629419和41629420(根据底部序列索引)不匹配。在
相关问题 更多 >
编程相关推荐