搜索具有退化位置的主题 [英] Search for motifs with degenerate positions

查看:68
本文介绍了搜索具有退化位置的主题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个15-mer核苷酸基序,该基序使用简并的​​核苷酸序列.例如:ATNTTRTCNGGHGCN.

我将搜索一组序列以查找该基序的出现.但是,我的其他序列是精确序列,即它们没有歧义.

我尝试在序列中执行for循环以进行搜索,但是我无法进行非精确搜索.我使用的代码是根据 Biopython食谱上的代码建模的.

for pos,seq in m.instances.search(test_seq):
    print pos, seq

我想搜索非精确15-mer的所有可能的确切实例.是否有可用的功能,还是我不得不为此定义自己的功能? (我可以选择后者,只是想与世界进行三次核实,以确保我在继续工作之前不会重复别人的工作-我已经浏览了我认为是文档相关部分的内容.)

解决方案

使用Biopython的 nt_search .它在DNA序列中寻找一个子序列,将歧义码扩展到该位置可能的核苷酸.示例:

>>> from Bio import SeqUtils
>>> pat = "ATNTTRTCNGGHGCN"
>>> SeqUtils.nt_search("CCCCCCCATCTTGTCAGGCGCTCCCCCC", pat)
['AT[GATC]TT[AG]TC[GATC]GG[ACT]GC[GATC]', 7]

它返回一个列表,其中第一项是搜索模式,然后是匹配项的位置.

I have a 15-mer nucleotide motif that uses degenerate nucleotide sequences. Example: ATNTTRTCNGGHGCN.

I would search a set of sequences for the occurrence of this motif. However, my other sequences are exact sequences, i.e. they have no ambiguity.

I have tried doing a for loop within the sequences to search for this, but I have not been able to do non-exact searches. The code I use is modeled after the code on the Biopython cookbook.

for pos,seq in m.instances.search(test_seq):
    print pos, seq

I would like to search for all possible exact instances of the non-exact 15-mer. Is there a function available, or would I have to resort to defining my own function for that? (I'm okay doing the latter, just wanted to triple-check with the world that I'm not duplicating someone else's efforts before I go ahead - I have already browsed through what I thought was the relevant parts of the docs.)

解决方案

Use Biopython's nt_search. It looks for a subsequence in a DNA sequence, expanding ambiguity codes to the possible nucleotides in that position. Example:

>>> from Bio import SeqUtils
>>> pat = "ATNTTRTCNGGHGCN"
>>> SeqUtils.nt_search("CCCCCCCATCTTGTCAGGCGCTCCCCCC", pat)
['AT[GATC]TT[AG]TC[GATC]GG[ACT]GC[GATC]', 7]

It returns a list where the first item is the search pattern, followed by the positions of the matches.

这篇关于搜索具有退化位置的主题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆