Skip to content

Commit

Permalink
fix: clean up cli interactions with pileup
Browse files Browse the repository at this point in the history
  • Loading branch information
mrvollger committed Jul 18, 2024
1 parent bf5d6dc commit 7e4decf
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/pileup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -284,14 +284,18 @@ impl<'a> FiberseqPileup<'a> {
/// if it does, return true, otherwise return false
/// this is used to determine if the data should be written to the output
pub fn is_same_as_previous(&self, i: usize) -> bool {
if i == 0
|| (self.all_data.row(i) == self.all_data.row(i - 1)
&& self.hap1_data.row(i) == self.hap1_data.row(i - 1)
&& self.hap2_data.row(i) == self.hap2_data.row(i - 1))
{
if i == 0 {
return true;
} else {
let total_same = self.all_data.row(i) == self.all_data.row(i - 1);
let hap1_same = self.hap1_data.row(i) == self.hap1_data.row(i - 1);
let hap2_same = self.hap2_data.row(i) == self.hap2_data.row(i - 1);
if self.pileup_opts.haps {
return total_same && hap1_same && hap2_same;
} else {
return total_same;
}
}
false
}

fn wait_to_write(&self, i: usize) -> bool {
Expand Down

0 comments on commit 7e4decf

Please sign in to comment.