OpenBabel¶
This is the pydoc code for the openbabel module.
This module provides a set of functions (albeit incomplete) to interface with OpenBabel package
- molli.external.openbabel.to_obmol(mol: Molecule, *, coord_displace: float | bool = False, dummy: Element | str = Cl, bond_filter=None) OBMol¶
This function takes a molli Molecule object and generates an openbabel molecule. dummy parameter: replace the dummy atoms with this element on the fly coord_displace: add a random displacement vector of this magnitude
- molli.external.openbabel.from_obmol(obmol: OBMol, cls: type = <class 'molli.chem.molecule.Molecule'>) Molecule¶
This is only a stub method right now. We need fully supported conversion.
- molli.external.openbabel.load_obmol(path: str | Path, ext: str = 'xyz', connect_perceive: bool = False, cls: type = <class 'molli.chem.molecule.Molecule'>) OBMol¶
This function takes any file and creates an openbabel style mol format
- molli.external.openbabel.loads_obmol(inp: str, ext: str = 'xyz', connect_perceive: bool = False, cls: type = <class 'molli.chem.molecule.Molecule'>) OBMol¶
This function takes any file and creates an openbabel style mol format
- molli.external.openbabel.load_all_obmol(path, ext, connect_perceive: bool = False, cls: type = <class 'molli.chem.molecule.Molecule'>)¶
Requires creation of a temporary file, loads all files in an object
- molli.external.openbabel.loads_all_obmol(data, ext, connect_perceive: bool = False, cls: type = <class 'molli.chem.molecule.Molecule'>)¶
Requires creation of a temporary file, loads all files in an object
- molli.external.openbabel.from_str_w_ob(block: str, input_fmt: str = 'mol2') OBMol¶
This function takes any file and creates an openbabel style mol format
- molli.external.openbabel.to_mol2_w_ob(mol: Molecule)¶
This returns basic mol2 data when writing the mol2 file that would be expected using Avogadro/Openbabel
- molli.external.openbabel.dumps_obmol(mol: Molecule | ConformerEnsemble, ftype: str, encode=False)¶
This returns basic file data when writing the file that would be expected using Avogadro/Openbabel
- molli.external.openbabel.calc_charges(mol: Molecule, *, method: str = 'gasteiger', dummy: Element | str = H)¶
This calculates the charges according to the specified method
- molli.external.openbabel.obabel_optimize(mol: Molecule, *, ff: str = 'UFF', max_steps: int = 1000, coord_displace: float | bool = False, tol: float = 0.0001, dummy: Element | str = H, inplace: bool = False) Molecule¶
If inplace = True, this mutates mlmol to optimized coordinates and returns None If inplace = False, mlmol is unchanged and an optimized copy is returned
- molli.external.openbabel.optimize_coordination(mol: Molecule, *, ff: str = 'UFF', max_steps: int = 1000, coord_displace: float | bool = False, tol: float = 0.0001, dummy: Element | str = Cl, inplace: bool = False) Molecule¶
This function does everything that normal optimize does, but it adds additional constraints to simulate