Skip to content

Commit

Permalink
Merge pull request #29 from fulcrumgenomics/bug-27-clippy-issues
Browse files Browse the repository at this point in the history
Fix Clippy issues
  • Loading branch information
jdidion authored Sep 7, 2023
2 parents 457b2d1 + 6610c0a commit 49a0caf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib/align/aligners/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ impl Aligners<'_, MatchParams> {
let second_query_and_yend = (second_query, yend);

// Align!
for (query, yend) in vec![first_query_and_yend, second_query_and_yend] {
for (query, yend) in [first_query_and_yend, second_query_and_yend] {
best_alignment = self
.realign_and_split_at_y(
&query,
Expand Down Expand Up @@ -487,7 +487,7 @@ impl Aligners<'_, MatchParams> {
let second_query_and_ystart = (second_query, ystart);

// Align!
for (query, ystart) in vec![first_query_and_ystart, second_query_and_ystart] {
for (query, ystart) in [first_query_and_ystart, second_query_and_ystart] {
best_alignment = self
.realign_and_split_at_y(
&query,
Expand Down
10 changes: 5 additions & 5 deletions src/lib/align/aligners/multi_contig_aligner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -700,38 +700,38 @@ pub mod tests {
// make these into test cases?

// jump to the same contig and strand is prioritized
for mut contig in &mut aligner.contigs {
for contig in &mut aligner.contigs {
contig.aligner.scoring = contig.aligner.scoring.set_jump_scores(-1, -2, -2);
}
let alignment = aligner.custom(&y1);
assert_alignment(&alignment, 0, 15, 0, 10, 10 - 1, 0, "5=5J5=", 10);

// jump to the same contig and opposite strand is prioritized
// starts in the middle of x2, then jumps back to the start of x1
for mut contig in &mut aligner.contigs {
for contig in &mut aligner.contigs {
contig.aligner.scoring = contig.aligner.scoring.set_jump_scores(-2, -1, -2);
}
let alignment = aligner.custom(&y1);
assert_alignment(&alignment, 5, 15, 0, 10, 10 - 1, 1, "5A5=1c5j5=", 10);

// jump to a different contig is prioritized
// starts by aligning to x3 fully, then jumping to x1 and alinging to the last 5bp of x1
for mut contig in &mut aligner.contigs {
for contig in &mut aligner.contigs {
contig.aligner.scoring = contig.aligner.scoring.set_jump_scores(-2, -2, -1);
}
let alignment = aligner.custom(&y1);
assert_alignment(&alignment, 0, 15, 0, 10, 10 - 1, 2, "5=2c5J5=", 10);

// jump to the same contig and strand is prioritized when the scores are the same
for mut contig in &mut aligner.contigs {
for contig in &mut aligner.contigs {
contig.aligner.scoring = contig.aligner.scoring.set_jump_scores(-1, -1, -1);
}
let alignment = aligner.custom(&y1);
assert_alignment(&alignment, 0, 15, 0, 10, 10 - 1, 0, "5=5J5=", 10);

// jump to the same contig and opposite is prioritized when the scores are the same
// starts in the middle of x2, then jumps back to the start of x1
for mut contig in &mut aligner.contigs {
for contig in &mut aligner.contigs {
contig.aligner.scoring = contig.aligner.scoring.set_jump_scores(-2, -1, -1);
}
let alignment = aligner.custom(&y1);
Expand Down

0 comments on commit 49a0caf

Please sign in to comment.