gmol.base.wrapper.rdkit#
Functions
|
Find all chemical bonds in the molecule given atom indices. |
|
|
|
|
|
|
|
Read a molecular file into a list of RDKit Mol objects. |
|
|
|
Write a list of RDKit Mol objects to a file. |
- find_all_bonds_with_atom_idx(mol: Mol, atom_indices: list[int]) list[tuple[int, int]]#
Find all chemical bonds in the molecule given atom indices.
- generate_conformer(mol: Mol, max_attempts: int = 5, optimize_iters: int = 500, ignore_failures: bool = True) Mol#
- read_mols(file_path: Path | str, sanitize: bool = True, remove_h: bool = False) list[Mol]#
Read a molecular file into a list of RDKit Mol objects.
Supported formats:
.mol2,.sdf,.pdb.- Parameters:
file_path – Path to the molecular file.
sanitize – If True, sanitize each molecule after reading.
remove_h – If True, remove explicit hydrogens from each molecule.
- Returns:
List of RDKit Mol objects; entries that failed to parse are omitted.
- write_mols(save_path: Path | str, mols: Mol | None | Iterable[Mol | None], sdf_kekulize: bool = False) None#
Write a list of RDKit Mol objects to a file.
Supported extensions are
.sdfand.pdb.- Parameters:
save_path – Path to the output file.
mols – Molecule or list of molecules to write; None entries are skipped.
sdf_kekulize – If True, kekulize molecules when writing to an SDF file.