def test_combine(self): trypsin = enzyme.Protease("trypsin") gluc = enzyme.Protease("glutamyl endopeptidase") seq = "PEPTIDER" self.assertEqual(trypsin.missed_cleavages(seq), 0) self.assertEqual(gluc.missed_cleavages(seq), 2) merged = enzyme.Protease.combine(trypsin, gluc) self.assertEqual(merged.missed_cleavages(seq), 2)
def _prepare_protease(self, protease): if isinstance(protease, enzyme.Protease): pass elif isinstance(protease, basestring): protease = enzyme.Protease(protease) elif isinstance(protease, (list, tuple)): protease = enzyme.Protease.combine(*protease) return protease
def test_digest(self): trypsin = enzyme.Protease("trypsin") for peptide, start, stop, missed in trypsin.cleave(heparanase, 2): assert missed < 3 if peptide == "KFKNSTYSR": break else: raise AssertionError("Did not produce overlapped digest")
def __init__(self, *args, **kwargs): super(DigestLayout, self).__init__(*args, **kwargs) protease = enzyme.Protease(kwargs.get("enzyme", "trypsin")) self.cleavage_sites = set(i for c in protease.cleave(str(self.protein)) for i in c[1:3] if i != 0)