from_rdmol
¶
from_rdmol(mol: Any) -> GraphData
Converts an RDKit molecule (rdkit.Chem.Mol) to a
GraphData, with the features of PyG's
from_rdmol.
Each atom has 9 categorical features, the indices in the lists of
x_map of its atomic number, chirality, total degree, formal
charge, total number of hydrogens, number of radical electrons,
hybridization, aromaticity and ring membership. Each bond gives two
directed edges, with 3 categorical features: the indices in the lists of
e_map of its type, stereo configuration and conjugation. The edges
are sorted by source then destination node, as in PyG.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mol
|
Any
|
The RDKit molecule. |
required |
Returns:
| Type | Description |
|---|---|
GraphData
|
The graph, with |
GraphData
|
|
GraphData
|
uses |
Source code in mlx_graphs/utils/smiles.py
from mlx_graphs.utils import from_rdmol · mlx_graphs/utils/smiles.py