Esempio n. 1
0
 def test_from_glycoct(self):
     s = self.glycan.root.to_glycoct()
     b = StringIO(s)
     g = iter(glycoct.read(b)).next()
     self.assertEqual(g.root.to_glycoct(), s)
Esempio n. 2
0
 def test_parse_file(self):
     for g in glycoct.read(self._file_path):
         self.assertTrue(isinstance(g, glycan.Glycan))
Esempio n. 3
0
def prepare_file(file_path):
    key = int(os.path.splitext(os.path.basename(file_path))[0])
    glycan = glycoct.read(file_path).next()
    composition = Counter(map(identity.identify, glycan))
    return key, {"key": key, "composition": composition, "glycan": glycan}
 def test_from_glycoct(self):
     s = self.glycan.root.serialize('glycoct')
     b = StringIO(s)
     g = next(iter(glycoct.read(b)))
     self.assertEqual(g.root.serialize('glycoct'), s)