Skip to content

BedRecord

Mojo struct 🡭

@memory_only
struct BedRecord

Single BED feature (owned). Coordinates are 0-based, half-open.

  • Chrom (BString)
  • ChromStart (UInt64)
  • ChromEnd (UInt64)
  • Name (Optional[BString])
  • Score (Optional[Int])
  • Strand (Optional[Strand])
  • ThickStart (Optional[UInt64])
  • ThickEnd (Optional[UInt64])
  • ItemRgb (Optional[ItemRgb])
  • BlockSizes (Optional[List[UInt64]])
  • BlockStarts (Optional[List[UInt64]])
  • NumFields (Int)

AnyType, Copyable, ImplicitlyDestructible, Movable, Writable

def chrom(ref self) -> String

Args:

  • self (Self)

Returns:

String

def start_position(self) -> Position

1-based start of the feature (aligned with noodles_core; BED chromStart → start+1).

Args:

  • self (Self)

Returns:

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

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

def thick_interval(ref self) -> Optional[Interval]

Thick (coding) extent if fields 7–8 present; else None (1-based closed).

Args:

  • self (Self)

Returns:

Optional

def name(ref self) -> Optional[String]

Args:

  • self (Self)

Returns:

Optional

def item_rgb(ref self) -> Optional[ItemRgb]

Args:

  • self (Self)

Returns:

Optional

def block_sizes(ref self) -> Optional[List[UInt64]]

Args:

  • self (Self)

Returns:

Optional

def block_starts(ref self) -> Optional[List[UInt64]]

Args:

  • self (Self)

Returns:

Optional

def write_to[w: Writer](ref self, mut writer: w)

Write this record as one TAB-delimited line (same column count as parsed).

Parameters:

  • w (Writer)

Args:

  • self (Self)
  • writer (w)