diff --git a/prody/atomic/__init__.py b/prody/atomic/__init__.py index 4f8f5efe7..24a231fcb 100644 --- a/prody/atomic/__init__.py +++ b/prody/atomic/__init__.py @@ -186,6 +186,7 @@ atomic.AtomMap = AtomMap atomic.AtomGroup = AtomGroup atomic.Selection = Selection +atomic.HierView = HierView atomgroup.isReserved = isReserved atomgroup.HierView = HierView diff --git a/prody/atomic/atomic.py b/prody/atomic/atomic.py index b4a6700f4..2a6d2d9e6 100644 --- a/prody/atomic/atomic.py +++ b/prody/atomic/atomic.py @@ -256,6 +256,26 @@ def getSequence(self, **kwargs): return seq + def getHierView(self, **kwargs): + """Returns a hierarchical view of the atom selection.""" + + return HierView(self, **kwargs) + + def numSegments(self): + """Returns number of segments.""" + + return self.getHierView().numSegments() + + def numChains(self): + """Returns number of chains.""" + + return self.getHierView().numChains() + + def numResidues(self): + """Returns number of residues.""" + + return self.getHierView().numResidues() + def toTEMPyAtoms(self): """Returns a :class:`TEMPy.protein.prot_rep_biopy.Atom` or list of them as appropriate""" try: @@ -277,12 +297,6 @@ def toTEMPyStructure(self): return BioPy_Structure(self.toTEMPyAtoms()) - def numResidues(self): - """Returns number of residues.""" - - return len(set(self._getResindices())) - - def toBioPythonStructure(self, header=None, **kwargs): """Returns a :class:`Bio.PDB.Structure` object