BedRecord
Mojo struct 🡭
BedRecord
Section titled “BedRecord”@memory_onlystruct BedRecordSingle BED feature (owned). Coordinates are 0-based, half-open.
score: UInt16 in [0, 1000] per BED spec. OtherFields: extra columns beyond the standard BED12 fields (or beyond field 9 for BED10/11), stored as owned strings.
Fields
Section titled “Fields”- Chrom (
BString) - ChromStart (
UInt64) - ChromEnd (
UInt64) - Name (
Optional[BString]) - Score (
Optional[UInt16]) - Strand (
Optional[Strand]) - ThickStart (
Optional[UInt64]) - ThickEnd (
Optional[UInt64]) - ItemRgb (
Optional[ItemRgb]) - BlockSizes (
Optional[List[UInt64]]) - BlockStarts (
Optional[List[UInt64]]) - OtherFields (
Optional[List[BString]]) - NumFields (
Int)
Implemented traits
Section titled “Implemented traits”AnyType, Copyable, Deinitable, Movable, Writable
Methods
Section titled “Methods”fn def chrom(ref self) -> StringArgs:
- self (
Self)
Returns:
String
start_position
Section titled “start_position”fn 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”fn def end_position(self) -> Optional[Position]1-based end position (ChromEnd). None for zero-length BED records (ChromEnd == 0).
Args:
- self (
Self)
Returns:
Optional[Position]
interval
Section titled “interval”fn 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[Interval]
thick_interval
Section titled “thick_interval”fn 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[Interval]
fn def name(ref self) -> Optional[String]Args:
- self (
Self)
Returns:
Optional[String]
item_rgb
Section titled “item_rgb”fn def item_rgb(ref self) -> Optional[ItemRgb]Args:
- self (
Self)
Returns:
Optional[ItemRgb]
block_sizes
Section titled “block_sizes”fn def block_sizes(ref self) -> Optional[List[UInt64]]Args:
- self (
Self)
Returns:
Optional[List[UInt64]]
block_starts
Section titled “block_starts”fn def block_starts(ref self) -> Optional[List[UInt64]]Args:
- self (
Self)
Returns:
Optional[List[UInt64]]
other_fields
Section titled “other_fields”fn def other_fields(ref self) -> Optional[List[String]]Return extra columns beyond the standard BED fields, if any.
Args:
- self (
Self)
Returns:
Optional[List[String]]
write_to
Section titled “write_to”fn 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)