torchcell.sequence.DnaSelectionResult

class DnaSelectionResult(*, id: str, chromosome: int, strand: str, start: int, end: int, seq: str)[source]

Bases: ModelStrict

A validated DNA region selection with coordinates, strand, and sequence.

end_leq_start() → DnaSelectionResult[source]

Validate that start is not greater than end.

Runs after field validation, so a payload missing start or end is refused by pydantic’s own missing-field error naming the field.

classmethod check_strand(v: str) → str[source]

Validate that the strand is ‘+’ or ‘-‘.

classmethod check_positive(v: int) → int[source]

Validate that the coordinate value is non-negative.

classmethod check_seq_len(v: str) → str[source]

Validate that the sequence length is non-negative.

model_config: ClassVar[ConfigDict] = {'extra': 'forbid', 'frozen': True}

Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].