Skip to content

Commit

Permalink
🔨 add skip * alleles
Browse files Browse the repository at this point in the history
  • Loading branch information
migbro committed Feb 2, 2024
1 parent 95bd420 commit bade14c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
13 changes: 13 additions & 0 deletions src/commands/annotate_cmd.rs
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,20 @@ pub fn annotate_main(
);
}
n += 1;
// First check if the variant is *, skip those
if String::from_utf8_lossy(record.alleles()[1]) == "*" {
let rid = record.rid().unwrap();
let chrom = std::str::from_utf8(oheader_view.rid2name(rid).unwrap()).unwrap();
eprintln!(
"contig {} pos {} alt has * value, skipping annotation, outputting entry as-is",
&chrom,
record.pos() + 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]);
}
Expand Down
6 changes: 2 additions & 4 deletions tests/.gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
anno.vcf.gz
generated-all.vcf
generated-exclude.vcf
test.echtvar
test.echtvar.before
generated-*
test.echtvar*
sl.zip

0 comments on commit bade14c

Please sign in to comment.