fix: annotated-frame notebook corrections (Codex review)#438
Merged
Conversation
- .df noise label is -1, not -2: the *_first_only accessors return -1 when the dominant contributor has no signal attributes (incl. random noise). The -2 = noise convention only exists in the dense-window label planes. Fix the Section 3 label table + the (previously always-zero-or-wrong) noise count. - Guard the fragment section against a missing fragment_ions table (COUNT would otherwise raise on precursor-only datasets), not just an empty one. - Sparsity: count unique populated (scan, m/z) cells instead of peaks (multiple peaks can share a cell), so occupancy isn't overstated. - m/z-RT map: clarify the per-cell label is the single highest-intensity peak, not the peptide with the largest summed intensity after the mobility collapse. - Shuffle before the train/val split (tiles are RT-ordered). Re-executed end-to-end: 20 cells, 0 errors, 5 plots. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Corrections to the onboarding notebook (#436/#437) from an independent Codex review, grounded against the
imspy_simulationsource + the Rustto_dense_windows_with_labelsimplementation.Material fix
.dfnoise label is-1, not-2.peptide_ids_first_only(and the charge/isotope variants) return-1when the dominant contributor has no signal attributes — including random noise (imspy_connector/src/py_annotation.rs:168).-2is only assigned in the dense-window label planes forSourceType::RandomNoise(mscore/src/simulation/annotation.rs:936). Section 3's label table + peak-composition count are corrected; verified empirically on a noisy dataset (.dfshows no-2).Robustness / precision
fragment_ionstable (theCOUNT(*)would raise on precursor-only runs, not just return 0).(scan, m/z)cells rather than peaks (peaks can share a cell), so occupancy isn't overstated.Codex confirmed the rest is correct:
grid_peaksaccumulation + dominant-label logic, the dense-window reconstruction formula vs the Rust start-index/n_cols, the N/Y + overlap-duplicates explanation, the fragment API usage, and the PyTorch shapes.Re-executed end-to-end against a real DIA
synthetic_data.db: 20 cells, 0 errors, 5 plots.🤖 Generated with Claude Code