diff --git a/Cargo.toml b/Cargo.toml index aac5ff7..10e5a47 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "granges" -version = "0.2.2" +version = "0.3.0" edition = "2021" license = "MIT" authors = ["Vince Buffalo "] diff --git a/src/commands.rs b/src/commands.rs index 45a1ef9..ba1443c 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -838,7 +838,7 @@ impl FeatureDensity { .left_overlaps(&gr)? .map_joins(|joins| { // these are merged, so this is the number of *unique* basepairs - let total_overlaps: Position = joins.join.overlaps().iter().cloned().sum(); + let total_overlaps: Position = joins.join.overlap_widths().iter().cloned().sum(); total_overlaps })? .take_data()?; diff --git a/src/join.rs b/src/join.rs index a40f3d2..51e8cab 100644 --- a/src/join.rs +++ b/src/join.rs @@ -28,7 +28,7 @@ impl GenericRange for RangeTuple { } } -/// This is a special "reduced" range that stores indices +/// This is a special "reduced" or flattened range that stores indices /// to multiple data elements. #[derive(Clone, Debug, PartialEq)] pub struct RangeReduced((Position, Position, HashSet>)); @@ -146,16 +146,16 @@ impl LeftGroupedJoin { /// Return whether this left range has any [`LeftGroupedJoin`]. pub fn has_overlaps(&self) -> bool { - !self.overlaps().is_empty() + !self.overlap_widths().is_empty() } /// Retrieve the number of right overlaps. pub fn num_overlaps(&self) -> usize { - self.overlaps().len() + self.overlap_widths().len() } - /// Retrieve the right overlaps. - pub fn overlaps(&self) -> Vec { + /// Retrieve the right overlap widths. + pub fn overlap_widths(&self) -> Vec { self.rights .iter() .map(|r| r.overlap_width(&self.left))