From bccc10a010e840727c1ae2ef77dcba5e78a6e427 Mon Sep 17 00:00:00 2001 From: Chris Saunders Date: Tue, 24 Sep 2024 12:36:27 -0700 Subject: [PATCH 1/3] Correct rendered range of symbolic VCF alleles --- .../java/org/broad/igv/variant/vcf/VCFVariant.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java b/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java index 182c033067..46168851df 100644 --- a/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java +++ b/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java @@ -385,6 +385,17 @@ private void calcStart() { if (variantContext.getType() == VariantContext.Type.INDEL || variantContext.getType() == VariantContext.Type.MIXED) { prefixLength = findCommonPrefixLength(); } + + /** + * Since v4.1, the VCF spec has defined POS as the base preceding the polymorphism for any symbolic allele. + * + * https://github.com/samtools/hts-specs/blob/4cde0e235b4e4cfbd67a0c3a38abea611d56d256/VCFv4.1.tex#L165 + * + */ + if (variantContext.getType() == VariantContext.Type.SYMBOLIC) { + prefixLength = 1; + } + this.start = (variantContext.getStart() - 1) + prefixLength; } From 498f31f9b9f8f858dc487a7eb1011a7230cb04d3 Mon Sep 17 00:00:00 2001 From: Chris Saunders Date: Wed, 25 Sep 2024 10:11:48 -0700 Subject: [PATCH 2/3] Update src/main/java/org/broad/igv/variant/vcf/VCFVariant.java Co-authored-by: Louis Bergelson --- src/main/java/org/broad/igv/variant/vcf/VCFVariant.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java b/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java index 46168851df..0f357233b3 100644 --- a/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java +++ b/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java @@ -392,7 +392,7 @@ private void calcStart() { * https://github.com/samtools/hts-specs/blob/4cde0e235b4e4cfbd67a0c3a38abea611d56d256/VCFv4.1.tex#L165 * */ - if (variantContext.getType() == VariantContext.Type.SYMBOLIC) { + if (variantContext.getType(true) == VariantContext.Type.SYMBOLIC) { prefixLength = 1; } From 2d5bf6d54c60445dcc0ac3242cb9b60d707e0870 Mon Sep 17 00:00:00 2001 From: Chris Saunders Date: Wed, 25 Sep 2024 10:15:37 -0700 Subject: [PATCH 3/3] Update VCFVariant.java Update comment to include non-ref symbolic allele exception in VCF 4.4+ --- src/main/java/org/broad/igv/variant/vcf/VCFVariant.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java b/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java index 0f357233b3..acc15bc66b 100644 --- a/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java +++ b/src/main/java/org/broad/igv/variant/vcf/VCFVariant.java @@ -387,9 +387,7 @@ private void calcStart() { } /** - * Since v4.1, the VCF spec has defined POS as the base preceding the polymorphism for any symbolic allele. - * - * https://github.com/samtools/hts-specs/blob/4cde0e235b4e4cfbd67a0c3a38abea611d56d256/VCFv4.1.tex#L165 + * The VCF spec defines POS as the base preceding the polymorphism for non-ref symbolic alleles. * */ if (variantContext.getType(true) == VariantContext.Type.SYMBOLIC) {