From 82c158fd0d30fc1d1e46c164df7bf4932b522df5 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Mon, 9 Oct 2017 11:55:55 +0100 Subject: [PATCH] JAL-2738 ensure variant feature is in forward sense --- src/jalview/io/vcf/VCFLoader.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/jalview/io/vcf/VCFLoader.java b/src/jalview/io/vcf/VCFLoader.java index 711b82a..3d269d8 100644 --- a/src/jalview/io/vcf/VCFLoader.java +++ b/src/jalview/io/vcf/VCFLoader.java @@ -437,13 +437,16 @@ public class VCFLoader /* * convert chromosomal location to sequence coordinates + * - may be reverse strand (convert to forward for sequence feature) * - null if a partially overlapping feature */ int[] seqLocation = mapping.locateInFrom(start, end); if (seqLocation != null) { - count += addAlleleFeatures(seq, variant, seqLocation[0], - seqLocation[1], forwardStrand); + int featureStart = Math.min(seqLocation[0], seqLocation[1]); + int featureEnd = Math.max(seqLocation[0], seqLocation[1]); + count += addAlleleFeatures(seq, variant, featureStart, featureEnd, + forwardStrand); } } -- 1.7.10.2