<filename>openpharmacophore/visualization/view_conformers.py
from rdkit import Chem
import nglview as nv

def view_conformers(molecule):
    """
    Generate a view of the conformers of a molecule.

    Parameters
    -----------
    molecule : rdkit.Chem.Mol
        The molecules whcih conformers will be visualized

    Returns
    ----------
    view : nglview.widget.NGLWidget
    """
    view = nv.NGLWidget()
    for conformer in range(molecule.GetNumConformers()):
        mol_string = Chem.MolToMolBlock(molecule, confId=conformer)
        temp_mol = Chem.MolFromMolBlock(mol_string, removeHs=False)
        component = view.add_component(temp_mol)
        component.clear()
        component.add_ball_and_stick(multipleBond=True)
    return view
<filename>openpharmacophore/visualization/view_conformers.py
from rdkit import Chem
import nglview as nv

def view_conformers(molecule):
    """
    Generate a view of the conformers of a molecule.

    Parameters
    -----------
    molecule : rdkit.Chem.Mol
        The molecules whcih conformers will be visualized

    Returns
    ----------
    view : nglview.widget.NGLWidget
    """
    view = nv.NGLWidget()
    for conformer in range(molecule.GetNumConformers()):
        mol_string = Chem.MolToMolBlock(molecule, confId=conformer)
        temp_mol = Chem.MolFromMolBlock(mol_string, removeHs=False)
        component = view.add_component(temp_mol)
        component.clear()
        component.add_ball_and_stick(multipleBond=True)
    return view
Generate a view of the conformers of a molecule.      Parameters     -----------     molecule : rdkit.Chem.Mol         The molecules whcih conformers will be visualized      Returns     ----------     view : nglview.widget.NGLWidget