Skip to content

Tuple to dataclass - #2

Open
XLIU-hub wants to merge 240 commits into
masterfrom
tuple_to_dataclass
Open

XLIU-hub wants to merge 240 commits into
masterfrom
tuple_to_dataclass

Conversation

@XLIU-hub

@XLIU-hub XLIU-hub commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Pull Request Details

Refactor the crossmapper position API from tuple-based values to typed dataclasses, adding validation for dataclass values and class initialization inputs.

  • Add Coord, Locus.Point, MultiLocus.Point, GenomicPoint, NonCodingPoint, CodingPoint, and ProteinPoint dataclasses.
  • Update locus, multi-locus, genomic, non-coding, coding, and protein conversions to accept and return the new data models.
  • Add validation for position values, offsets, regions, loci, CDS ranges, and reference-length bounds.
  • Expand and update tests for validation errors.
  • Add typings for all functions.

Breaking Changes:

  • Callers must replace tuple position inputs and outputs with the relevant dataclass instances.
  • Public dataclass inputs and internal conversion models now raise errors for invalid values.

Validation

  • Updated tests for dataclass inputs and outputs for locus, multi_locus, and crossmapper.
  • Added coverage for validation errors and error messages.
  • Added CI checks for typing compatibility.

Xiaoyun Liu added 30 commits February 19, 2026 16:16
Comment thread mutalyzer_crossmapper/crossmapper.py Outdated
if region == 'u':
position = 1
if region == 'd':
if self._coding[1] == self._exons[1]:

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if position in upstream and downstream has been checked at the crossmapper level, maybe the downstream position assigning can be simplified as position = self._exons[1]? the same as the upstream.

mihailefter and others added 29 commits September 4, 2026 09:55
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.

2 participants