Skip to content

ASM peaks carry their baseline; release 1.5.4 - #80

Merged
ekwan merged 5 commits into
mainfrom
asm-peak-baseline
Oct 17, 2026
Merged

ekwan merged 5 commits into
mainfrom
asm-peak-baseline

Conversation

@ekwan

@ekwan ekwan commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

rb.from_asm peaks now carry the baseline each one was integrated from, and read height and area by their unit. Release 1.5.4.

  • New keys: baseline_start_code/baseline_end_code, start_height/end_height (mAU), and baseline_start_time/baseline_end_time (min).
  • Real data: on four Empower studies, the line from (start, trace − start_height) to (end, trace − end_height) reproduces the reported area within 1% for 99.6% of 11,040 peaks.
  • Export: the codes and times aren't in the schema, so they're written as the peak's custom information. The export still validates.
  • Changed: height and area convert from AU or µV to mAU and mAU·s, and an unknown unit reads as None.
  • Tests: 343 ASM tests and 17 schema tests pass, with a real-file fixture and a µV end-to-end test.

🤖 Generated with Claude Code

https://claude.ai/code/session_01BZZc1jNciuVx7aekxG7YRR

Eugene Kwan and others added 5 commits October 17, 2026 09:01
from_asm read a peak's times, area, height and symmetry, and dropped
everything that says what the area was measured from. An Empower export
records it for every peak: the integration type at each edge, the Start
and End Height (how far the trace sits above the baseline at each edge),
and where the baseline under the peak's cluster begins and ends. With
the heights, the line from (start, trace - start height) to (end, trace
- end height) reproduces the file's area for 99.6% of 11,040 real
Empower peaks; the misses are edges moved by hand.

They now arrive as baseline_start_code and baseline_end_code (B, V, S,
T, ..., lowercase for a hand-moved edge, a group's "Gp" split into "G"
and "p"), start_height and end_height in the signal's unit, and the
baseline edges. The schema does not define "baseline value at start of
peak"; Empower fills it with a time in seconds, while its name reads as
a signal value. The unit decides: a time is read into
baseline_start_time and baseline_end_time in minutes, a signal value
into baseline_start_value and baseline_end_value, and a bare number
into neither. Each is None when absent or not of its type, and each is
written again on export, so the lap keeps them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZZc1jNciuVx7aekxG7YRR
The edge heights were read in whatever unit the document named, and
subtracted from a trace in mAU. They are now converted by the absorbance
unit table, with Empower's microvolt added (1 uV is 1 uAU), and an
unknown unit reads as None rather than as a number in the wrong unit.
The export writes the converted mAU value.

The codes and baseline times are not in the REC/2026/06 schema. They
are now written under the peak's custom information aggregate document,
which the schema does define, with Empower's labels, and read from
either the peak or its custom information. A baseline time needs s or
min; any other unit gives None. The baseline_*_value keys are dropped:
until a document fills that field with a signal value, one field maps
to one key. A code is stripped, and a blank one reads as None.

A small real Empower excerpt (three valley-split peaks and the trace
under them, anonymous, times shifted to zero) now shows that trace minus
the edge heights reproduces each reported area within 1%.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZZc1jNciuVx7aekxG7YRR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZZc1jNciuVx7aekxG7YRR
The export labels a peak's height mAU and its area mAU.s, but the reader
took both as numbers whatever unit the document named, so a peak list
in AU or in Empower's microvolts was written a thousand times off under
a unit it was not in. Height, area and the edge heights now share one
conversion: AU and uV (and AU.s and uV.s) convert to mAU, an unknown
unit reads as None, and a value with no unit is still taken as the
schema's mAU. A microvolt document is tested from read to export.

The peaks' custom-information warnings now share one set per read, so
a complaint repeated across peaks and documents is made once.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZZc1jNciuVx7aekxG7YRR
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BZZc1jNciuVx7aekxG7YRR
@ekwan
ekwan merged commit ff716a7 into main Oct 17, 2026
4 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