Skip to main content

IntervalSetOps

Trait IntervalSetOps 

Source
pub trait IntervalSetOps {
    // Required methods
    fn setdiff(&self, other: &RegionSet) -> RegionSet;
    fn intersect(&self, other: &RegionSet) -> RegionSet;
    fn jaccard(&self, other: &RegionSet) -> f64;
    fn coverage(&self, other: &RegionSet) -> f64;
    fn overlap_coefficient(&self, other: &RegionSet) -> f64;
    fn closest(&self, other: &RegionSet) -> Vec<(usize, usize, i64)>;
}
Expand description

Two-set interval operations on genomic region sets.

Provides set algebra (setdiff, intersect) and similarity metrics (jaccard, coverage, overlap_coefficient). Implementations may use sweep-line or index-based algorithms.

Required Methods§

Source

fn setdiff(&self, other: &RegionSet) -> RegionSet

Set difference: remove portions of self that overlap with other.

Source

fn intersect(&self, other: &RegionSet) -> RegionSet

Range-level intersection: positions covered by both sets.

Source

fn jaccard(&self, other: &RegionSet) -> f64

Nucleotide-level Jaccard similarity: |intersection| / |union|.

Source

fn coverage(&self, other: &RegionSet) -> f64

Fraction of self’s base pairs covered by other.

Source

fn overlap_coefficient(&self, other: &RegionSet) -> f64

Overlap coefficient: |intersection| / min(|self|, |other|).

Source

fn closest(&self, other: &RegionSet) -> Vec<(usize, usize, i64)>

Find the nearest region in other for each region in self.

Returns (self_index, other_index, distance) tuples.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§