Skip to content

Commit

Permalink
bugfix
Browse files Browse the repository at this point in the history
now counts deletions correctly. If a deletion extends beyond homopoylmer, classifies as ?
  • Loading branch information
Alan-Collins committed Jan 6, 2023
1 parent f77bae1 commit 8c4230d
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/homopolymer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ impl HomopolymerResult<'_> {
read_downstream: read_down.to_string(),
ref_upstream: ref_up.to_string(),
ref_downstream: ref_down.to_string(),
length: (stop-start) as u32,
length: homo_read_aln.len() as u32,
score: HomopolymerScore::Difference(0),
};
hr.score();
Expand Down Expand Up @@ -199,8 +199,12 @@ impl HomopolymerResult<'_> {
if non_base > 0 {
self.score = HomopolymerScore::Other("?".to_string());
return
} else if gap + is_base > self.homo.length {
// deletion beyond just the homopolymer. Return ?
self.score = HomopolymerScore::Other("?".to_string());
return
} else {
self.score = HomopolymerScore::Difference(-gap as i32);
self.score = HomopolymerScore::Difference(gap as i32 *-1);
return
}
}
Expand Down

0 comments on commit 8c4230d

Please sign in to comment.