def __init__(self,
                 db,
                 html_writer=None,
                 dissociation=None,
                 anchor_all=False):
        PsuedoisomerTableThermodynamics.__init__(
            self, name="Unified Group Contribution")
        self.db = db
        self.html_writer = html_writer or NullHtmlWriter()
        self.dissociation = dissociation
        self.transformed = False
        self.CollapseReactions = False
        self.epsilon = 1e-10
        self.kegg = Kegg.getInstance()

        self.STOICHIOMETRIC_TABLE_NAME = 'ugc_S'
        self.GROUP_TABLE_NAME = 'ugc_G'
        self.GIBBS_ENERGY_TABLE_NAME = 'ugc_b'
        self.ANCHORED_TABLE_NAME = 'ugc_anchored'
        self.COMPOUND_TABLE_NAME = 'ugc_compounds'
        self.OBSERVATION_TABLE_NAME = 'ugc_observations'
        self.GROUPVEC_TABLE_NAME = 'ugc_groupvectors'
        self.UNIQUE_OBSERVATION_TABLE_NAME = 'ugc_unique_observations'
        self.THERMODYNAMICS_TABLE_NAME = 'ugc_pseudoisomers'
        self.ERRORS_TABLE_NAME = 'ugc_errors'
        self.CONSERVATIONS_TABLE_NAME = 'ugc_conservations'

        if anchor_all:
            self.FORMATION_ENERGY_FILENAME = '../data/thermodynamics/formation_energies_anchor_all.csv'
        else:
            self.FORMATION_ENERGY_FILENAME = '../data/thermodynamics/formation_energies.csv'
 def __init__(self, db, html_writer=None, dissociation=None, anchor_all=False):
     PsuedoisomerTableThermodynamics.__init__(self, name="Unified Group Contribution")
     self.db = db
     self.html_writer = html_writer or NullHtmlWriter()
     self.dissociation = dissociation
     self.transformed = False
     self.CollapseReactions = False
     self.epsilon = 1e-10
     self.kegg = Kegg.getInstance()
     
     self.STOICHIOMETRIC_TABLE_NAME = 'ugc_S'
     self.GROUP_TABLE_NAME = 'ugc_G'
     self.GIBBS_ENERGY_TABLE_NAME = 'ugc_b'
     self.ANCHORED_TABLE_NAME = 'ugc_anchored'
     self.COMPOUND_TABLE_NAME = 'ugc_compounds'
     self.OBSERVATION_TABLE_NAME = 'ugc_observations'
     self.GROUPVEC_TABLE_NAME = 'ugc_groupvectors'
     self.UNIQUE_OBSERVATION_TABLE_NAME = 'ugc_unique_observations'
     self.THERMODYNAMICS_TABLE_NAME = 'ugc_pseudoisomers'
     self.ERRORS_TABLE_NAME = 'ugc_errors'
     self.CONSERVATIONS_TABLE_NAME = 'ugc_conservations'
     
     if anchor_all:
         self.FORMATION_ENERGY_FILENAME = '../data/thermodynamics/formation_energies_anchor_all.csv'
     else:
         self.FORMATION_ENERGY_FILENAME = '../data/thermodynamics/formation_energies.csv'
Example #3
0
 def __init__(self, db, dissociation=None,
              html_writer=None, nist=None):
     PsuedoisomerTableThermodynamics.__init__(self)
     self.db = db
     self.html_writer = html_writer or NullHtmlWriter()
     self.nist = nist or Nist()
     self.dissociation = None
     
     self.cid2pmap_dict = {}
     
     self.assume_no_pKa_by_default = False
     self.std_diff_threshold = np.inf
Example #4
0
    def __init__(self, db, html_writer=None, transformed=False):
        """Construct a GroupContribution instance.
        
        Args:
            db: the database handle to read from.
            html_writer: the HtmlWriter to write to.
            kegg: a Kegg instance if you don't want to use the default one.
        """
        PsuedoisomerTableThermodynamics.__init__(self,
                                                 name="Group Contribution")
        self.db = db
        self.html_writer = html_writer or NullHtmlWriter()
        self.dissociation = None
        self.transformed = transformed

        self.epsilon = 1e-10

        self.kegg = Kegg.getInstance()
        self.bounds = deepcopy(self.kegg.cid2bounds)

        self.group_nullspace = None
        self.group_contributions = None
        self.obs_collection = None

        self.cid2error = {}
        self.cid2groupvec = None

        if transformed:
            prefix = 'bgc'
        else:
            prefix = 'pgc'

        self.OBSERVATION_TABLE_NAME = prefix + '_observations'
        self.GROUPVEC_TABLE_NAME = prefix + '_groupvector'
        self.NULLSPACE_TABLE_NAME = prefix + '_nullspace'
        self.CONTRIBUTION_TABLE_NAME = prefix + '_contribution'
        self.REGRESSION_TABLE_NAME = prefix + '_regression'

        self.THERMODYNAMICS_TABLE_NAME = prefix + '_pseudoisomers'
        self.STOICHIOMETRIC_MATRIX_TABLE_NAME = prefix + '_stoichiometry'
        self.ANCHORED_CONTRIBUTIONS_TALBE_NAME = prefix + '_anchored_g'
        self.ANCHORED_CIDS_TABLE_NAME = prefix + '_anchored_cids'
        self.ANCHORED_P_L_TALBE_NAME = prefix + '_anchored_P_L'
Example #5
0
    def __init__(self, db, html_writer=None, transformed=False):
        """Construct a GroupContribution instance.
        
        Args:
            db: the database handle to read from.
            html_writer: the HtmlWriter to write to.
            kegg: a Kegg instance if you don't want to use the default one.
        """
        PsuedoisomerTableThermodynamics.__init__(self, name="Group Contribution")
        self.db = db
        self.html_writer = html_writer or NullHtmlWriter()
        self.dissociation = None
        self.transformed = transformed
        
        self.epsilon = 1e-10

        self.kegg = Kegg.getInstance()
        self.bounds = deepcopy(self.kegg.cid2bounds)

        self.group_nullspace = None
        self.group_contributions = None
        self.obs_collection = None
        
        self.cid2error = {}
        self.cid2groupvec = None

        if transformed:
            prefix = 'bgc'
        else:
            prefix = 'pgc'
        
        self.OBSERVATION_TABLE_NAME = prefix + '_observations'
        self.GROUPVEC_TABLE_NAME = prefix + '_groupvector'
        self.NULLSPACE_TABLE_NAME = prefix + '_nullspace'
        self.CONTRIBUTION_TABLE_NAME = prefix + '_contribution'
        self.REGRESSION_TABLE_NAME = prefix + '_regression'
        
        self.THERMODYNAMICS_TABLE_NAME = prefix + '_pseudoisomers'
        self.STOICHIOMETRIC_MATRIX_TABLE_NAME = prefix + '_stoichiometry'
        self.ANCHORED_CONTRIBUTIONS_TALBE_NAME = prefix + '_anchored_g'
        self.ANCHORED_CIDS_TABLE_NAME = prefix + '_anchored_cids'
        self.ANCHORED_P_L_TALBE_NAME = prefix + '_anchored_P_L'