Skip to content

Commit

Permalink
add current_molecule property to Complex
Browse files Browse the repository at this point in the history
  • Loading branch information
mjrosengrant committed Nov 1, 2023
1 parent 7cf70b2 commit 731fc4d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions nanome/api/structure/complex.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,17 @@ def current_conformer(self):
if current_mol:
return current_mol.current_conformer

@property
def current_molecule(self):
"""
| Represents the current molecule the complex is in.
:type: :class:`~nanome.structure.Molecule`
"""
return next((
mol for i, mol in enumerate(self.molecules)
if i == self.current_frame), None)

# returns true if the complex is selected on nanome.
def get_selected(self):
return self._selected
Expand Down

0 comments on commit 731fc4d

Please sign in to comment.