openpharmacophore.Viewer

class openpharmacophore.Viewer[source]

Bases: object

Class to visualize molecular systems and pharmacophores.

Wrapper around nglview NGLWidget

Methods

add_chem_feats

Add chemical features to the viewer.

add_components

Add multiple components to the viewer, such as Proteins, Ligands and BindingSites.

add_pharmacophore

Add a pharmacophore to the viewer

load_component

Load a component to the viewer, such as a Protein, Ligand or BindingSite so, it can be visualized.

set_protein_style

Set the style of the protein.

show

Shows the visualization.

to_nglview

Get an NGLView widget representing the view.

Attributes

has_chem_feats

Returns true if the visualization contains chemical features.

has_ligand

Returns true if the visualization contains a ligand.

has_pharmacophore

Returns true if the visualization contains a pharmacophore.

has_protein

Returns true if the visualization contains a protein.

n_components

add_chem_feats(chem_feats)[source]

Add chemical features to the viewer.

Parameters:

chem_feats (ChemFeatContainer)

add_components(components)[source]

Add multiple components to the viewer, such as Proteins, Ligands and BindingSites.

Parameters:

components (list[Any])

add_pharmacophore(pharmacophore)[source]

Add a pharmacophore to the viewer

Parameters:

pharmacophore (Pharmacophore)

property has_chem_feats: bool

Returns true if the visualization contains chemical features.

property has_ligand: bool

Returns true if the visualization contains a ligand.

property has_pharmacophore: bool

Returns true if the visualization contains a pharmacophore.

property has_protein: bool

Returns true if the visualization contains a protein.

load_component(component, struct)[source]

Load a component to the viewer, such as a Protein, Ligand or BindingSite so, it can be visualized.

Parameters:
  • component (Any)

  • struct (int, optional) – Structure, frame or conformer index.

set_protein_style(style)[source]

Set the style of the protein.

Parameters:

style (str) – Name of the style

show(struct=0)[source]

Shows the visualization.

Parameters:

struct (int, optional) – Frame, structure or conformer index to show if there are any proteins, ligands or pharmacophores with multiple structures.

Return type:

nv.NGLWidget

to_nglview()[source]

Get an NGLView widget representing the view.

Return type:

nv.NGLWidget