Skip to content

Commit

Permalink
Stricter validation of allele sets in MultiSourceAnnotator
Browse files Browse the repository at this point in the history
  • Loading branch information
bbimber committed Jul 3, 2023
1 parent 5ffc439 commit 5d019b2
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import com.github.discvrseq.tools.DiscvrSeqInternalProgramGroup;
import com.github.discvrseq.walkers.annotator.Impact;
import htsjdk.variant.variantcontext.Allele;
import htsjdk.variant.variantcontext.VariantContext;
import htsjdk.variant.variantcontext.VariantContextBuilder;
import htsjdk.variant.variantcontext.writer.VariantContextWriter;
Expand All @@ -19,6 +20,7 @@

import java.io.File;
import java.util.*;
import java.util.stream.Collectors;

/**
* This is a fairly specialized tool, designed to take the VCFs annotated with ClinvarAnnotator (from DISCVR-seq Toolkit) and <a href="https://www.hgsc.bcm.edu/software/cassandra">Cassandra</a>,
Expand Down Expand Up @@ -567,7 +569,7 @@ private boolean matches(VariantContext source, VariantContext annotation){

//TODO: consider allele-specific annotations
if (!source.getAlleles().equals(annotation.getAlleles())){
logger.warn("alleles do not match: " + source.getContig() + "/" + source.getStart() + " for source: " + annotation.getSource());
throw new GATKException("Alleles do not match: " + source.getContig() + "/" + source.getStart() + " for source: " + annotation.getSource() + ", source: " + source.getAlleles().stream().map(Allele::getDisplayString).collect(Collectors.joining(",")) + ", annotation: " + annotation.getAlleles().stream().map(Allele::getDisplayString).collect(Collectors.joining(",")));
}

return true;
Expand Down

0 comments on commit 5d019b2

Please sign in to comment.