From f99b913bd7cae564c62028631c3a35c4d621d692 Mon Sep 17 00:00:00 2001 From: Rob Patro Date: Wed, 13 Nov 2024 22:12:14 -0500 Subject: [PATCH] update deps, fix unique counting in bam mode --- Cargo.toml | 24 ++++++++++++------------ src/alignment_parser.rs | 12 ++++++------ src/bulk.rs | 6 +++--- src/util/oarfish_types.rs | 6 +++++- 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 3486b26..12e63d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -25,13 +25,13 @@ categories = ["command-line-utilities", "science"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -seqcol_rs = { git = "https://github.com/COMBINE-lab/seqcol_rs", branch = "dev", version = "0.1.2" } -anyhow = "1.0.86" -bstr = "1.10.0" +seqcol_rs = { git = "https://github.com/COMBINE-lab/seqcol_rs", branch = "dev", version = "0.1.3" } +anyhow = "1.0.93" +bstr = "1.11.0" bio-types = { version = "1.0.4", features = ["serde"] } -clap = { version = "4.5.16", features = ["derive"] } -noodles-bam = "0.66.0" -noodles-sam = "0.63.0" +clap = { version = "4.5.21", features = ["derive"] } +noodles-bam = "0.70.0" +noodles-sam = "0.66.0" num-format = "0.4.4" lz4 = "1.28.0" either = "1.13.0" @@ -44,9 +44,9 @@ statrs = "0.17" csv = "1.3" serde = { version = "1", features = ["derive"] } itertools = "0.13.0" -serde_json = "1.0.127" +serde_json = "1.0.132" path-tools = "0.1.0" -atomic_float = "1.0.0" +atomic_float = "1.1.0" sendable-swapvec = "0.4.3" rand = "0.8.5" arrow2 = { version = "0.18.0", features = [ @@ -56,12 +56,12 @@ arrow2 = { version = "0.18.0", features = [ "io_parquet_snappy", ] } kders = { git = "https://github.com/COMBINE-lab/kde-rs.git", branch = "dev", version = "0.1.1" } -noodles-bgzf = { version = "0.32.0" } +noodles-bgzf = { version = "0.33.0" } crossbeam = { version = "0.8.4", features = [ "crossbeam-queue", "crossbeam-channel", ] } -sprs = "0.11.1" +sprs = "0.11.2" minimap2-sys = { version = "0.1.19" } # rely on minimap2-temp until upstream version is pushed # make sure relevant changes are in upstream PR @@ -69,8 +69,8 @@ minimap2-temp = { version = "0.1.32" } # alternative sources for dev #minimap2-temp = { version = "0.1.20", git = "https://github.com/rob-p/minimap2-rs.git", branch = "alignment-score" } #minimap2 = { version = "0.1.20", git = "https://github.com/jguhlin/minimap2-rs.git", branch = "alignment-score" } -needletail = "0.5.1" -indicatif = "0.17.8" +needletail = "0.6.0" +indicatif = "0.17.9" rustc-hash = "2.0.0" [[bin]] diff --git a/src/alignment_parser.rs b/src/alignment_parser.rs index f177954..e2ad2f5 100644 --- a/src/alignment_parser.rs +++ b/src/alignment_parser.rs @@ -309,9 +309,9 @@ pub fn parse_alignments( if !prev_read.is_empty() { if store.add_group(txps, &mut records_for_read) { add_read_name(&records_for_read); - } - if records_for_read.len() == 1 { - store.inc_unique_alignments(); + if records_for_read.len() == 1 { + store.inc_unique_alignments(); + } } records_for_read.clear(); } @@ -343,9 +343,9 @@ pub fn parse_alignments( // if we are using read names and we added the group here if store.add_group(txps, &mut records_for_read) { add_read_name(&records_for_read); - } - if records_for_read.len() == 1 { - store.inc_unique_alignments(); + if records_for_read.len() == 1 { + store.inc_unique_alignments(); + } } records_for_read.clear(); } diff --git a/src/bulk.rs b/src/bulk.rs index a502036..4d533b6 100644 --- a/src/bulk.rs +++ b/src/bulk.rs @@ -534,15 +534,15 @@ pub fn quantify_bulk_alignments_raw_reads( None }; - if ag.len() == 1 { - store.inc_unique_alignments(); - } if store.add_filtered_group(ag, as_probs, txps_mut) { if let Some(ref mut nvec) = name_vec { let read_name = read_name_opt.unwrap_or(EMPTY_READ_NAME.to_string()); nvec.push(read_name) .expect("cannot push name to read name vector"); } + if ag.len() == 1 { + store.inc_unique_alignments(); + } } } } diff --git a/src/util/oarfish_types.rs b/src/util/oarfish_types.rs index fccd8de..2e6bee0 100644 --- a/src/util/oarfish_types.rs +++ b/src/util/oarfish_types.rs @@ -186,7 +186,11 @@ impl AlnRecordLike for } fn aln_span(&self) -> Option { - self.alignment_span().expect("valid span") + // NOTE: The transpose here is because noodles_sam + // switched from returning Result> to + // Option> --- think if there is a + // better way to handle the new return type directly + self.alignment_span().transpose().expect("valid span") } fn aln_score(&self) -> Option {