from_molecule

Converts a SMILES string or rdkit molecule to a SAS graph.

sasviya.network.utils.conversions.from_molecule(mol, *, immutable=False, add_hydrogens=False, suppress_warnings=False)

Parameters

mol : str or rdkit molecule object

Specifies the input molecule to convert.

immutable : bool, optional

Specifies whether or not the output graph is immutable. The default is False.

add_hydrogens : bool, optional

Specifies whether or not to include the molecule’s hydrogen atoms. The default is False.

suppress_warnings : bool, optional

Specifies whether or not to suppress the warnings that the rdkit package generates. The default is False.

Returns

SAS graph object

Returns the SAS counterpart graph.

Examples

smiles_str = 'CN1C=NC2=C1C(=O)N(C(=O)N2C)C'
G1 = sasnet.from_molecule(smiles_str)
rdkit_mol = Chem.MolFromSmiles(smiles_str)
G2 = sasnet.from_molecule(rdkit_mol).
Last updated: July 28, 2026