Skip to content

Stream predicted libraries and calculate isotope envelopes on demand - #149

Merged
jspaezp merged 3 commits into
mainfrom
feat/stream-prediction-lazy-isotopes
Sep 26, 2026
Merged

jspaezp merged 3 commits into
mainfrom
feat/stream-prediction-lazy-isotopes

Conversation

@jspaezp

@jspaezp jspaezp commented Sep 25, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Push each predicted spectrum into the target columns builder as it arrives; retain only the final arena and fragment intensity sidecar.
  • Calculate precursor isotope envelopes when scoring requests them. Composition mode stores four bytes of C/S counts per row; mass mode uses stored geometry.
  • Keep library-wide isotope method selection and numerical range validation. Log when finalization starts.
  • Track sink callbacks with explicit AwaitingHeader / Building / Finished states. Carry typed LibraryProvenance through finalization and convert to JSON only when recording the search config.
  • Default FASTA prediction to the 12 strongest fragments per precursor after intensity filtering. Materialize effective prediction settings before the initial configuration log and config_used.json write.

Validation

  • task fmt
  • cargo test -p timsseek_cli (110 unit tests and 1 integration test passed)
  • cargo test -p timsseek isotope_plan (7 passed)
  • cargo clippy -p timsseek -p timsseek_cli --all-targets -- -D warnings
  • CLI smoke check: the initial resolved-config log shows digestion settings and max_fragments: 12 before input validation.

No full-scale runtime benchmark yet.

@github-actions

github-actions Bot commented Sep 26, 2026 •

Copy link
Copy Markdown

Apex-finder bench

cargo run -p apex_sim --release --example bench -- 1000 2

Sensitivity + timing across canonical scenarios
=== summary (n=1000, tol=±2 cycles) ===
  scenario                      pass2%  pass1%   medErr    us/run
  clean                          100.0   100.0        0     27.04
  moderate_noise                  92.7    92.7        0     26.65
  high_noise+interference         59.3    59.3        1     26.49
  heavy_interference               7.4     7.4       88     26.45
  mismatched_library              59.8    59.8        1     26.48
  absent_top_fragment             16.0    16.0       65     26.48
  absent_precursor                59.3    59.3        1     26.57

=== broad apex-finding (n=500, tol=±2 cycles) ===
  scenario                      pass2%  pass1%   medErr    us/run
  broad_clean                    100.0   100.0        0    168.87
  broad_moderate_noise            50.6    50.6        1    165.83
  broad_high_noise+interf         27.6    27.6      308    165.93
  broad_hard_3x_density            0.8     0.8      487    165.67
  broad_mismatched_library        41.0    41.0      161    165.76
  broad_measured_density          49.6    49.6       13    193.71

=== narrow recovery (n=1000, tol=±2 cycles) ===
  scenario                      pass2%  pass1%   medErr    us/run
  narrow_clean                   100.0   100.0        0     17.91
  narrow_moderate_noise           81.3    81.3        0     17.56
  narrow_high_noise+interf        65.8    65.8        1     17.64
  narrow_hard_3x_density          10.9    10.9       34     17.42
  narrow_mismatched_library       62.8    62.8        1     17.61
  narrow_measured_density         83.6    83.6        0     19.98

=== narrow score discrimination (AUC, n_seed_pairs=1000) ===
  scenario                         AUC   med+signal    med-noise
  narrow_clean                   1.000     4.329e14      7.199e7
  narrow_moderate_noise          0.870      4.054e9      3.054e8
  narrow_high_noise+interf       0.830      2.761e9      3.602e8
  narrow_hard_3x_density         0.684      3.644e9      1.244e9
  narrow_mismatched_library      0.842      2.172e9      3.575e8
  narrow_measured_density        0.858      4.341e9      2.562e8

commit edd3753

@jspaezp
jspaezp merged commit cf25c70 into main Sep 26, 2026
8 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