Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
2a4bf2f
conformational options
skfegan Jul 27, 2026
d7f4fca
Merge branch 'main' into conformational-options
skfegan Jul 31, 2026
f0f0d97
Adapting flexible dihedrals for conf_type=ua_backbone.
skfegan Aug 27, 2026
75380c8
Merge branch 'main' into conformational-options
skfegan Aug 27, 2026
675b50d
adding res_pairs option
skfegan Oct 23, 2026
efc5b3b
merging latest main
skfegan Oct 23, 2026
80bfa2f
fixing existing tests, setting conf_type default to ua_backbone
skfegan Oct 23, 2026
02840b8
starting unit tests for levels/dihedrals/dihedral_finder.py
skfegan Nov 10, 2026
52c61f9
Merge remote-tracking branch 'origin/main' into conformational-options
harryswift01 Nov 12, 2026
839536d
tests(unit): fix residue-level dihedral bond detection test
harryswift01 Nov 12, 2026
5ea1ef7
unit tests for levels/dihedrals/dihedral_finder.py
skfegan Nov 12, 2026
c4217ed
updating docs
skfegan Nov 13, 2026
e02ffc5
Merge branch 'main' into conformational-options
skfegan Nov 13, 2026
cee8de1
Merge remote-tracking branch 'origin/main' into conformational-options
harryswift01 Nov 17, 2026
de67c11
Merge remote-tracking branch 'origin/main' into conformational-options
harryswift01 Nov 20, 2026
a3b9e58
Merge remote-tracking branch 'origin/main' into conformational-options
harryswift01 Nov 30, 2026
bb10675
tests(unit): mock the full residues path like in MDAnlaysis
harryswift01 Nov 30, 2026
858373a
fix(dihedrals): use global resindex in `res_points` point search
harryswift01 Nov 30, 2026
8628293
fix(dihedrals): restrict residue-level `ua_backbone` dihedrals to the…
harryswift01 Nov 30, 2026
0904133
fix(config): validate `conf_type` and repair its docs entryi
harryswift01 Nov 30, 2026
f33963f
chore(test): restrict coverage measurement to `CodeEntropy` package
harryswift01 Nov 30, 2026
d56c955
Tidying up
skfegan Nov 30, 2026
ce6d23d
fixing set up of DihedralDefinitions
skfegan Nov 30, 2026
c9e197a
fixing unit tests
skfegan Dec 1, 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
20 changes: 20 additions & 0 deletions CodeEntropy/config/argparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ class ArgSpec:
help="Type of neighbour search to use. Default is RAD; grid search is also "
"available.",
),
"conf_type": ArgSpec(
type=str,
default="ua_backbone",
help="Method for identifying the residue-level dihedrals for "
"conformational entropy. One of ua_backbone, res_pairs, res_bonds or "
"res_points. Default is ua_backbone.",
),
"symmetry_number": ArgSpec(
type=str,
nargs="+",
Expand Down Expand Up @@ -559,6 +566,7 @@ def validate_inputs(self, u: Any, args: argparse.Namespace) -> None:
self._check_input_force_partitioning(args)
self._check_parallel_frame_options(args)
self._check_input_axes(args)
self._check_input_conf_type(args)
self._check_input_symmetry_number(args)

@staticmethod
Expand All @@ -572,6 +580,18 @@ def _check_input_axes(args: argparse.Namespace) -> None:
)
args.axes = axes

@staticmethod
def _check_input_conf_type(args: argparse.Namespace) -> None:
"""Check that the conformational dihedral method is supported."""
valid = ("ua_backbone", "res_pairs", "res_bonds", "res_points")
conf_type = str(args.conf_type).strip().lower()
if conf_type not in valid:
raise ValueError(
f"Invalid 'conf_type': {args.conf_type!r}. "
f"Must be one of {', '.join(valid)}."
)
args.conf_type = conf_type

@staticmethod
def _check_input_start(u: Any, args: argparse.Namespace) -> None:
"""Check that the start index does not exceed the trajectory length."""
Expand Down
7 changes: 7 additions & 0 deletions CodeEntropy/levels/dihedrals/conformational_state_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

from rich.progress import TaskID

from CodeEntropy.levels.dihedrals.dihedral_finder import DihedralDefinitions
from CodeEntropy.levels.dihedrals.peak_detection import ConformationPeakDetector
from CodeEntropy.levels.dihedrals.state_assignment import (
ConformationStateAssigner,
Expand All @@ -36,13 +37,15 @@ def __init__(self, universe_operations: Any) -> None:
- select_atoms(atomgroup, selection_string)
"""
self._universe_operations = universe_operations
self._dihedral_definitions = DihedralDefinitions()

def build_conformational_states(
self,
data_container: Any,
levels: dict[Any, list[str]],
groups: dict[int, list[Any]],
bin_width: float,
conf_type: str,
frame_selection: FrameSelection,
progress: _RichProgressSink | None = None,
chunk_size: int | None = None,
Expand Down Expand Up @@ -78,6 +81,7 @@ def build_conformational_states(
levels=levels,
groups=groups,
bin_width=bin_width,
conf_type=conf_type,
frame_selection=frame_selection,
chunk_size=chunk_size,
progress=progress,
Expand All @@ -89,6 +93,7 @@ def _build_conformational_states_serial_chunked(
levels: dict[Any, list[str]],
groups: dict[int, list[Any]],
bin_width: float,
conf_type: str,
frame_selection: FrameSelection,
chunk_size: int,
progress: _RichProgressSink | None = None,
Expand Down Expand Up @@ -156,6 +161,7 @@ def _build_conformational_states_serial_chunked(
group_id=group_id,
molecules=molecules,
level_list=level_list,
conf_type=conf_type,
)
tasks = self._build_conformation_chunk_tasks(
topologies=topologies,
Expand Down Expand Up @@ -188,6 +194,7 @@ def _build_conformational_states_serial_chunked(
level_list=level_list,
peaks_ua=peak_data.peaks_ua,
peaks_res=peak_data.peaks_res,
conf_type=conf_type,
)
for observable in observables
]
Expand Down
Loading
Loading