Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
90 commits
Select commit Hold shift + click to select a range
90d49a8
WIP -- Skeleton for protein mutation protocol.
ijpulidos Aug 15, 2024
4d52587
Tests for capped AAs (#92)
ijpulidos Oct 21, 2024
f15592a
Convergence tests for protein mutation protocol (#95)
ijpulidos Oct 28, 2024
00c1f15
Test expected failing or unhandled cases (#96)
ijpulidos Nov 7, 2024
fb4b088
ADding TODO/Comments for things to refactor/review.
ijpulidos Nov 7, 2024
a6a1705
Removing unneeded todo
ijpulidos Nov 20, 2024
24ccc77
Fix custom exceptions in tests
ijpulidos Nov 20, 2024
086f246
Refined dependencies
ijpulidos Dec 5, 2024
e997aea
Misc utility functions and tests
ijpulidos Jan 21, 2025
8fd3877
Adding miscellaneous utility functions
ijpulidos Jan 30, 2025
ad4ef62
Using new utility funcs from both feflow and openfe (branch)
ijpulidos Jan 30, 2025
7b8ab83
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jan 30, 2025
08aedfe
Using protein mutation support openfe branch for now
ijpulidos Jan 30, 2025
9ad227a
remove conda-forge openfe dependency for now
ijpulidos Jan 30, 2025
5134755
Adding temporary dependencies
ijpulidos Jan 30, 2025
c35439e
WIP -- fixing tests and TODOs
ijpulidos Feb 20, 2025
1139eb2
Doesn't make sense to detect phase. Better name for unit.
ijpulidos Feb 26, 2025
9b2e508
Add utility function to get residue indices in chain
ijpulidos Mar 25, 2025
5784daa
Using mapped atoms instead of unique, since unique can be empty.
ijpulidos Mar 25, 2025
1669449
Using updated arg name
ijpulidos Mar 25, 2025
e32bb67
Test gly to ala. Useful for removing atoms instead of adding.
ijpulidos Mar 25, 2025
aa3ffc2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Mar 25, 2025
f10415e
Adding threadpoolctl missing dep
ijpulidos Mar 25, 2025
9a8b99c
Using gufe from git. Temporarily.
ijpulidos Mar 25, 2025
a1106b2
Adding needed dependency for gufe
ijpulidos Apr 1, 2025
34b3a4d
Pinning lower lomap version
ijpulidos Apr 11, 2025
e360385
directly getting solvent component
ijpulidos Apr 24, 2025
330a3c3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Apr 24, 2025
cbd49f3
Handle topologies with multiple chains by checking all atoms
ijpulidos Jun 10, 2025
afa6b95
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 10, 2025
994c2ca
Adding way to store minmized topology pdb. Minor fixes comments/docs.
ijpulidos Jun 13, 2025
ee875ad
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 13, 2025
484ee95
Get solvent component if exists. None otherwise.
ijpulidos Jun 18, 2025
55ba765
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Jun 18, 2025
257000f
We expect proline error test to fail
ijpulidos Jun 24, 2025
8f71796
Adding setup unit to returned units! woops!
ijpulidos Jul 31, 2025
f4f23f8
Testing for basic mapping consistency
ijpulidos Sep 3, 2025
a40b7dc
Adding basic mapping consistency check when creating protocol dag
ijpulidos Sep 3, 2025
1bcfdd3
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 3, 2025
08fcbd1
Skip failing test due to external tools failing.
ijpulidos Sep 16, 2025
138aa95
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 16, 2025
7db8710
Remove rc CI test
ijpulidos Sep 16, 2025
410f769
xfail message added
ijpulidos Sep 16, 2025
5f1d6a2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 16, 2025
b911c24
skipping instead of xfailing
ijpulidos Sep 16, 2025
a9f5342
Actually skipping now... sigh
ijpulidos Sep 16, 2025
0bedb93
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 16, 2025
3ed8400
Catching unsupported charge change. Fixing test.
ijpulidos Sep 16, 2025
8e98b7a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 16, 2025
0697d50
Trying using number of logical cores instead.
ijpulidos Sep 17, 2025
0322437
Vendoring openfe modeller utility
ijpulidos Sep 24, 2025
09bec3f
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 24, 2025
e2a5a92
removing pip deps
ijpulidos Sep 24, 2025
a83fb30
No pydantic 1 in CI.
ijpulidos Sep 24, 2025
f337ef8
We expect openfe >=1.3.0 for omm_compute utils
ijpulidos Sep 24, 2025
03b255a
pymbar 4 BAR changes
ijpulidos Sep 24, 2025
d49925b
we now require pymbar 4
ijpulidos Sep 24, 2025
e3c174b
Fixing codecov repo ref
ijpulidos Sep 24, 2025
d10be95
Using vendore openff model/type from gufe
ijpulidos Sep 24, 2025
644486e
Vendoring get_system_mappings from openfe
ijpulidos Sep 24, 2025
551531d
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Sep 24, 2025
6676349
making pre-commit happy. {} instead of dict()
ijpulidos Sep 24, 2025
b95d0b0
Remving restriction on resids!
ijpulidos Sep 24, 2025
f12c407
Fixing missing pymbar change on boostrapping
ijpulidos Sep 24, 2025
f98a0a5
Serializing HTF right after its creation.
ijpulidos Oct 3, 2025
89c1cfe
Revert "Vendoring get_system_mappings from openfe"
ijpulidos Oct 17, 2025
04c0d1c
We require openfe 1.6.1 (or newer).
ijpulidos Oct 17, 2025
2896683
Always store minimized topology by default
ijpulidos Nov 13, 2025
a64135f
Using gufe get typed components API
ijpulidos Nov 13, 2025
419db95
We now depend on gufe and openfe 1.7.x
ijpulidos Nov 13, 2025
e4f0c29
Using the validate method for checking consistency
ijpulidos Nov 13, 2025
70d1f81
using gufe quantities instead of deprecated models -- cherry picked f…
ijpulidos Nov 6, 2025
770e90a
Type annotation for lambda function field
ijpulidos Nov 6, 2025
ae21582
adapting tests for new way of getting typed components
ijpulidos Nov 13, 2025
3ed752c
Supporting only up to one solvent component. Using validate function.
ijpulidos Nov 13, 2025
b9366a9
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 13, 2025
c9344fc
Setup tests for protein-ligand tyk2 transformation
ijpulidos Nov 14, 2025
d8ede01
Fixing logic using resids for chain instead of atom. Fixes problems w…
ijpulidos Nov 15, 2025
3a864f1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 15, 2025
1b85d0a
Use CPU platform in tests
ijpulidos Nov 17, 2025
fbfa750
sorting parameters for unambiguity with pytest-xdist
ijpulidos Nov 17, 2025
1ce2be0
Removing unnecessary utility function
ijpulidos Nov 21, 2025
5d2d062
Warning about partial charges difference between template and small m…
ijpulidos Nov 21, 2025
a55e2f4
Checking instances types instead. Helpful error msg.
ijpulidos Nov 21, 2025
e1cd58b
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 21, 2025
19149b4
Removing protein mutation module. No need.
ijpulidos Nov 21, 2025
9a99399
using the precomputed dictionaries instead of looping again
ijpulidos Nov 26, 2025
eca4129
removing unnecessary method
ijpulidos Nov 26, 2025
5b9c7da
port htf speed up from openfe (#128)
jthorton Oct 17, 2025
8111b18
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Nov 26, 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
10 changes: 4 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,11 @@ defaults:
jobs:
tests:
runs-on: ${{ matrix.os }}-latest
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }} - pydantic ${{matrix.pydantic}}"
name: "💻-${{matrix.os }} 🐍-${{ matrix.python-version }}"
strategy:
fail-fast: false
matrix:
os: ["ubuntu"]
pydantic: ["1", "2"]
python-version:
- "3.10"
- "3.11"
Expand All @@ -53,7 +52,6 @@ jobs:
cache-downloads: true
create-args: >-
python=${{ matrix.python-version }}
pydantic=${{ matrix.pydantic }}
init-shell: bash

- name: "Install"
Expand Down Expand Up @@ -82,12 +80,12 @@ jobs:
# Set the OFE_SLOW_TESTS to True if running a Cron job
OFE_SLOW_TESTS: ${{ fromJSON('{"false":"false","true":"true"}')[github.event_name != 'pull_request'] }}
run: |
pytest -n auto -v --cov=feflow --cov-report=xml --durations=10
pytest -n logical -v --cov=feflow --cov-report=xml --durations=10

- name: codecov
if: ${{ github.repository == 'choderalab/feflow'
if: ${{ github.repository == 'OpenFreeEnergy/feflow'
&& github.event_name == 'pull_request' }}
uses: codecov/codecov-action@v3
uses: codecov/codecov-action@v4
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: coverage.xml
Expand Down
83 changes: 0 additions & 83 deletions .github/workflows/rc-test.yaml

This file was deleted.

10 changes: 5 additions & 5 deletions devtools/conda-envs/test_env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ channels:
- openeye
dependencies:
# Base depends
- gufe >=0.9.5
- gufe ~=1.7.1
- numpy
- openfe >=0.15 # TODO: Remove once we don't depend on openfe
- openfe ~=1.7.0 # TODO: Remove once we don't depend on openfe
- openff-units
- openmm
- openmmforcefields >=0.14.1 # TODO: remove when upstream deps fix this
- pymbar <4
- pydantic >=1.10.17
- openmmtools >=0.23.0
- pymbar ~=4.0
- pydantic >=1.10.17, <3
- python

# Testing (optional deps)
- espaloma_charge # To us Espaloma FF in tests
- openeye-toolkits
Expand Down
49 changes: 49 additions & 0 deletions docs/tutorials/protein-mutations-neq.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "47736a8f-7446-4600-b06d-4c8ffd05f66c",
"metadata": {},
"source": [
"TODO:\n",
"Add a tutorial here on how to use the protein-mutation capabilities in `FEFlow`.\n",
"\n",
"What should it have?\n",
"* How to mutate a protein from a PDB file with `pdbfixer`\n",
"* How to create the mapping between the WT and MUT\n",
" * check mapping is correct (sanity check)\n",
"* Setting up the protocol\n",
"* Executing the protocol"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "fa00a848-79a2-46c3-a141-6e24ce0f7f4f",
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.9"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
Empty file added feflow/mapping/__init__.py
Empty file.
119 changes: 119 additions & 0 deletions feflow/mapping/protein_mutation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
"""
Module with mapping objects that are useful for the protein mutation protocol.
"""

import re
from gufe import ProteinComponent
from gufe.mapping import AtomMapping

# TODO: Find a better place for this pattern string, maybe feflow.utils?
regex_mut_str = r"^[a-zA-Z]{3}-?\d+-?[a-zA-Z]{3}$"


class ProteinMutationMapping(AtomMapping):
"""
Container for an atom mapping for single residue mutations in proteins.

This is a specialized version of :class:`.AtomMapping` for
:class:`.ProteinComponent` which stores the mapping as a dict of
integers.
"""

componentA: ProteinComponent
componentB: ProteinComponent
_mutation_spec: re.Match[regex_mut_str]
_compA_to_compB: dict[int, int]

def __init__(
self,
componentA: ProteinComponent,
componentB: ProteinComponent,
componentA_to_componentB: dict[int, int],
mutation_spec: re.Match[regex_mut_str],
):
"""
Parameters
----------
componentA, componentB : ProteinComponent
the protein molecules on either end of the mapping
componentA_to_componentB : dict[int, int]
correspondence of indices of atoms between wild type and mutation; the
keys are indices in componentA and the values are indices in
componentB.
These are checked that they are within the possible indices of the
respective components.
mutation_spec: str
Mutation specification string. E.g. "LYS42ALA".
"""
super().__init__(componentA, componentB)

# validate compA_to_compB
nA = self.componentA.to_openmm_topology().getNumAtoms()
nB = self.componentB.to_openmm_topology().getNumAtoms()
for i, j in componentA_to_componentB.items():
if not (0 <= i < nA):
raise ValueError(
f"Got invalid index for ComponentA ({i}); " f"must be 0 <= n < {nA}"
)
if not (0 <= j < nB):
raise ValueError(
f"Got invalid index for ComponentB ({i}); " f"must be 0 <= n < {nB}"
)

self._compA_to_compB = componentA_to_componentB
self._mutation_spec = mutation_spec

@property
def componentA_to_componentB(self) -> dict[int, int]:
return dict(self._compA_to_compB)

@property
def componentB_to_componentA(self) -> dict[int, int]:
return {v: k for k, v in self._compA_to_compB.items()}

@property
def componentA_unique(self):
return (
i
for i in range(self.componentA.to_openmm_topology().getNumAtoms())
if i not in self._compA_to_compB
)

@property
def componentB_unique(self):
return (
i
for i in range(self.componentB.to_openmm_topology().getNumAtoms())
if i not in self._compA_to_compB.values()
)

@property
def mutation_spec(self):
"""String with the specification of the mutation."""
return self._mutation_spec

@classmethod
def _defaults(cls):
return {}

def _to_dict(self) -> dict:
"""Seralize to dictionary"""
return {
"componentA": self.componentA,
"componentB": self.componentB,
"componentA_to_componentB": self._compA_to_compB,
"mutation_spec": self.mutation_spec,
}

@classmethod
def _from_dict(cls, dct: dict):
"""Deserialize from dictionary"""
mapping = dct["componentA_to_componentB"]
fixed = {int(k): int(v) for k, v in mapping.items()}

return cls(
componentA=dct["componentA"],
componentB=dct["componentB"],
componentA_to_componentB=fixed,
mutation_spec=dct["mutation_spec"],
)
Loading
Loading