def test_link_site_no_overlap(self): ambig = ''' RES 1b:x-dglc-HEX-x:x 2s:n-acetyl 3b:b-dglc-HEX-1:5 4s:n-acetyl 5b:b-dman-HEX-1:5 6b:a-dman-HEX-1:5 7b:b-dglc-HEX-1:5 8s:n-acetyl 9b:b-dgal-HEX-1:5 10b:a-dman-HEX-1:5 11b:a-dman-HEX-1:5 LIN 1:1d(2+1)2n 2:1o(4+1)3d 3:3d(2+1)4n 4:3o(4+1)5d 5:5o(3|6+1)6d 6:6o(2+1)7d 7:7d(2+1)8n 8:7o(4+1)9d 9:5o(3|6+1)10d 10:10o(3|6+1)11d ''' exact = ''' RES 1b:x-dglc-HEX-1:5 2s:n-acetyl 3b:b-dglc-HEX-1:5 4s:n-acetyl 5b:b-dman-HEX-1:5 6b:a-dman-HEX-1:5 7b:b-dglc-HEX-1:5 8s:n-acetyl 9b:a-dman-HEX-1:5 10b:a-dman-HEX-1:5 11b:a-dman-HEX-1:5 LIN 1:1d(2+1)2n 2:1o(4+1)3d 3:3d(2+1)4n 4:3o(4+1)5d 5:5o(3+1)6d 6:6o(2+1)7d 7:7d(2+1)8n 8:5o(6+1)9d 9:9o(3+1)10d 10:9o(6+1)11d ''' ambig = glycoct.loads(ambig) exact = glycoct.loads(exact) ambig.set_reducing_end(True) exact.set_reducing_end(True) self.assertEqual(ambig.total_composition(), exact.total_composition()) self.assertEqual(ambig, ambig.clone()) self.assertEqual(derivatize(ambig.clone(), 'methyl').total_composition(), derivatize(exact.clone(), 'methyl').total_composition())
def test_from_glycoct(self): for structure in glycoct.read(self._file_path): self.assertEqual( structure, glycoct.loads(structure.to_glycoct()))