MoleculeEdgeGraph
chemical_order: list
ring_type_dispatch: dict
functional_groups: dict
atom_identifier: atom_identifier
light_atoms: set
get_rings(self):
LLM Docstring
Use RDKit cycle perception on a carbon-labeled graph with dummy coordinates.
:returns:listA list of ordered ring vertex sequences.
categorize_ring(self, ring):
LLM Docstring
Match a ring and its external valencies against known ring templates, accounting for cyclic rotations.
ring:objectOrdered atom indices forming the ring to categorize.
:returns:objectA pair
(ring_category, ordered_ring_indices).
match_functional_group(self, root, neighbor_lists, cache=None):
LLM Docstring
Test a root atom’s nested neighbor pattern against known functional-group templates with optional caching.
root:objectStarting node;
Noneis passed through, whiledev.defaultselects the first child where implemented.neighbor_lists:objectObserved nested neighbor patterns.
cache:objectOptional dictionary caching functional-group matches.
:returns:objectA
(group_name, matched_pattern)pair, orNone.
find_functional_groups(self):
LLM Docstring
Locate known functional groups and collect the atom indices consumed by each matched pattern.
:returns:objectA list of
[group_name, atom_indices]records.
get_label_types(self, label_constructor=None, use_ring_identifiers=True, use_functional_group_identifiers=True):
LLM Docstring
Generate structured chemical identifiers for every node using optional ring and functional-group annotations.
label_constructor:objectThe value supplied for
label_constructor, interpreted according to the algorithm described above.use_ring_identifiers:objectWhether ring categories are included in atom identifiers.
use_functional_group_identifiers:objectWhether functional-group names are included in atom identifiers.
:returns:objectOne
atom_identifierper graph node.
get_heavy_atom_framework_graph(self, heavy_atoms=None, light_atoms=None, included_atoms=None):
LLM Docstring
Extract a subgraph containing selected heavy atoms and return its original node indices.
heavy_atoms:objectOptional set of element symbols to retain as heavy atoms.
light_atoms:objectElement symbols to remove when constructing the heavy-atom framework.
included_atoms:objectAdditional original indices that should remain in the framework.
:returns:objectA pair
(subgraph, original_indices).
find_longest_chain(self, rings=None, root=None, use_highest_valencies=True, heavy_atoms=True, light_atoms=None):
LLM Docstring
Find a longest chain in the heavy-atom framework and map it back to original indices.
rings:objectPreviously detected cycles, used to avoid recomputation.
root:objectStarting node;
Noneis passed through, whiledev.defaultselects the first child where implemented.use_highest_valencies:objectWhether candidate ring cuts are restricted to the most central or highest-valence ring nodes.
heavy_atoms:objectOptional set of element symbols to retain as heavy atoms.
light_atoms:objectElement symbols to remove when constructing the heavy-atom framework.
:returns:objectOriginal atom indices along the selected heavy-atom chain.
segment_by_chains(self, root=None, rings=None, use_highest_valencies=True, heavy_atoms=True, light_atoms=None, backbone=None, validate=True):
LLM Docstring
Segment the heavy-atom framework into chains and restore original atom indices.
root:objectStarting node;
Noneis passed through, whiledev.defaultselects the first child where implemented.rings:objectPreviously detected cycles, used to avoid recomputation.
use_highest_valencies:objectWhether candidate ring cuts are restricted to the most central or highest-valence ring nodes.
heavy_atoms:objectOptional set of element symbols to retain as heavy atoms.
light_atoms:objectElement symbols to remove when constructing the heavy-atom framework.
backbone:objectOptional preselected backbone chain.
validate:objectWhether to run duplicate and attachment consistency checks.
:returns:objectNested node-index groups describing the resulting graph decomposition.