From 731fc4dae7f07754bc7b359b1263937ac7d60c80 Mon Sep 17 00:00:00 2001 From: Mike Rosengrant Date: Wed, 1 Nov 2023 10:32:01 -0400 Subject: [PATCH] add current_molecule property to Complex --- nanome/api/structure/complex.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/nanome/api/structure/complex.py b/nanome/api/structure/complex.py index 7a2cb05c..d2224984 100644 --- a/nanome/api/structure/complex.py +++ b/nanome/api/structure/complex.py @@ -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