BedView
Mojo struct 🡭
BedView
Section titled “BedView”@memory_onlystruct BedView[O: Origin[mut=O.mut]]Zero-copy view over one BED data line in the parser’s buffer.
Lifetime: Valid only until the next parser read. Do not store;
call .to_record() when the record must outlive the current iteration.
Coordinates are 0-based, half-open [chrom_start, chrom_end).
Parameters
Section titled “Parameters”- O (
Origin)
Fields
Section titled “Fields”- chrom_start (
UInt64) - chrom_end (
UInt64) - score (
Optional[Int]) - strand (
Optional[Strand]) - thick_start (
Optional[UInt64]) - thick_end (
Optional[UInt64]) - block_count (
Optional[Int]) - num_fields (
Int)
Implemented traits
Section titled “Implemented traits”AnyType, ImplicitlyDestructible, Movable
Methods
Section titled “Methods”__init__
Section titled “__init__”def __init__(out self, _chrom: Span[UInt8, O], chrom_start: UInt64, chrom_end: UInt64, _name: Optional[Span[UInt8, O]], score: Optional[Int], strand: Optional[Strand], thick_start: Optional[UInt64], thick_end: Optional[UInt64], _item_rgb: Optional[ItemRgb], block_count: Optional[Int], _block_sizes_span: Optional[Span[UInt8, O]], _block_starts_span: Optional[Span[UInt8, O]], num_fields: Int)Args:
- _chrom (
Span) - chrom_start (
UInt64) - chrom_end (
UInt64) - _name (
Optional) - score (
Optional) - strand (
Optional) - thick_start (
Optional) - thick_end (
Optional) - _item_rgb (
Optional) - block_count (
Optional) - _block_sizes_span (
Optional) - _block_starts_span (
Optional) - num_fields (
Int) - self (
Self)
Returns:
Self
def chrom(self) -> StringSlice[O]Args:
- self (
Self)
Returns:
StringSlice
start_position
Section titled “start_position”def start_position(self) -> Position1-based start of the feature (aligned with noodles_core; BED chromStart → start+1).
Args:
- self (
Self)
Returns:
Position
end_position
Section titled “end_position”def end_position(self) -> Optional[Position]1-based end position (chromEnd). None for zero-length BED records (chromEnd == 0).
Args:
- self (
Self)
Returns:
Optional
interval
Section titled “interval”def interval(self) -> Optional[Interval]Feature extent as 1-based closed [chromStart+1, chromEnd]. Returns None for zero-length BED records (chromEnd == 0). BED 0-based half-open [s, e) → 1-based closed [s+1, e].
Args:
- self (
Self)
Returns:
Optional
thick_interval
Section titled “thick_interval”def thick_interval(self) -> Optional[Interval]Thick (coding) extent if fields 7–8 present; else None (1-based closed).
Args:
- self (
Self)
Returns:
Optional
def name(self) -> Optional[StringSlice[O]]Args:
- self (
Self)
Returns:
Optional
item_rgb
Section titled “item_rgb”def item_rgb(self) -> Optional[ItemRgb]Args:
- self (
Self)
Returns:
Optional
to_record
Section titled “to_record”def to_record(self) -> BedRecordMaterialize an owned BedRecord. Call when the record must outlive the view.
Args:
- self (
Self)
Returns:
BedRecord
Raises: