擅长:python、mysql、java
<p>您可以很简单地使用regex来实现这一点?我不认为会那么复杂!事实上,我刚刚完成了一些代码,为这里的大学里的一个家伙做了一些与此类似的事情!在</p>
<p>如果不寻找引物的精确拷贝,由于突变,那么可以应用模糊匹配元素!我所做的版本只是在开始和结束处查找完全匹配的底漆,然后使用以下代码返回值减去这些底漆:</p>
<pre><code>pattern = "^" + start_primer + "([A-Z]+)" + end_primer + "$" # start primer and end primer are sequences you are looking to match
regex = re.match(pattern, sequence) # sequence is the DNA sequence you are analyzing
print regex.group(1) # prints the sequence between the start and end primers
</code></pre>
<p>下面是python中fuzzy regex的链接<a href="http://hackerboss.com/approximate-regex-matching-in-python/" rel="nofollow noreferrer">http://hackerboss.com/approximate-regex-matching-in-python/</a></p>