Skip to content

Commit

Permalink
Integrate changes from #80
Browse files Browse the repository at this point in the history
  • Loading branch information
jguhlin committed Nov 21, 2024
1 parent 0edd8fb commit 6b7b70d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 12 deletions.
10 changes: 3 additions & 7 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -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 <joseph.guhlin@gmail.com>"]
license = "MIT OR Apache-2.0"
Expand All @@ -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
Expand Down
10 changes: 5 additions & 5 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ pub struct Alignment {
pub cigar_str: Option<String>,
pub md: Option<String>,
pub cs: Option<String>,
pub alignment_score: Option<u32>,
pub alignment_score: Option<i32>,
}

/// Mapping result
Expand Down Expand Up @@ -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<usize>,
extra_flags: Option<&[u64]>,
query_name: Option<&[u8]>,
) -> Result<Vec<Mapping>, &'static str> {
// Make sure index is set
if !self.has_index() {
Expand Down Expand Up @@ -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() {
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 6b7b70d

Please sign in to comment.