Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
9401927
creation of the ESM encoder wrapper, accounting for cached edge attri…
vratins Feb 26, 2026
ed9ce25
addressing changes in encoder classes
vratins Mar 3, 2026
178706a
addressing changes in encoder classes
vratins Mar 3, 2026
adf7c99
using constants for edge dims checking
vratins Mar 3, 2026
d906c26
Merge branch 'main' into dev_esm_encoder
vratins Mar 10, 2026
c6dd359
Merge remote-tracking branch 'origin/main' into dev_esm_encoder
vratins Mar 16, 2026
9bac89d
addressing code review comments
vratins Mar 16, 2026
3a30c88
github actions
vratins Mar 16, 2026
b6c463e
tests and ignoring E501 in linting
vratins Mar 16, 2026
c581258
fixing ruff checks
vratins Mar 16, 2026
25dfdfb
making fixes so that ruff, ty, and build checks pass
vratins Mar 16, 2026
bd83349
Auto-commit ruff fixes [skip ci]
vratins Mar 16, 2026
320fd4d
fixing failing tests in test_embedding_generation due to import issues
vratins Mar 16, 2026
e8486b2
Merge branch 'dev_esm_encoder' of github.com:Wankowicz-Lab/WaterFlow …
vratins Mar 16, 2026
190a3d8
removing any SLAE related tests
vratins Mar 16, 2026
1fc258d
Delete scripts/generate_water_plots.py
vratins Mar 16, 2026
db16593
addresssing review comments
vratins Mar 18, 2026
99a962c
Auto-commit ruff fixes [skip ci]
vratins Mar 18, 2026
03546b2
fixing gvp encoder forward return type signature, making sure uv venv…
vratins Mar 18, 2026
b9b5473
Merge branch 'dev_esm_encoder' of github.com:Wankowicz-Lab/WaterFlow …
vratins Mar 18, 2026
93399e6
fixing typealias bug for ty
vratins Mar 18, 2026
4f7e014
Auto-commit ruff fixes [skip ci]
vratins Mar 18, 2026
a11ad8b
use uvx instead of uv to run ty
vratins Mar 18, 2026
1a88ee5
Merge branch 'dev_esm_encoder' of github.com:Wankowicz-Lab/WaterFlow …
vratins Mar 18, 2026
5efc687
pyproject
vratins Mar 18, 2026
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
14 changes: 10 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
name: Build

on:
# push:
# branches: [main]
# pull_request:
# branches: [main]
push:
branches: [main]
pull_request:
Comment thread
vratins marked this conversation as resolved.
branches: [main]
paths-ignore:
- '**.md'
- 'docs/**'
- 'figures/**'
- '.gitignore'
- 'LICENSE'
workflow_dispatch:

jobs:
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name: Lint

on:
# pull_request:
# branches: [main]
pull_request:
branches: [main]
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -37,7 +37,7 @@ jobs:

steps:
- uses: actions/checkout@v6

- name: Setup UV and python version
uses: astral-sh/setup-uv@v7

Expand Down
14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,21 @@ python_version = "3.12"
warn_return_any = true
warn_unused_configs = true

[tool.ty.rules]
# uvx runs ty in isolation without project dependencies - ignore missing imports
unresolved-import = "ignore"
# PyTorch Geometric has incomplete type stubs - dynamic attributes on Batch/Data
unresolved-attribute = "ignore"
# PyG's MessagePassing.message() override pattern is intentional
invalid-method-override = "ignore"
# PyG's propagate() uses **kwargs which ty doesn't understand
missing-argument = "ignore"
# Dict.get() returns union types that don't narrow well
invalid-argument-type = "ignore"

[tool.ruff.lint]
fixable = ["I001", "F401", "UP"]
ignore = ["E402", "E721", "E731", "E741", "F722", "F821", "UP015", "UP037"]
ignore = ["E402", "E501", "E721", "E731", "E741", "F722", "F821", "UP015", "UP037"]
select = ["E", "F", "I001", "UP"]

[tool.ruff.lint.flake8-import-conventions.extend-aliases]
Expand Down
8 changes: 4 additions & 4 deletions scripts/generate_esm_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,8 +54,8 @@ def compute_esm_embeddings(
Compute ESM3 residue-level embeddings using an in-memory sanitized structure.

This bypasses ESM's default behavior of dropping HETATM non-canonicals.
It extracts the sequence, strips HETATM flags, renames modified residues
(e.g., MSE -> MET) and unknowns (-> UNK), and feeds the buffer directly
It extracts the sequence, strips HETATM flags, renames modified residues
(e.g., MSE -> MET) and unknowns (-> UNK), and feeds the buffer directly
to ESM3 so that all residues receive a structural embedding.

How ESM parses: (https://github.com/evolutionaryscale/esm/blob/main/esm/utils/structure/protein_chain.py)
Expand Down Expand Up @@ -89,7 +89,7 @@ def compute_esm_embeddings(
key_to_resname[key] = res_name_arr[i]

unique_res_keys = list(key_to_resname.keys())

biotite_seq = [
THREE_TO_ONE.get(key_to_resname[key], "X") for key in unique_res_keys
]
Expand Down Expand Up @@ -270,4 +270,4 @@ def main() -> None:


if __name__ == "__main__":
main()
main()
26 changes: 16 additions & 10 deletions scripts/generate_slae_embeddings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
'pdb_id': str,
}
"""

from __future__ import annotations

import argparse
Expand Down Expand Up @@ -193,8 +194,8 @@ def compute_slae_embeddings_batch(
"""
Compute and align SLAE node embeddings from atom37 coords for batched structures.

Embeddings are aligned to the target geometry's atom order. Non-canonical atoms
lacking SLAE representations are zero-padded. All input lists share the
Embeddings are aligned to the target geometry's atom order. Non-canonical atoms
lacking SLAE representations are zero-padded. All input lists share the
same length (batch size).

Args:
Expand All @@ -217,7 +218,11 @@ def compute_slae_embeddings_batch(
slae_atom_info_list = []

for coords, residue_type, residue_id, chains, ins_code in zip(
coords_list, residue_type_list, residue_id_list, chains_list, ins_code_list,
coords_list,
residue_type_list,
residue_id_list,
chains_list,
ins_code_list,
strict=True,
):
# create PyG Data object with atom37 coords (featurizer will convert to flat)
Expand Down Expand Up @@ -430,13 +435,14 @@ def main() -> None:
# compute embeddings for batch
if batch_data:
try:
(coords_list,
residue_type_list,
residue_id_list,
chains_list,
ins_code_list,
geometry_atom_info_list
) = zip(*batch_data)
(
coords_list,
residue_type_list,
residue_id_list,
chains_list,
ins_code_list,
geometry_atom_info_list,
) = zip(*batch_data)

embeddings_list = compute_slae_embeddings_batch(
list(coords_list),
Expand Down
Loading
Loading