-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Synchronise with Exscientia remote #183
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
605e2d1
Backport fix from PR #125. [ci skip]
lohedges 72022fe
Merge pull request #126 from OpenBioSim/backport_125
lohedges cbfef2e
Backport fixes from PR #128. [ci skip]
lohedges 511cb6b
Merge pull request #129 from OpenBioSim/backport_128
lohedges d9c37e6
Fix the extract in the gmx.process
xiki-tempula 0c7601f
Merge pull request #17 from Exscientia/feat_2023.3
xiki-tempula 64183f8
Fixed squash and unsquash in the case of explicit dummies (#18)
msuruzhon 1f1802a
Make the saveMetric method more robust (#19)
xiki-tempula f328386
Merge some recent bugfixes (#24)
msuruzhon 24bbaa0
Revert "Merge some recent bugfixes (#24)"
f9bed33
Added some fixes to the solvation (#25)
msuruzhon f1f5276
Fixed PBC fixing when unsquashing for dummy atoms (#20)
xiki-tempula 55bb6fc
Have amber process write binary RST file instead of text rst7 file (#22)
xiki-tempula 591a535
remove skip
xiki-tempula e82f367
fix import
xiki-tempula 05667a2
Merge pull request #26 from Exscientia/feat_merge_0.9.2
xiki-tempula d5e28e8
Fix test in devel (#27)
xiki-tempula 20da673
Fix the tests such that it no longer require the working directory to…
xiki-tempula 3c4a23d
Add a function for marking the alchemical ion (#30)
xiki-tempula 2d4d01a
Merge remote-tracking branch 'exscientia/devel' into sync_exscientia
lohedges b9f1c84
Increase distance tolerance.
lohedges 4cceb23
Guard tests against missing packages.
lohedges File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import warnings | ||
|
||
from .._SireWrappers import Molecule as _Molecule | ||
|
||
|
||
def _mark_alchemical_ion(molecule): | ||
""" | ||
Mark the ion molecule as being alchemical ion. | ||
|
||
This enables one to use | ||
|
||
* :meth:`~BioSimSpace.Sandpit.Exscientia._SireWrappers._system.System.getAlchemicalIon` to get the alchemical ion. | ||
* :meth:`~BioSimSpace.Sandpit.Exscientia._SireWrappers._system.System.getAlchemicalIonIdx` to get the index of alchemical ion. | ||
* :meth:`~BioSimSpace.Sandpit.Exscientia._SireWrappers._molecule.Molecule.isAlchemicalIon` to check if a molecule is an alchemical ion. | ||
|
||
|
||
Parameters | ||
---------- | ||
|
||
molecule : BioSimSpace._SireWrappers.Molecule | ||
The molecule to be marked as alchemical ion. | ||
|
||
Returns | ||
------- | ||
|
||
alchemical_ion : BSS._SireWrappers.Molecule | ||
The molecule marked as being alchemical ion. | ||
""" | ||
# Validate input. | ||
|
||
if not isinstance(molecule, _Molecule): | ||
raise TypeError( | ||
"'molecule' must be of type 'BioSimSpace._SireWrappers.Molecule'" | ||
) | ||
|
||
# Cannot decouple a perturbable molecule. | ||
if molecule.isAlchemicalIon(): | ||
warnings.warn("'molecule' has already been marked as alchemical ion!") | ||
|
||
# Create a copy of this molecule. | ||
mol = _Molecule(molecule) | ||
mol_sire = mol._sire_object | ||
|
||
# Edit the molecule | ||
mol_edit = mol_sire.edit() | ||
|
||
mol_edit.setProperty("AlchemicalIon", True) | ||
|
||
# Update the Sire molecule object of the new molecule. | ||
mol._sire_object = mol_edit.commit() | ||
|
||
return mol |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import pytest | ||
|
||
import BioSimSpace.Sandpit.Exscientia as BSS | ||
from BioSimSpace.Sandpit.Exscientia.Align._alch_ion import _mark_alchemical_ion | ||
from BioSimSpace.Sandpit.Exscientia._SireWrappers import Molecule | ||
|
||
from tests.conftest import root_fp, has_gromacs | ||
|
||
|
||
@pytest.fixture | ||
def system(): | ||
mol = BSS.IO.readMolecules( | ||
[f"{root_fp}/input/ala.top", f"{root_fp}/input/ala.crd"] | ||
)[0] | ||
system = BSS.Solvent.tip3p(mol, ion_conc=0.15, shell=2 * BSS.Units.Length.nanometer) | ||
return system | ||
|
||
|
||
@pytest.fixture | ||
def alchemical_ion_system(system): | ||
ion = system[-1] | ||
ion = _mark_alchemical_ion(ion) | ||
system.updateMolecules(ion) | ||
return system | ||
|
||
|
||
@pytest.mark.skipif(has_gromacs is False, reason="Requires GROMACS to be installed.") | ||
@pytest.mark.parametrize( | ||
"input_system,isalchem", [("system", False), ("alchemical_ion_system", True)] | ||
) | ||
def test_isAlchemicalIon(input_system, isalchem, request): | ||
system = request.getfixturevalue(input_system) | ||
assert system[-1].isAlchemicalIon() is isalchem | ||
|
||
|
||
@pytest.mark.skipif(has_gromacs is False, reason="Requires GROMACS to be installed.") | ||
@pytest.mark.parametrize( | ||
"input_system,isalchem", [("system", None), ("alchemical_ion_system", True)] | ||
) | ||
def test_getAlchemicalIon(input_system, isalchem, request): | ||
system = request.getfixturevalue(input_system) | ||
ion = system.getAlchemicalIon() | ||
if isalchem is None: | ||
assert ion is None | ||
else: | ||
assert isinstance(ion, Molecule) | ||
|
||
|
||
@pytest.mark.skipif(has_gromacs is False, reason="Requires GROMACS to be installed.") | ||
def test_getAlchemicalIonIdx(alchemical_ion_system): | ||
index = alchemical_ion_system.getAlchemicalIonIdx() | ||
assert index == 680 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this the right version for sire? Should it be
2023.3.2
if they want to pin to the last major release, or do they want2023.4.0
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I'll check what's on their current branch.