Entering edit mode
11.5 years ago
jzabilansky
▴
60
I am currently trying to use Biopython to search for a motif in which an internal amino acid can be any amino acid except for one, is there a way to add an instance of the motif using a character such as 'X' to represent a motif sequence such as "AMXLT" or "AM{N}LT" where the {N} stands for any amino acid except for Asparagine?
Sample Code:
from Bio import motifs
from Bio.Seq import Seq
from Bio.Alphabet import IUPAC
instances = [Seq("AMXLT", IUPAC.protein), Seq("AM{N}LT", IUPAC.protein)]
m = motifs.create(instances)
for record in sequences:
for pos,seq in m.instances.search(record[1]):
print record[0], pos,seq
Not sure if this is overkill but scanprosite would obviously be able to handle this (you could define your own patterns) and there's a biopython module for handling that: http://biopython.org/DIST/docs/api/Bio.ExPASy.ScanProsite-module.html