Skip to content

fix(terms): actin seeds, --term-axis-shift and batched tilt-series reconstructions - #5

Merged
uermel merged 2 commits into
mainfrom
uermel/term-route-fixes
Oct 19, 2026
Merged

uermel merged 2 commits into
mainfrom
uermel/term-route-fixes

Conversation

@uermel

@uermel uermel commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

Term route only, which actin uses. The microtubule cylindrical route is not touched.

Fixes

  • Seeds on the term route. Since the black and ruff pass, halves_agree is True was tested on a pandas Series, which is never true. So the term route marked no seed, no actin filament got polarity_known, the default --seeds-only wrote no registration or dense picks, and term_average fell back to averaging every filament. _seed_mask now tests the column element-wise and handles both object and nullable boolean columns.
  • Batched tilt-series reconstructions. --source tiltseries segments are split into batches across --workers, even within one tilt series. Each batch has its own scratch directory, and cached segments are dropped before balancing.

Feature

  • --term-axis-shift, default 12 A, sets the term route's axis-offset search. A non-default value on the cylindrical route is an error.
  • summary.json records the term configuration.

Tests

  • tests/test_seed_rule.py, tests/test_term_cli.py and tests/test_tiltseries_batches.py: 7 new tests.
  • The full suite: 20 passed.

🤖 Generated with Claude Code

uermel and others added 2 commits October 16, 2026 13:45
Since 682c106 the seed rule compared the halves_agree column with
`is True`. That is an identity test on a pandas Series, so it is always
False and the term route (actin) marked no seed at all; the reference
then averaged every filament instead of the seeds. `_seed_mask` applies
the rule elementwise to the observations and the decoys alike, and a
missing halves_agree is never a seed.

Tilt-series reconstructions were one job per tilt series, so a dataset
with a single tilt series ran on one worker. `_reconstruction_jobs`
splits the pending segments into batches of at least 32 across the
workers, even within one tilt series; each batch keeps its own scratch
directory, and cached segments are left out before balancing.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The term route refines each segment's axis offset over a fixed +-12 A
search using low-band terms only. `--term-axis-shift` makes that range
configurable, passed through as TermConfig.max_shift, and keeps 12 A as
the default. A non-default value on the cylindrical route is a usage
error rather than silently ignored.

summary.json now records the full TermConfig the run used, so a result
can be traced back to its search range and seed rule.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@uermel
uermel merged commit cd543d2 into main Oct 19, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant