Skip to content Skip to sidebar Skip to footer

Search For Motifs With Degenerate Positions

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, m

Solution 1:

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.

Post a Comment for "Search For Motifs With Degenerate Positions"