Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 0 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,6 @@ flate2 = { version = "1.0", features = ["zlib-rs"]}
thiserror = "2.0.11"
rayon = "1.11.0"
mimalloc = "0.1.48"
[target.'cfg(target_arch = "wasm32-wasi")'.dependencies]
block-aligner = { version = "0.5", features = ["simd_wasm"] }
[target.'cfg(target_arch = "x86_64")'.dependencies]
block-aligner = { version = "0.5", features = ["simd_avx2"] }
[target.'cfg(target_arch = "aarch64")'.dependencies]
block-aligner = { version = "0.5", features = ["simd_neon"] }

[dev-dependencies]
assert_cmd = "2.0.16"
Expand Down
4 changes: 2 additions & 2 deletions src/aligner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@ pub struct Aligner {
}

impl Aligner {
pub fn new(scores: Scores, k: usize, xdrop: i32) -> Self {
pub fn new(scores: Scores, k: usize, bandwidth: usize) -> Self {
let ssw_aligner = SswAligner::new(
scores.match_,
scores.mismatch,
scores.gap_open,
scores.gap_extend,
);
let piecewise_aligner = PiecewiseAligner::new(scores, k, xdrop);
let piecewise_aligner = PiecewiseAligner::new(scores, k, bandwidth);
Aligner {
scores,
ssw_aligner,
Expand Down
10 changes: 10 additions & 0 deletions src/cigar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,12 @@ impl Cigar {
Cigar { ops: vec![] }
}

pub fn with_capacity(hint: usize) -> Self {
Cigar {
ops: Vec::with_capacity(hint),
}
}

pub fn is_empty(&self) -> bool {
self.ops.is_empty()
}
Expand Down Expand Up @@ -124,6 +130,10 @@ impl Cigar {
}
}

pub fn reverse(&mut self) {
self.ops.reverse();
}

pub fn extend(&mut self, other: &Cigar) {
// TODO use push only for first, then extend
for oplen in &other.ops {
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ pub mod refseq;
pub mod revcomp;
pub mod seeding;
pub mod shuffle;
pub mod simdaligner;
pub mod ssw;
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,10 @@ struct Args {
#[arg(long = "ssw", help_heading = "Alignment")]
use_ssw: bool,

/// X-drop threshold for piecewise extension
#[arg(long = "xdrop", default_value_t = 500, value_name = "N", help_heading = "Alignment")]
xdrop: i32,
/// Bandwidth for the piecewise start/end extensions; extensions against a longer reference are
/// confined to this many diagonals off the anchor diagonal, shorter ones are aligned exactly
#[arg(long = "bw", default_value_t = 1024, value_name = "N", help_heading = "Alignment")]
bandwidth: usize,


/// Path to input reference (in FASTA format)
Expand Down Expand Up @@ -537,7 +538,7 @@ fn run() -> Result<(), CliError> {
debug!("{:?}", &scores);

let chainer = Chainer::new(index.k(), chaining_parameters);
let aligner = Aligner::new(scores, index.k(), args.xdrop);
let aligner = Aligner::new(scores, index.k(), args.bandwidth);

let cmd_line = env::args().skip(1).collect::<Vec<_>>().join(" ");
let rg_id = match args.rg_id {
Expand Down
Loading
Loading