Skip to content
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

[WIP] Restraints API #1043

Open
wants to merge 52 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 34 commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
3e848a6
first pass at abstract classes
IAlibay Dec 4, 2024
ef050e5
A start at restraints and forces
IAlibay Dec 5, 2024
420f3e5
Add boresch restraint class
IAlibay Dec 6, 2024
2e2b52e
Fix units
IAlibay Dec 6, 2024
76c5fcf
Fix correction return in kj/mole
IAlibay Dec 9, 2024
e9cd918
Add more restraint API bits
IAlibay Dec 9, 2024
f1bbd8a
move some things around
IAlibay Dec 9, 2024
4f4d58e
Merge branch 'main' into omm-restraints
IAlibay Dec 9, 2024
ac452e9
Some changes
IAlibay Dec 11, 2024
536a76e
Merge branch 'omm-restraints' of github.com:OpenFreeEnergy/openfe int…
IAlibay Dec 11, 2024
a19c86c
refactor restraints
IAlibay Dec 12, 2024
20dd1dc
add some angle checks
IAlibay Dec 12, 2024
9ab74a8
only construct with settings
IAlibay Dec 12, 2024
8f2e1e0
Add more checks to utilities
IAlibay Dec 12, 2024
0a480aa
host finding code
IAlibay Dec 12, 2024
7a7be90
fix up weird black wrapping
IAlibay Dec 12, 2024
733f3b3
remove old search file, add more changes to boresch search
IAlibay Dec 12, 2024
bbef017
Merge branch 'main' into omm-restraints
IAlibay Dec 12, 2024
96decff
Remove duplicate methods
IAlibay Dec 12, 2024
2d97de8
Apply suggestions from code review
IAlibay Dec 12, 2024
116ba64
Add some more docstring
IAlibay Dec 12, 2024
9ae60da
Add minimized vectors on the collinear checks
IAlibay Dec 13, 2024
3cce308
add host atom finding routine
IAlibay Dec 14, 2024
9171d39
autoformatting
IAlibay Dec 14, 2024
033a1e4
various fixes
IAlibay Dec 14, 2024
fe1308e
docstring drive
IAlibay Dec 14, 2024
d71b961
Migrate to restraint_utils
IAlibay Dec 15, 2024
c914b18
base for restraint settings
IAlibay Dec 16, 2024
d24a5a5
Fix up some things
IAlibay Dec 16, 2024
4dd16af
Add restraint settings
IAlibay Dec 16, 2024
ec0d01d
Add missing settings imports
IAlibay Dec 16, 2024
e19db65
Settings and some tests for them
IAlibay Dec 17, 2024
854d1c6
negative idxs test
IAlibay Dec 17, 2024
9b53cd2
addressing some mypy issues
IAlibay Dec 17, 2024
de35e3f
Addressing reviews
IAlibay Dec 20, 2024
7c502c7
Add a todo from last year
IAlibay Jan 7, 2025
786550c
Merge branch 'main' into omm-restraints
IAlibay Jan 20, 2025
fc1f316
Update to address review comments
IAlibay Jan 21, 2025
98ff0c8
Last review comment
IAlibay Jan 21, 2025
e39cdd3
Various fixes
IAlibay Jan 22, 2025
7906641
Now with DSSP!
IAlibay Jan 24, 2025
a52f93b
the big refactor
IAlibay Jan 24, 2025
e166c70
fix imports
IAlibay Jan 24, 2025
f89a8c8
Fix up secondary structure filtering & add chain selection
IAlibay Jan 26, 2025
2af07c8
Add angle wrapping method
IAlibay Jan 26, 2025
aa6f338
Add more tests
IAlibay Jan 26, 2025
3428b39
Add tests for heavy atom getter
IAlibay Jan 26, 2025
d2b0a3d
Add extra test
IAlibay Jan 26, 2025
3ef083d
Add some extra tests
IAlibay Jan 26, 2025
7eb8656
Add collinearity tests & better explanation of code
IAlibay Jan 27, 2025
e911211
Add tests and fix a few things
IAlibay Jan 27, 2025
0c2f102
Angle variance tests
IAlibay Jan 27, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file.
4 changes: 4 additions & 0 deletions openfe/protocols/restraint_utils/geometry/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .base import BaseRestraintGeometry
from .harmonic import DistanceRestraintGeometry
from .flatbottom import FlatBottomDistanceGeometry
from .boresch import BoreschRestraintGeometry
48 changes: 48 additions & 0 deletions openfe/protocols/restraint_utils/geometry/base.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# This code is part of OpenFE and is licensed under the MIT license.
# For details, see https://github.com/OpenFreeEnergy/openfe
"""
Restraint Geometry classes

TODO
----
* Add relevant duecredit entries.
"""
import abc
from pydantic.v1 import BaseModel, validator


class BaseRestraintGeometry(BaseModel, abc.ABC):
"""
A base class for a restraint geometry.
"""
class Config:
arbitrary_types_allowed = True


class HostGuestRestraintGeometry(BaseRestraintGeometry):
"""
An ordered list of guest atoms to restrain.

Note
----
The order matters! It will be used to define the underlying
force.
"""

guest_atoms: list[int]
"""
An ordered list of host atoms to restrain.

Note
----
The order matters! It will be used to define the underlying
force.
"""
host_atoms: list[int]

@validator("guest_atoms", "host_atoms")
def positive_idxs(cls, v):
if v is not None and any([i < 0 for i in v]):
errmsg = "negative indices passed"
raise ValueError(errmsg)
return v
Loading
Loading