nglview.adaptor

Module contents

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

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.ASETrajectory(ase_traj)[source]

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

asetraj adaptor.

>>> import nglview as nv
>>> from ase.io.trajectory import Trajectory
>>> traj = Trajectory(nv.datafiles.ASE_Traj)
>>> t = nv.ASETrajectory(traj)
>>> w = nv.NGLWidget(t)
>>> w.add_spacefill()
>>> w
get_coordinates(index)[source]
get_structure_string()[source]
property n_frames
class nglview.adaptor.BiopythonStructure(entity, ext='pdb', params={})[source]

Bases: nglview.base_adaptor.Structure

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

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
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]
property n_frames
class nglview.adaptor.IODataStructure(obj)[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]

Require ase package

class nglview.adaptor.IOTBXStructure(obj, ext='pdb', params={})[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
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]
property 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]
property n_frames
class nglview.adaptor.OpenbabelStructure(obj)[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.ParmEdTrajectory(trajectory)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.adaptor.ParmEdStructure

ParmEd adaptor.

get_coordinates(index)[source]
property n_frames
class nglview.adaptor.PdbIdStructure(pdbid)[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.ProdyStructure(obj)[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.ProdyTrajectory(obj)[source]

Bases: nglview.base_adaptor.Trajectory, nglview.adaptor.ProdyStructure

get_coordinates(index)[source]
property n_frames
class nglview.adaptor.Psi4Structure(obj)[source]

Bases: nglview.adaptor.QCElementalStructure

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(index=0)[source]
property n_frames
class nglview.adaptor.QCElementalStructure(obj)[source]

Bases: nglview.base_adaptor.Structure

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

Bases: nglview.base_adaptor.Structure

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

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.SchrodingerStructure(structure, ext='pdb')[source]

Bases: nglview.base_adaptor.Structure

Only read first structure

get_structure_string()[source]
class nglview.adaptor.SchrodingerTrajectory(structure, traj)[source]

Bases: nglview.adaptor.SchrodingerStructure, nglview.base_adaptor.Trajectory

Require parmed package.

classmethod from_files(cms_fname, traj_fname)[source]
get_coordinates(index)[source]
get_structure_string()[source]

Require parmed package.

property n_frames
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]
property n_frames
class nglview.adaptor.TextStructure(text, ext='pdb', params={})[source]

Bases: nglview.base_adaptor.Structure

get_structure_string()[source]
class nglview.adaptor.register_backend(package_name)[source]

Bases: object