INNER CODE UNIT · Rust
get_target_depth
mbhall88/rasusa · src/alignment/mod.rs:58
fn get_target_depth(&self, is_paired: bool) -> u32 {
if is_paired {
// divide the original target by 2 because we will add the mates back later
(self.coverage / 2).max(1) // in case we hit 0
} else {
self.coverage
}
}
// a helper function to scan the file linearly to find mates, only relevent on paired end illumina data
fn recover_mates(
&self,
survivor_names: &mut NameSet,
header: &Header,
writer: &mut AlignmentWriter,
) -> Result<()> {
info!("Recovering mates (last segment records)");
let mut reader = build_alignment_reader(&self.aln, self.threads)?;