Gibbs Model

GibbsModel fragmentation module.

class GibbsModel(subgroups: DataFrame, subgroups_info: DataFrame | None = None)[source]

Bases: FragmentationModel

GibbsModel it’s a fragmentation model dedicated to Gibbs excess models.

unifac, psrk, dortmund are instances of this class.

Parameters:
  • subgroups (pd.DataFrame) – Model’s subgroups. Index: ‘group’ (subgroups names). Mandatory columns: ‘smarts’ (SMARTS representations of the group to detect its precense in the molecule).

  • subgroups_info (Union[pd.DataFrame, None], optional) – Information of the model’s subgroups (R, Q, subgroup_number, main_group), by default None

subgroups

Model’s subgroups. Index: ‘group’ (subgroups names). Columns: ‘smarts’ (SMARTS representations of the group to detect its precense in the molecule).

Type:

pd.DataFrame

detection_mols

Dictionary cotaining all the rdkit Mol object from the detection_smarts subgroups column

Type:

dict

subgroups_info

Information of the model’s subgroups. Columns: R, Q, subgroup_number, main_group. Index: ‘group’ (subgroups names)

Type:

pd.DataFrame

get_groups(identifier: str | ~rdkit.Chem.rdchem.Mol, identifier_type: str = 'name', solver: ~ugropy.core.ilp_solvers.ilp_solver.ILPSolver = <class 'ugropy.core.ilp_solvers.default_solver.DefaultSolver'>, search_multiple_solutions: bool = False) GibbsFragmentationResult | List[GibbsFragmentationResult][source]

Get the groups of a molecule.

Parameters:
  • identifier (Union[str, Chem.rdchem.Mol]) – Identifier of the molecule. You can use either the name of the molecule, the SMILEs of the molecule or a rdkit Mol object.

  • identifier_type (str, optional) – Identifier type of the molecule. Use “name” if you are providing the molecules’ name, “smiles” if you are providing the SMILES or “mol” if you are providing a rdkir mol object, by default “name”

  • solver (ILPSolver, optional) – ILP solver class, by default DefaultSolver

  • search_multiple_solutions (bool, optional) – Weather search for multiple solutions or not, by default False If False the return will be a FragmentationResult object, if True the return will be a list of FragmentationResult objects.

Returns:

Fragmentation result. If search_multiple_solutions is False the return will be a FragmentationResult object, if True the return will be a list of FragmentationResult objects.

Return type:

Union[GibbsFragmentationResult, List[GibbsFragmentationResult]]