Skip to content

fix: Fix Perkin Elmer Envision parser to recognize A450 labels as absorbance - #1152

Merged
nathan-stender merged 2 commits into
mainfrom
fix-envision-absorbance-parsing
Mar 16, 2026
Merged

fix: Fix Perkin Elmer Envision parser to recognize A450 labels as absorbance#1152
nathan-stender merged 2 commits into
mainfrom
fix-envision-absorbance-parsing

Conversation

@nathan-stender

Copy link
Copy Markdown
Collaborator

Summary

  • Fixed Perkin Elmer Envision parser incorrectly classifying absorbance measurements with labels like "A450", "A562", etc. as fluorescence
  • Added regex pattern matching for common "A###" absorbance wavelength naming convention
  • Added comprehensive test case with representative A450 absorbance data

Problem

The parser's get_read_type() function was defaulting to fluorescence for any unrecognized label. Absorbance measurements using the common "A###" naming pattern (where ### is the wavelength, e.g., A450 for 450nm absorbance) were not recognized by the existing pattern matching.

Solution

Added a regex pattern check r"^A\d{3}" to identify labels starting with 'A' followed by three digits as absorbance measurements.

Test plan

  • Created new test file PE_Envision_absorbance_A450_example.csv with representative A450 data
  • Verified the parser correctly identifies A450 labels as absorbance (192 absorbance fields, 0 fluorescence fields in output)
  • All existing Perkin Elmer Envision tests pass
  • Tested various absorbance patterns (A450, A562, A280, A600, A405) all correctly identified

🤖 Generated with Claude Code

… as absorbance

The parser was incorrectly defaulting absorbance measurements with labels like
"A450", "A562", etc. to fluorescence type. This fix adds pattern matching for
the common "A###" absorbance wavelength naming convention (e.g., A450 for 450nm
absorbance).

Added test case with representative A450 absorbance data to prevent regression.

Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
@nathan-stender
nathan-stender requested review from a team and slopez-b as code owners March 16, 2026 19:43
- Move re.match import to top of file with other imports
- Change Result.value from int to float to preserve decimal precision
- Parse values using float() instead of int() to avoid rounding
- Update all test data files to use float values consistently

This ensures absorbance values like 0.1500 are preserved instead of
being rounded to 0.

Co-Authored-By: Claude Opus 4.1 <noreply@anthropic.com>
@nathan-stender

Copy link
Copy Markdown
Collaborator Author

Update: Additional fixes added

Changes in latest commit:

  1. Fixed import location: Moved regex match import to top of file with other imports
  2. Fixed value precision: Changed Result.value from int to float to preserve decimal precision
    • Absorbance values like 0.1500 are now preserved instead of being rounded to 0
    • Updated all test data files to use float values consistently
  3. Parser improvements: Changed value parsing from int() to float() to handle decimal values properly

All tests passing ✅

@nathan-stender nathan-stender changed the title Fix Perkin Elmer Envision parser to recognize A450 labels as absorbance fix: Fix Perkin Elmer Envision parser to recognize A450 labels as absorbance Mar 16, 2026
@nathan-stender
nathan-stender merged commit 5344e59 into main Mar 16, 2026
15 of 16 checks passed
@nathan-stender
nathan-stender deleted the fix-envision-absorbance-parsing branch March 16, 2026 20:51
nathan-stender added a commit that referenced this pull request Mar 17, 2026
### Added

- Cytiva Biacore Insight - Add support for Affinity and Concentration
analysis files (#1137)
- Add compatibility with chardet 6.0.0+ and fix encoding issues (#1141)

### Fixed

- Fix Perkin Elmer Envision parser to recognize A450 labels as
absorbance (#1152)
- Optimize test encoding detection for 4x speedup (#1143)
- Fix GitHub Actions hatch/virtualenv compatibility (#1140)
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.

3 participants