Skip to content

Commit

Permalink
Rename of overlaps to overlap_widths.
Browse files Browse the repository at this point in the history
  • Loading branch information
vsbuffalo committed Mar 26, 2024
1 parent 587b0cb commit b8cf886
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "granges"
version = "0.2.2"
version = "0.3.0"
edition = "2021"
license = "MIT"
authors = ["Vince Buffalo <[email protected]>"]
Expand Down
2 changes: 1 addition & 1 deletion src/commands.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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()?;
Expand Down
10 changes: 5 additions & 5 deletions src/join.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Option<usize>>));
Expand Down Expand Up @@ -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<Position> {
/// Retrieve the right overlap widths.
pub fn overlap_widths(&self) -> Vec<Position> {
self.rights
.iter()
.map(|r| r.overlap_width(&self.left))
Expand Down

0 comments on commit b8cf886

Please sign in to comment.