|
|
@@ -191,19 +191,15 @@ impl Variants for ClairS {
|
|
|
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
|
|
|
- );
|
|
|
- let variants = read_vcf(&self.vcf_passed)?;
|
|
|
+ info!("Loading variants from {}: {}", caller, self.vcf_passed);
|
|
|
+ let variants = read_vcf(&self.vcf_passed).map_err(|e| {
|
|
|
+ anyhow::anyhow!("Failed to read ClairS VCF {}.\n{e}", 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,
|
|
|
@@ -217,20 +213,13 @@ impl ClairS {
|
|
|
pub fn germline(&self, annotations: &Annotations) -> anyhow::Result<VariantCollection> {
|
|
|
let caller = Annotation::Callers(Caller::ClairS, Sample::Germline);
|
|
|
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.clair3_germline_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,
|