nglview.adaptor

Module contents

class nglview.adaptor.FileStructure(path)[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.TextStructure(text, ext='pdb', params={})[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.RdkitStructure(rdkit_mol, ext='pdb')[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.PdbIdStructure(pdbid)[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.ASEStructure(ase_atoms, ext='pdb', params={})[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.SimpletrajTrajectory(path, structure_path)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.base_adaptor.Structure

simpletraj adaptor.

>>> import nglview as nv
>>> t = nv.SimpletrajTrajectory(nv.datafiles.XTC, nv.datafiles.GRO)
>>> w = nv.NGLWidget(t)
>>> w
get_coordinates(index)[source]
get_structure_string()[source]
n_frames
class nglview.adaptor.MDTrajTrajectory(trajectory)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.base_adaptor.Structure

mdtraj adaptor.

>>> import nglview as nv
>>> import mdtraj as md
>>> traj = md.load(nv.datafiles.XTC, nv.datafiles.GRO)
>>> t = MDTrajTrajectory(traj)
>>> w = nv.NGLWidget(t)
>>> w
get_coordinates(index)[source]
get_structure_string()[source]
n_frames
class nglview.adaptor.PyTrajTrajectory(trajectory)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.base_adaptor.Structure

PyTraj adaptor.

>>> import nglview as nv
>>> import pytraj as pt
>>> traj = pt.load(nv.datafiles.TRR, nv.datafiles.PDB)
>>> t = nv.PyTrajTrajectory(traj)
>>> w = nv.NGLWidget(t)
>>> w
get_coordinates(index)[source]
get_structure_string()[source]
n_frames
class nglview.adaptor.ParmEdTrajectory(trajectory)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.base_adaptor.Structure

ParmEd adaptor.

get_coordinates(index)[source]
get_structure_string()[source]
n_frames
class nglview.adaptor.MDAnalysisTrajectory(atomgroup)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.base_adaptor.Structure

MDAnalysis adaptor.

Can take either a Universe or AtomGroup.

>>> import nglview as nv
>>> import MDAnalysis as mda
>>> u = mda.Universe(nv.datafiles.GRO, nv.datafiles.XTC)
>>> prot = u.select_atoms('protein')
>>> t = nv.MDAnalysisTrajectory(prot)
>>> w = nv.NGLWidget(t)
>>> w
get_coordinates(index)[source]
get_structure_string()[source]
n_frames
class nglview.adaptor.HTMDTrajectory(mol)[source]

Bases: nglview.base_adaptor.Trajectory

HTMD adaptor.

Takes a Molecule object.

>>> import nglview as nv
>>> from htmd import Molecule
>>> mol = Molecule(nv.datafiles.PDB)
>>> t = nv.HTMDTrajectory(mol)
>>> w = nv.NGLWidget(t)
>>> w
get_coordinates(index)[source]
get_structure_string()[source]
n_frames
class nglview.adaptor.register_backend(package_name)[source]

Bases: object