|
|
@@ -116,10 +116,20 @@ impl Run for DeepSomatic {
|
|
|
&self.vcf_passed,
|
|
|
BcftoolsConfig::default(),
|
|
|
)
|
|
|
- .unwrap();
|
|
|
+ .map_err(|e| {
|
|
|
+ anyhow::anyhow!(
|
|
|
+ "Error while running bcftools pass for {}.\n{e}",
|
|
|
+ self.output_vcf
|
|
|
+ )
|
|
|
+ })?;
|
|
|
report
|
|
|
.save_to_file(&format!("{}/bcftools_pass_", self.log_dir))
|
|
|
- .unwrap();
|
|
|
+ .map_err(|e| {
|
|
|
+ anyhow::anyhow!(
|
|
|
+ "Error while saving bcftools report for {}.\n{e}",
|
|
|
+ self.output_vcf
|
|
|
+ )
|
|
|
+ })?;
|
|
|
}
|
|
|
|
|
|
Ok(())
|
|
|
@@ -136,19 +146,12 @@ impl Variants for DeepSomatic {
|
|
|
fn variants(&self, annotations: &Annotations) -> anyhow::Result<VariantCollection> {
|
|
|
let caller = self.caller_cat();
|
|
|
let add = vec![caller.clone()];
|
|
|
- info!(
|
|
|
- "Loading variants from {}: {}",
|
|
|
- caller, self.vcf_passed
|
|
|
- );
|
|
|
+ info!("Loading variants from {}: {}", caller, self.vcf_passed);
|
|
|
let variants = read_vcf(&self.vcf_passed)?;
|
|
|
variants.par_iter().for_each(|v| {
|
|
|
annotations.insert_update(v.hash(), &add);
|
|
|
});
|
|
|
- info!(
|
|
|
- "{}, {} variants loaded.",
|
|
|
- caller,
|
|
|
- variants.len()
|
|
|
- );
|
|
|
+ info!("{}, {} variants loaded.", caller, variants.len());
|
|
|
Ok(VariantCollection {
|
|
|
variants,
|
|
|
vcf: Vcf::new(self.vcf_passed.clone().into())?,
|