Grouper.libraries.Libraries module
Module for pre-loading libraries of GroupGraphs.
This module defines classes for managing and querying libraries commonly used in group contribution methods. It includes predefined libraries for Joback, UNIFAC, and SaftGammaMie methods.
- class Grouper.libraries.Libraries.BasisSet
Bases:
objectBase class for managing a library of chemical groups.
- add_group(group, doi=None, smarts=None, priority=None)
Add a group to the library.
- fragment_smiles(smiles, onFail='error', **kwargs)
Fragment a SMILES string based on the groups in self.group_traces.
- Parameters:
smiles (str) – The Daylight SMILES string for the molecule to fragment.
onFail (str, default "error") – Method for handling failing fragmentation approaches. - “error”: Raise an exception if fragmentation returns no matching groups. - “itemize”: All missing atoms are treated as atomistic Groups with the name “DEFAULT#N”, where N is the atomic number of the atom. - “condense”: A group is returned that is the single Group with no edges for the entire molecule. Useful if the Library does not have specific definitions for small molecules such as methane (CH4), water (H2O), or formamide (NC=O).
Notes
See Grouper.fragmentation.fragment method for more details on kwargs.
- Returns:
groupGList – The list of all fragmented group graphs generated using Grouper.fragmentation.fragment to perform fragmentation.
- Return type:
List[Grouper.GroupGraph]
- get_groups()
Return an iterator of the groups in the library.
- Yields:
Group – The next group in the library.
- property group_traces
Get the list of group traces.
- property n_groups
Get the number of groups in the library.
- Returns:
The number of groups. int: The number of groups.
- Return type:
- query_groups(query)
Query the library for groups that match the query.
- visualize_library()
Visualize the library using RDKit.
- class Grouper.libraries.Libraries.GroupExtension(group, doi, extended_smarts, priority)
Bases:
tuple- doi
Alias for field number 1
- extended_smarts
Alias for field number 2
- group
Alias for field number 0
- priority
Alias for field number 3
- class Grouper.libraries.Libraries.Joback
Bases:
BasisSetJoback group contribution method for estimating physical properties of organic compounds.
This class predefines a library of chemical groups based on the Joback method.