Skip to content

Commit

Permalink
Update to version 1.5.0
Browse files Browse the repository at this point in the history
  • Loading branch information
pbsena committed Jan 17, 2025
1 parent 9073769 commit 4104c2c
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
4 changes: 2 additions & 2 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "trgt"
version = "1.4.1"
version = "1.5.0"
edition = "2021"
build = "build.rs"

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,8 @@ tandem repeats at genome scale. 2024](https://www.nature.com/articles/s41587-023
- Algorithmic changes to `--genotyper cluster` allow fewer reads to be assigned to an allele; this may result in minor changes to consensus sequence and read assignment
- 1.4.1
- Bug fix: corrected the type of the rq tag in BAM output
- 1.5.0
- Read clustering genotyper (`--genotyper cluster`) is now significantly faster at genotyping high-coverage repeat expansions; this may result in minor changes to consensus sequence and read assignment for highly mosaic repeats

### DISCLAIMER

Expand Down
9 changes: 5 additions & 4 deletions src/trgt/genotype/genotype_cluster.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::{consensus, Gt, TrSize};
use crate::utils::{align, Ploidy};
use arrayvec::ArrayVec;
use bio::alignment::distance::simd::bounded_levenshtein;
use bio::alignment::distance::simd::levenshtein;
use itertools::Itertools;
use kodama::{linkage, Method};

Expand Down Expand Up @@ -228,11 +228,12 @@ fn get_ci(seqs: &[&str]) -> (usize, usize) {

fn get_dist(seq1: &[u8], seq2: &[u8]) -> f64 {
// we'll skip ED in cases we already know it will be too costly to do so.
const MAX_K: u32 = 10000;
const MAX_OPS: usize = 10000;

let seq_diff = seq1.len().abs_diff(seq2.len()) as u32;
let dist = if seq_diff <= MAX_K {
bounded_levenshtein(seq1, seq2, MAX_K).unwrap_or(MAX_K)
let num_operations = seq1.len() * seq2.len();
let dist = if num_operations <= MAX_OPS {
levenshtein(seq1, seq2)
} else {
seq_diff // lower bound on ED
};
Expand Down

0 comments on commit 4104c2c

Please sign in to comment.