def testFromString(self): label = Label.from_string("Q#2:CA") self.assertEqual(label.residue, ProteinAlphabet.GLN) self.assertEqual(label.rank, 2) self.assertEqual(label.atom_name, 'CA')
def testLabel(self): shift = ChemShiftInfo(2, 'ALA', 'CA', 'C', 12) self.assertEqual(shift.label, Label.from_shift(shift))
def testParse(self): self.assertEqual(Label.parse("Q#2:CA"), ("Q", 2, 'CA'))
def testMatch(self): atom = get_chain()[1]['CA'] shift = ChemShiftInfo(2, ProteinAlphabet.GLN, 'CA', ChemElements.C, 12) self.assertTrue(Label.match(shift, atom))
def testGetAtom(self): chain = get_chain() self.assertEqual(Label.get_atom(chain, "Q#2:CA"), chain[1]['CA'])
def testFromAtom(self): atom = get_chain()[1]['CA'] self.assertEqual(Label.from_atom(atom), "Q#2:CA")
def testFromShift(self): shift = ChemShiftInfo(2, ProteinAlphabet.ALA, 'CA', ChemElements.C, 12) self.assertEqual(Label.from_shift(shift), "A#2:CA")
def testBuild(self): self.assertEqual(Label.build(ProteinAlphabet.ALA, 2, 'CA'), "A#2:CA")