Skip to content

Commit

Permalink
Update r-oxbow dependencies and replace deprecated APIs (#66)
Browse files Browse the repository at this point in the history
* Update `r-oxbow` dependencies and replace deprecated APIs

* fix(r-oxbow): repair unverified `partition_from_index_file` impl

The implementation introduced in `5c329a6` attempted to return a
`Vec<(u64, u16)>`, which is incompatible with `extendr` and was merged
without verification. The function now correctly returns an R-compatible
List with named components (`compressed_offset`, `bin_index`).

---------

Co-authored-by: Trevor Manz <[email protected]>
  • Loading branch information
CGMossa and manzt authored Dec 1, 2024
1 parent 0df1395 commit c94bbab
Show file tree
Hide file tree
Showing 3 changed files with 425 additions and 166 deletions.
7 changes: 3 additions & 4 deletions oxbow/src/vpos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ fn partition_from_index(index: &csi::Index, chunksize: u64) -> Vec<(u64, u16)> {
continue;
}
let offsets = if rseq.linear_index().is_empty() {
get_offsets_from_binning_index(&rseq)
get_offsets_from_binning_index(rseq)
} else {
get_offsets_from_linear_index(&rseq)
get_offsets_from_linear_index(rseq)
};
let consolidated = consolidate_chunks(&offsets, chunksize);
partition.extend(consolidated);
Expand Down Expand Up @@ -114,6 +114,5 @@ fn parse_index_file(path: &str) -> io::Result<csi::Index> {

pub fn partition_from_index_file(path: &str, chunksize: u64) -> Vec<(u64, u16)> {
let index = parse_index_file(path).unwrap();
let partition = partition_from_index(&index, chunksize);
partition
partition_from_index(&index, chunksize)
}
Loading

0 comments on commit c94bbab

Please sign in to comment.