From 15c3654e19c69d63c21f1d5bd90e1e79e6b462c2 Mon Sep 17 00:00:00 2001 From: Manuel Holtgrewe Date: Wed, 11 Oct 2023 09:08:05 +0200 Subject: [PATCH] Fixing problem with left-trimming variants (#99) --- .../bihealth/varfish_annotator/utils/VariantNormalizer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/varfish-annotator-core/src/main/java/com/github/bihealth/varfish_annotator/utils/VariantNormalizer.java b/varfish-annotator-core/src/main/java/com/github/bihealth/varfish_annotator/utils/VariantNormalizer.java index 71f264c..8048861 100644 --- a/varfish-annotator-core/src/main/java/com/github/bihealth/varfish_annotator/utils/VariantNormalizer.java +++ b/varfish-annotator-core/src/main/java/com/github/bihealth/varfish_annotator/utils/VariantNormalizer.java @@ -72,7 +72,7 @@ private VariantDescription shiftLeft(VariantDescription desc) { while (anyChange) { anyChange = false; - // Trim left-most nucletoide + // Trim right-most nucletoide if (ref.length() > 0 && alt.length() > 0 && ref.charAt(ref.length() - 1) == alt.charAt(alt.length() - 1)) { @@ -103,6 +103,7 @@ private VariantDescription trimBasesLeft(VariantDescription desc, int minSize) { if (ref.length() > minSize && alt.length() > minSize && ref.charAt(0) == alt.charAt(0)) { ref = ref.substring(1); alt = alt.substring(1); + start += 1; } else { break; }