Пример #1
0
 def __init__(self, gc):
     Thermodynamics.__init__(self)
     self.gc = gc
     self.kegg = gc.kegg()
     self.data = []           # this will hold all the training data in one place, each row represents a measurement
     self.train_rowids = []  # the row indices in self.data to use for training
     self.test_rowids = []   # the row indices in self.data to use for testing
     self.cid2rowids = {} # holds a list of indices to self.train_data where the CID is participating
     self.cid2pmap_dict = {}       # this is the solution vector (what we are trying to solve)
     self.cache_error = {}    # for each rowid - holds the last calculated squared error (the difference between calc and measured)
     self.cache_cid = {}      # for each (rowid,cid) pair - holds the last calculated dG_f (multiplied by the stoichiometric coeff)
Пример #2
0
 def __init__(self, gc):
     Thermodynamics.__init__(self)
     self.gc = gc
     self.kegg = gc.kegg()
     self.data = [
     ]  # this will hold all the training data in one place, each row represents a measurement
     self.train_rowids = [
     ]  # the row indices in self.data to use for training
     self.test_rowids = [
     ]  # the row indices in self.data to use for testing
     self.cid2rowids = {
     }  # holds a list of indices to self.train_data where the CID is participating
     self.cid2pmap_dict = {
     }  # this is the solution vector (what we are trying to solve)
     self.cache_error = {
     }  # for each rowid - holds the last calculated squared error (the difference between calc and measured)
     self.cache_cid = {
     }  # for each (rowid,cid) pair - holds the last calculated dG_f (multiplied by the stoichiometric coeff)
Пример #3
0
    def __init__(self, use_pKa=True):
        if use_pKa:
            Thermodynamics.__init__(self, "Jankowski et al. (+pKa)")
            self.dissociation = DissociationConstants.FromPublicDB()
        else:
            Thermodynamics.__init__(self, "Jankowski et al.")
            self.dissociation = None
        self.db = SqliteDatabase('../res/gibbs.sqlite', 'w')
        self.cid2pmap_dict = {}
        
        # the conditions in which Hatzimanikatis makes his predictions
        self.Hatzi_pH = 7.0
        self.Hatzi_I = 0.0
        self.Hatzi_pMg = 14.0
        self.Hatzi_T = 298.15
        
        self.kegg = Kegg.getInstance()

        # for some reason, Hatzimanikatis doesn't indicate that H+ is zero,
        # so we add it here
        H_pmap = PseudoisomerMap()
        H_pmap.Add(0, 0, 0, 0)
        self.SetPseudoisomerMap(80, H_pmap)

        self.cid2dG0_tag_dict = {80 : 0}
        self.cid2charge_dict = {80 : 0}

        for row in csv.DictReader(open(HATZI_CSV_FNAME, 'r')):
            cid = int(row['ENTRY'][1:])
            self.cid2source_string[cid] = 'Jankowski et al. 2008'
            if row['DELTAG'] == "Not calculated":
                continue
            if cid == 3178:
                # this compound, which is supposed to be "Tetrahydroxypteridine"
                # seems to be mapped to something else by Hatzimanikatis
                continue
            self.cid2dG0_tag_dict[cid] = float(row['DELTAG']) * J_per_cal
            self.cid2charge_dict[cid] = int(row['CHARGE'])
Пример #4
0
    def __init__(self, use_pKa=True):
        if use_pKa:
            Thermodynamics.__init__(self, "Jankowski et al. (+pKa)")
            self.dissociation = DissociationConstants.FromPublicDB()
        else:
            Thermodynamics.__init__(self, "Jankowski et al.")
            self.dissociation = None
        self.db = SqliteDatabase('../res/gibbs.sqlite', 'w')
        self.cid2pmap_dict = {}

        # the conditions in which Hatzimanikatis makes his predictions
        self.Hatzi_pH = 7.0
        self.Hatzi_I = 0.0
        self.Hatzi_pMg = 14.0
        self.Hatzi_T = 298.15

        self.kegg = Kegg.getInstance()

        # for some reason, Hatzimanikatis doesn't indicate that H+ is zero,
        # so we add it here
        H_pmap = PseudoisomerMap()
        H_pmap.Add(0, 0, 0, 0)
        self.SetPseudoisomerMap(80, H_pmap)

        self.cid2dG0_tag_dict = {80: 0}
        self.cid2charge_dict = {80: 0}

        for row in csv.DictReader(open(HATZI_CSV_FNAME, 'r')):
            cid = int(row['ENTRY'][1:])
            self.cid2source_string[cid] = 'Jankowski et al. 2008'
            if row['DELTAG'] == "Not calculated":
                continue
            if cid == 3178:
                # this compound, which is supposed to be "Tetrahydroxypteridine"
                # seems to be mapped to something else by Hatzimanikatis
                continue
            self.cid2dG0_tag_dict[cid] = float(row['DELTAG']) * J_per_cal
            self.cid2charge_dict[cid] = int(row['CHARGE'])