|
|
@@ -517,7 +517,7 @@ impl Variants {
|
|
|
Ok(())
|
|
|
}
|
|
|
|
|
|
- ///
|
|
|
+ ///
|
|
|
pub fn merge(&mut self) {
|
|
|
let pg = self.mp.add(new_pg_speed(self.len() as u64));
|
|
|
pg.set_message("Merging Variants by contig, positions, ref, alt");
|
|
|
@@ -1320,35 +1320,36 @@ pub fn run_pipe(name: &str, multi: &MultiProgress) -> Result<()> {
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&deepvariant_diag_vcf).exists() {
|
|
|
- panic!("{deepvariant_diag_vcf} is required")
|
|
|
+ return Err(anyhow!("{deepvariant_diag_vcf} is required"));
|
|
|
+ // panic!("{deepvariant_diag_vcf} is required")
|
|
|
}
|
|
|
let deepvariant_mrd_vcf = format!(
|
|
|
"{}/{name}/mrd/DeepVariant/{name}_mrd_DeepVariant_PASSED.vcf.gz",
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&deepvariant_mrd_vcf).exists() {
|
|
|
- panic!("{deepvariant_mrd_vcf} is required")
|
|
|
+ return Err(anyhow!("{deepvariant_mrd_vcf} is required"));
|
|
|
}
|
|
|
let mrd_bam = format!(
|
|
|
"{}/{name}/mrd/{name}_mrd_hs1.bam",
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&mrd_bam).exists() {
|
|
|
- panic!("{mrd_bam} is required")
|
|
|
+ return Err(anyhow!("{mrd_bam} is required"));
|
|
|
}
|
|
|
let clairs_vcf = format!(
|
|
|
"{}/{name}/diag/ClairS/{name}_diag_clairs_PASSED.vcf.gz",
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&clairs_vcf).exists() {
|
|
|
- panic!("{clairs_vcf} is required")
|
|
|
+ return Err(anyhow!("{clairs_vcf} is required"));
|
|
|
}
|
|
|
let clairs_indels_vcf = format!(
|
|
|
"{}/{name}/diag/ClairS/{name}_diag_clairs_indel_PASSED.vcf.gz",
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&clairs_indels_vcf).exists() {
|
|
|
- panic!("{clairs_indels_vcf} is required")
|
|
|
+ return Err(anyhow!("{clairs_indels_vcf} is required"));
|
|
|
}
|
|
|
let sniffles_vcf = format!(
|
|
|
"{}/{name}/diag/Sniffles/{name}_diag_sniffles.vcf",
|
|
|
@@ -1359,14 +1360,14 @@ pub fn run_pipe(name: &str, multi: &MultiProgress) -> Result<()> {
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&sniffles_vcf).exists() {
|
|
|
- panic!("{sniffles_vcf} is required")
|
|
|
+ return Err(anyhow!("{sniffles_vcf} is required"));
|
|
|
}
|
|
|
let nanomonsv_vcf = format!(
|
|
|
"{}/{name}/diag/nanomonsv/{name}_diag_nanomonsv_PASSED.vcf.gz",
|
|
|
cfg.longreads_results_dir
|
|
|
);
|
|
|
if !std::path::Path::new(&nanomonsv_vcf).exists() {
|
|
|
- panic!("{nanomonsv_vcf} is required")
|
|
|
+ return Err(anyhow!("{nanomonsv_vcf} is required"));
|
|
|
}
|
|
|
|
|
|
// let db_path = "/data/db_results.sqlite".to_string();
|
|
|
@@ -1433,7 +1434,6 @@ pub fn run_pipe(name: &str, multi: &MultiProgress) -> Result<()> {
|
|
|
|
|
|
let constits = variants.get_cat(&VariantCategory::Constit);
|
|
|
let constits = Variants::from_vec(name.to_string(), &multi, constits);
|
|
|
- // constits.save_sql(&db_constit_path)?;
|
|
|
constits.save_bytes(&bytes_constit_path)?;
|
|
|
|
|
|
variants.keep_somatics_un();
|
|
|
@@ -1445,10 +1445,11 @@ pub fn run_pipe(name: &str, multi: &MultiProgress) -> Result<()> {
|
|
|
info!("Variants retained: {}", variants.len());
|
|
|
|
|
|
variants.annotate_gff_feature(&cfg.gff_path)?;
|
|
|
+
|
|
|
variants.echtvar_annotate(&deepvariant_mrd_vcf)?;
|
|
|
+ variants.filter_snp()?;
|
|
|
|
|
|
variants.save_bytes(&bytes_path)?;
|
|
|
- // variants.filter_snp()?;
|
|
|
// variants.stats()?;
|
|
|
//
|
|
|
// if std::path::Path::new(&db_path).exists() {
|