def __init__(self, s=None, ps=None):
     if isinstance(s, basestring):
         self.sequence = Seq(s)
     else:
         self.sequence = s
     self.prosite = ExPASy.get_prosite_raw(ps)
     self.record = Prosite.read(self.prosite)
     self.pat = pa.compile(self.record.pattern)
     self.regexp = re.compile(pa.prosite_to_re(self.record.pattern))
示例#2
0
    "{[A-B]}.",
    "[{AB}].",
    "(A).",
    "[A>]-B.",
    "A-[<B].",
    "A(3,).",
    "A(-1).",
    #"A(5,2).",  # too complicated to check via re
    "A(2, 5).",
    "A(B,C).",
    "A-[<G].",
    "[G>]-A.",
    "1.",
    "[1].",
    "[A1B].",
    #"[AA].",   # too complicated to check via re
    "{1}.",
    "[<].",
    "[>].",
    "[A<B].",
    "[A>B].",
)
for pat in bad_patterns:
    print pat, "-",
    try:
        Pattern.compile(pat)
    except TypeError:
        print "correctly failed"
    else:
        print "INCORRECTLY PASSED"
示例#3
0
    "{[A-B]}.",
    "[{AB}].",
    "(A).",
    "[A>]-B.",
    "A-[<B].",
    "A(3,).",
    "A(-1).",
    #"A(5,2).",  # too complicated to check via re
    "A(2, 5).",
    "A(B,C).",
    "A-[<G].",
    "[G>]-A.",
    "1.",
    "[1].",
    "[A1B].",
    #"[AA].",   # too complicated to check via re
    "{1}.",
    "[<].",
    "[>].",
    "[A<B].",
    "[A>B].",
    )
for pat in bad_patterns:
    print pat, "-",
    try:
        Pattern.compile(pat)
    except TypeError:
        print "correctly failed"
    else:
        print "INCORRECTLY PASSED"