Trait BEDLike

Source
pub trait BEDLike {
Show 16 methods // Required methods fn chrom(&self) -> &str; fn set_chrom(&mut self, chrom: &str) -> &mut Self; fn start(&self) -> u64; fn set_start(&mut self, start: u64) -> &mut Self; fn end(&self) -> u64; fn set_end(&mut self, end: u64) -> &mut Self; // Provided methods fn name(&self) -> Option<&str> { ... } fn score(&self) -> Option<Score> { ... } fn strand(&self) -> Option<Strand> { ... } fn len(&self) -> u64 { ... } fn compare(&self, other: &Self) -> Ordering { ... } fn overlap<B: BEDLike>(&self, other: &B) -> Option<GenomicRange> { ... } fn n_overlap<B: BEDLike>(&self, other: &B) -> u64 { ... } fn to_genomic_range(&self) -> GenomicRange { ... } fn split_by_len(&self, bin_size: u64) -> impl Iterator<Item = GenomicRange> { ... } fn rsplit_by_len(&self, bin_size: u64) -> impl Iterator<Item = GenomicRange> { ... }
}
Expand description

Common BED fields

Required Methods§

Source

fn chrom(&self) -> &str

Return the chromosome name of the record

Source

fn set_chrom(&mut self, chrom: &str) -> &mut Self

Change the chromosome name of the record

Source

fn start(&self) -> u64

Return the 0-based start position of the record

Source

fn set_start(&mut self, start: u64) -> &mut Self

Change the 0-based start position of the record

Source

fn end(&self) -> u64

Return the end position (non-inclusive) of the record

Source

fn set_end(&mut self, end: u64) -> &mut Self

Change the end position (non-inclusive) of the record

Provided Methods§

Source

fn name(&self) -> Option<&str>

Return the name of the record

Source

fn score(&self) -> Option<Score>

Return the score of the record

Source

fn strand(&self) -> Option<Strand>

Return the strand of the record

Source

fn len(&self) -> u64

Return the length of the record. Return 0 if the end position is smaller than the start position.

Source

fn compare(&self, other: &Self) -> Ordering

Source

fn overlap<B: BEDLike>(&self, other: &B) -> Option<GenomicRange>

Return the overlap

Source

fn n_overlap<B: BEDLike>(&self, other: &B) -> u64

Return the size of overlap between two records

Source

fn to_genomic_range(&self) -> GenomicRange

Convert the record to a GenomicRange

Source

fn split_by_len(&self, bin_size: u64) -> impl Iterator<Item = GenomicRange>

Split into consecutive records with the specified length. The length of the last record may be shorter.

Source

fn rsplit_by_len(&self, bin_size: u64) -> impl Iterator<Item = GenomicRange>

Split into consecutive records with the specified length starting from the end. The result is in reverse order compared to split_by_len. The length of the last record may be shorter.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§