Ejemplo n.º 1
0
def display_molecule(molecule, highlight=None, **kwargs):
    topology = {
        'atom_types': molecule.type_array,
        'bonds': molecule.bonds,
        'atom_names': molecule.atom_name,
        'secondary_structure': molecule.secondary_structure
    }

    mv = MolecularViewer(molecule.r_array.astype('float32'), topology)

    kind = kwargs.get('kind', 'wireframe')
    if kind == 'wireframe':
        if molecule.n_bonds != 0:
            mv.points(size=0.15, highlight=highlight)
            mv.lines()
        else:
            mv.points(highlight=highlight)
    elif kind == 'ball_and_sticks':
        mv.ball_and_sticks()
    elif kind == 'cartoon':
        mv.cartoon()
    else:
        raise ValueError("kind {} not found".format(kind))

    return mv
Ejemplo n.º 2
0
def display_molecule(molecule, highlight=None, **kwargs):
    topology = {
        'atom_types': molecule.type_array,
        'bonds': molecule.bonds,
        'atom_names': molecule.atom_name,
        'secondary_structure': molecule.secondary_structure
    }

    mv = MolecularViewer(molecule.r_array.astype('float32'), topology)

    kind = kwargs.get('kind', 'wireframe')
    if kind == 'wireframe':
        if molecule.n_bonds != 0:
            mv.points(size=0.15, highlight=highlight)
            mv.lines()
        else:
            mv.points(highlight=highlight)
    elif kind == 'ball_and_sticks':
        mv.ball_and_sticks()
    elif kind == 'cartoon':
        mv.cartoon()
    else:
        raise ValueError("kind {} not found".format(kind))
    
    return mv
Ejemplo n.º 3
0
def display_molecule(molecule):
    topology = {'atom_types': molecule.type_array, 'bonds': molecule.bonds}

    mv = MolecularViewer(molecule.r_array, topology)

    if molecule.n_bonds != 0:
        mv.points(size=0.15)
        mv.lines()
    else:
        mv.points()

    return mv
Ejemplo n.º 4
0
def display_molecule(molecule):
    topology = {
        'atom_types': molecule.type_array,
        'bonds': molecule.bonds
    }

    mv = MolecularViewer(molecule.r_array, topology)
    
    if molecule.n_bonds != 0:
        mv.points(size=0.15)
        mv.lines()
    else:
        mv.points()

    return mv