|
@@ -296,6 +296,11 @@ impl Run for LongphaseHap {
|
|
|
fs::remove_file(&self.bam_hp)?;
|
|
fs::remove_file(&self.bam_hp)?;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ if !self.should_run() {
|
|
|
|
|
+ info!("LongphaseHap is up-to-date for {}", self.bam_hp.display());
|
|
|
|
|
+ return Ok(());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
if !Path::new(&self.log_dir).exists() {
|
|
if !Path::new(&self.log_dir).exists() {
|
|
|
fs::create_dir_all(&self.log_dir).context("Failed to create output directory.")?;
|
|
fs::create_dir_all(&self.log_dir).context("Failed to create output directory.")?;
|
|
|
}
|
|
}
|
|
@@ -332,9 +337,8 @@ impl Run for LongphaseHap {
|
|
|
|
|
|
|
|
impl ShouldRun for LongphaseHap {
|
|
impl ShouldRun for LongphaseHap {
|
|
|
fn should_run(&self) -> bool {
|
|
fn should_run(&self) -> bool {
|
|
|
- let final_bam = PathBuf::from(format!("{}.bam", self.bam_hp.to_string_lossy()));
|
|
|
|
|
is_file_older(
|
|
is_file_older(
|
|
|
- final_bam.to_string_lossy().as_ref(),
|
|
|
|
|
|
|
+ self.bam_hp.to_string_lossy().as_ref(),
|
|
|
self.bam.to_string_lossy().as_ref(),
|
|
self.bam.to_string_lossy().as_ref(),
|
|
|
true,
|
|
true,
|
|
|
)
|
|
)
|