Chemical Data Processing Library Python API - Version 1.4.0
Public Member Functions | Properties | List of all members
CDPL.Biomol.HierarchyView Class Reference

Data structure providing a hierarchical view on biological macromolecules. More...

+ Inheritance diagram for CDPL.Biomol.HierarchyView:

Public Member Functions

None __init__ ()
 Constructs an empty HierarchyView instance.
 
None __init__ (Chem.MolecularGraph molgraph)
 Constructs a HierarchyView instance for the molecular graph molgraph. More...
 
int getObjectID ()
 Returns the numeric identifier (ID) of the wrapped C++ class instance. More...
 
None build (Chem.MolecularGraph molgraph)
 Build the hierarchy view for the biological macromolecule represented by molgraph. More...
 
ResidueList getResidues ()
 Returns the flat list of all residues across all models of the biological macromolecule. More...
 
int getNumModels ()
 Returns the number of stored models. More...
 
HierarchyViewModel getModel (int idx)
 Returns the model at index idx. More...
 
bool hasModelWithNumber (int num)
 Tells whether a model with number num exists. More...
 
HierarchyViewModel getModelByNumber (int num)
 Returns the model identified by model number num. More...
 
int __len__ ()
 
HierarchyViewModel __getitem__ (int idx)
 

Properties

 objectID = property(getObjectID)
 
 numModels = property(getNumModels)
 
 residues = property(getResidues)
 

Detailed Description

Data structure providing a hierarchical view on biological macromolecules.

Constructor & Destructor Documentation

◆ __init__()

None CDPL.Biomol.HierarchyView.__init__ ( Chem.MolecularGraph  molgraph)

Constructs a HierarchyView instance for the molecular graph molgraph.

Parameters
molgraphThe molecular graph for which to build the hierarchy view.

Member Function Documentation

◆ getObjectID()

int CDPL.Biomol.HierarchyView.getObjectID ( )

Returns the numeric identifier (ID) of the wrapped C++ class instance.

Different Python HierarchyView instances may reference the same underlying C++ class instance. The commonly used Python expression a is not b thus cannot tell reliably whether the two HierarchyView instances a and b reference different C++ objects. The numeric identifier returned by this method allows to correctly implement such an identity test via the simple expression a.getObjectID() != b.getObjectID().

Returns
The numeric ID of the internally referenced C++ class instance.

◆ build()

None CDPL.Biomol.HierarchyView.build ( Chem.MolecularGraph  molgraph)

Build the hierarchy view for the biological macromolecule represented by molgraph.

Parameters
molgraphThe molecular graph of the biological macromolecule for which to build the hierarchy view.

◆ getResidues()

ResidueList CDPL.Biomol.HierarchyView.getResidues ( )

Returns the flat list of all residues across all models of the biological macromolecule.

Returns
A reference to the residue list.

◆ getNumModels()

int CDPL.Biomol.HierarchyView.getNumModels ( )

Returns the number of stored models.

Returns
The number of models.

◆ getModel()

HierarchyViewModel CDPL.Biomol.HierarchyView.getModel ( int  idx)

Returns the model at index idx.

Parameters
idxThe zero-based model index.
Returns
A reference to the model.
Exceptions
Base.IndexErrorif the number of models is zero or idx is not in the range [0, getNumModels() - 1].

◆ hasModelWithNumber()

bool CDPL.Biomol.HierarchyView.hasModelWithNumber ( int  num)

Tells whether a model with number num exists.

Parameters
numThe model number.
Returns
True if such a model exists, and False otherwise.

◆ getModelByNumber()

HierarchyViewModel CDPL.Biomol.HierarchyView.getModelByNumber ( int  num)

Returns the model identified by model number num.

Parameters
numThe model number.
Returns
A reference to the model.
Exceptions
Base.ItemNotFoundif no model with the requested number exists.

◆ __len__()

int CDPL.Biomol.HierarchyView.__len__ ( )
Returns

◆ __getitem__()

HierarchyViewModel CDPL.Biomol.HierarchyView.__getitem__ ( int  idx)
Parameters
idx
Returns