Skip to content

Commit

Permalink
Fix RMSD CV instantiation following API change.
Browse files Browse the repository at this point in the history
  • Loading branch information
lohedges committed Jan 7, 2025
1 parent 95da10a commit adc7faf
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 4 deletions.
15 changes: 13 additions & 2 deletions tests/Protocol/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,19 @@ def test_metadynamics():


def test_steering(system):
# Create a collective variable so we can instantiate a steering protocol.
cv = BSS.Metadynamics.CollectiveVariable.RMSD(system, system[0], [0, 1, 2, 3])
# Create a reference containing the first and third molecule from the system.
reference = (system[0] + system[2]).toSystem()

# Create the collective variable. Here we align on molecule index 1
# and all atoms not belonging to to the ALA residue in molecule index 0.
# We compute the RSMD using the atoms belonging to the ALA residue.
cv = BSS.Metadynamics.CollectiveVariable.RMSD(
system,
reference,
"(molidx 0 and not resname ALA) or molidx 1",
"resname ALA",
reference_mapping={0: 0, 1: 2},
)

# Create a schedule.
start = 0 * BSS.Units.Time.nanosecond
Expand Down
15 changes: 13 additions & 2 deletions tests/Sandpit/Exscientia/Protocol/test_protocol.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,19 @@ def test_metadynamics():


def test_steering(system):
# Create a collective variable so we can instantiate a steering protocol.
cv = BSS.Metadynamics.CollectiveVariable.RMSD(system, system[0], [0, 1, 2, 3])
# Create a reference containing the first and third molecule from the system.
reference = (system[0] + system[2]).toSystem()

# Create the collective variable. Here we align on molecule index 1
# and all atoms not belonging to to the ALA residue in molecule index 0.
# We compute the RSMD using the atoms belonging to the ALA residue.
cv = BSS.Metadynamics.CollectiveVariable.RMSD(
system,
reference,
"(molidx 0 and not resname ALA) or molidx 1",
"resname ALA",
reference_mapping={0: 0, 1: 2},
)

# Create a schedule.
start = 0 * BSS.Units.Time.nanosecond
Expand Down

0 comments on commit adc7faf

Please sign in to comment.