Пример #1
0
 def testMakeFromDct(self):
     if IGNORE_TEST:
         return
     config.setConfiguration(TEST_CFG_FILE)
     config_dct = config.getConfiguration()
     dct = config_dct[cn.CFG_MOIETY_STRUCTURE]
     mss1 = MoietyStoichiometry.makeFromDct(dct["ATP"])
     mss2 = [MoietyStoichiometry("A", 1), MoietyStoichiometry("P", 3)]
     self.assertTrue(all([m1.isEqual(m2) for m1, m2 in zip(mss1, mss2)]))
Пример #2
0
 def moiety_stoichiometrys(self):
     done = False
     if self._moiety_stoichiometrys is None:
         config_dct = config.getConfiguration()
         if cn.CFG_MOIETY_STRUCTURE in config_dct:
             dct = config_dct[cn.CFG_MOIETY_STRUCTURE]
             if self.name in dct.keys():
                 self._moiety_stoichiometrys =  \
                     MoietyStoichiometry.makeFromDct(dct[self.name])
                 done = True
     else:
         done = True
     if not done:
         new_name = self._reformat()
         stgs = new_name.split(cn.MOIETY_DOUBLE_SEPARATOR)
         result = [MoietyStoichiometry.make(ms) for ms in stgs]
         result.sort()
         self._moiety_stoichiometrys = result
     return self._moiety_stoichiometrys