Skip to content

Commit

Permalink
access trajectory for atom group through universe
Browse files Browse the repository at this point in the history
  • Loading branch information
pegerto-ck committed Dec 29, 2023
1 parent 45fbc01 commit adc3378
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion mdakit_sasa/analysis/sasaanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def __init__(
select: str = "all",
**kwargs
):
super().__init__(universe_or_atomgroup.trajectory, **kwargs)
super().__init__(universe_or_atomgroup.universe.trajectory, **kwargs)
self.universe = universe_or_atomgroup.universe
self.atomgroup = universe_or_atomgroup.select_atoms(select)

Expand Down
7 changes: 7 additions & 0 deletions mdakit_sasa/tests/analysis/test_sasaanalysis.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,13 @@ def test_atom_selection(self, universe, select, n_atoms):
def test_total_sasa_calculation(self, analysis):
analysis.run(stop=3)
assert analysis.n_frames == 3

def test_with_atom_group(self, universe):
analysis = SASAAnalysis(
universe.atoms)
analysis.run()
assert analysis.n_frames == 3


def test_total_sasa_calculation_results(self, analysis):
analysis.run(stop=3)
Expand Down

0 comments on commit adc3378

Please sign in to comment.