From 6b7b70d7c11228aa1274eeac1f6ad1f646dd9fc4 Mon Sep 17 00:00:00 2001 From: Joseph Guhlin Date: Fri, 22 Nov 2024 11:09:08 +1300 Subject: [PATCH] Integrate changes from #80 --- Cargo.toml | 10 +++------- src/lib.rs | 10 +++++----- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 6d5f8d6..6aa5f64 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "minimap2" -version = "0.1.20+minimap2.2.28" +version = "0.1.21+minimap2.2.28" edition = "2021" authors = ["Joseph Guhlin "] license = "MIT OR Apache-2.0" @@ -24,15 +24,11 @@ exclude = [ members = [] -exclude = [ - "minimappers2", - "fakeminimap2", - "minimap2-sys" -] +exclude = ["minimappers2", "fakeminimap2", "minimap2-sys"] [dependencies] libc = "0.2" -simdutf8 = {version = "0.1", optional = true} +simdutf8 = { version = "0.1", optional = true } needletail = { version = "0.6", optional = true, default-features = false} # Dep for development diff --git a/src/lib.rs b/src/lib.rs index cc825d6..9da84f8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -198,7 +198,7 @@ pub struct Alignment { pub cigar_str: Option, pub md: Option, pub cs: Option, - pub alignment_score: Option, + pub alignment_score: Option, } /// Mapping result @@ -782,12 +782,12 @@ impl Aligner { /// query_name: Name of the query sequence pub fn map( &self, + query_name: Option<&[u8]>, seq: &[u8], cs: bool, md: bool, // TODO max_frag_len: Option, extra_flags: Option<&[u64]>, - query_name: Option<&[u8]>, ) -> Result, &'static str> { // Make sure index is set if !self.has_index() { @@ -847,8 +847,8 @@ impl Aligner { let contig: *mut ::std::os::raw::c_char = (*((*(self.idx.unwrap())).seq.offset(reg.rid as isize))).name; - let is_primary = reg.parent == reg.id; - let is_supplementary = reg.sam_pri() == 0; + let is_primary = reg.parent == reg.id && (reg.sam_pri() > 0); + let is_supplementary = (reg.parent == reg.id) && (reg.sam_pri() == 0); // todo holy heck this code is ugly let alignment = if !reg.p.is_null() { @@ -989,7 +989,7 @@ impl Aligner { cigar_str, md: md_str, cs: cs_str, - alignment_score: Some(p.dp_score as u32), + alignment_score: Some(p.dp_score as i32), }) } else { None