Skip to content

Commit

Permalink
Correct rendered range of symbolic VCF alleles (#1580)
Browse files Browse the repository at this point in the history
* Adjust the start position of non-ref symbolic alleles to include a padding base as described in the vcf spec.

Co-authored-by: Louis Bergelson <[email protected]>
  • Loading branch information
ctsa and lbergelson authored Sep 26, 2024
1 parent 907726c commit 6203b45
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/main/java/org/broad/igv/variant/vcf/VCFVariant.java
Original file line number Diff line number Diff line change
Expand Up @@ -385,6 +385,15 @@ private void calcStart() {
if (variantContext.getType() == VariantContext.Type.INDEL || variantContext.getType() == VariantContext.Type.MIXED) {
prefixLength = findCommonPrefixLength();
}

/**
* The VCF spec defines POS as the base preceding the polymorphism for non-ref symbolic alleles.
*
*/
if (variantContext.getType(true) == VariantContext.Type.SYMBOLIC) {
prefixLength = 1;
}

this.start = (variantContext.getStart() - 1) + prefixLength;
}

Expand Down

0 comments on commit 6203b45

Please sign in to comment.