diff --git a/src/commands/annotate_cmd.rs b/src/commands/annotate_cmd.rs index 09884d8..cae266f 100644 --- a/src/commands/annotate_cmd.rs +++ b/src/commands/annotate_cmd.rs @@ -100,6 +100,7 @@ pub fn annotate_main( let mut n = 0u64; let mut n_written = 0u64; let mut modu = 10000u64; + let mut skip_warn = 0; for r in vcf.records() { let mut record = r.expect("error reading record"); @@ -125,7 +126,25 @@ pub fn annotate_main( ); } n += 1; + // First check if the variant is *, skip those + if record.alleles()[1][0] == b'*' { + let rid = record.rid().unwrap(); + let chrom = std::str::from_utf8(oheader_view.rid2name(rid).unwrap()).unwrap(); + // Only warn up to 10 times, just keep count in general + if skip_warn < 10 { + eprintln!( + "contig {} pos {} alt has * value, skipping annotation, outputting entry as-is", + &chrom, + record.pos() + 1 + ); + if skip_warn == 9 { eprintln!("not reporting further warnings") } + } + skip_warn += 1; + ovcf.write(&record).expect("failed to write record"); + continue; + } // this updates evalues and fills expr values + for (i, e) in echts.iter_mut().enumerate() { e.update_expr_values(&mut record, &mut expr_values[i]); } @@ -180,6 +199,10 @@ pub fn annotate_main( 1000 * (n as u128) / mili, n_written, ); + eprintln!( + "Skipped {} variants with * alt.", + skip_warn, + ); /* //let ep = std::path::Path::new(&*epaths[0]); diff --git a/tests/.gitignore b/tests/.gitignore index 8bb1f46..0162c54 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -1,6 +1,4 @@ anno.vcf.gz -generated-all.vcf -generated-exclude.vcf -test.echtvar -test.echtvar.before +generated-* +test.echtvar* sl.zip