Skip to content

Commit

Permalink
fix(namedAlleleMatcher): don't print duplication warnings for cases d…
Browse files Browse the repository at this point in the history
…ealt by preprocessor
  • Loading branch information
markwoon committed Feb 28, 2025
1 parent 2b8815b commit 5ff5649
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/main/java/org/pharmgkb/pharmcat/haplotype/VcfReader.java
Original file line number Diff line number Diff line change
Expand Up @@ -256,8 +256,14 @@ public void parseLine(VcfMetadata metadata, VcfPosition position, List<VcfSample

final String chrPos = position.getChromosome() + ":" + position.getPosition();
if (m_alleleMap.containsKey(chrPos)) {
addWarning(chrPos, "Duplicate entry found in VCF; this entry trumps others.",
"Duplicate entry: first valid position wins");
// The preprocessor will split out PGx variants and non-PGx variants into 2 separate lines and add a filter code
// on the second entry. Don't bother printing warning in this case.
if (!position.getFilters().contains(sf_filterCodeRef) &&
!position.getFilters().contains(sf_filterCodeAlt) &&
!position.getFilters().contains(sf_filterCodeIndel)) {
addWarning(chrPos, "Duplicate entry found in VCF; first valid entry trumps others.",
"Duplicate entry: first valid position wins");
}
return;
}

Expand Down

0 comments on commit 5ff5649

Please sign in to comment.