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§
Provided Methods§
Sourcefn len(&self) -> u64
fn len(&self) -> u64
Return the length of the record. Return 0 if the end position is smaller than the start position.
fn compare(&self, other: &Self) -> Ordering
Sourcefn n_overlap<B: BEDLike>(&self, other: &B) -> u64
fn n_overlap<B: BEDLike>(&self, other: &B) -> u64
Return the size of overlap between two records
Sourcefn to_genomic_range(&self) -> GenomicRange
fn to_genomic_range(&self) -> GenomicRange
Convert the record to a GenomicRange
Sourcefn split_by_len(&self, bin_size: u64) -> impl Iterator<Item = GenomicRange>
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.
Sourcefn rsplit_by_len(&self, bin_size: u64) -> impl Iterator<Item = GenomicRange>
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.