From: gmungoc Date: Mon, 9 Oct 2017 10:55:55 +0000 (+0100) Subject: JAL-2738 ensure variant feature is in forward sense X-Git-Tag: Release_2_11_0~198 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=82c158fd0d30fc1d1e46c164df7bf4932b522df5;p=jalview.git JAL-2738 ensure variant feature is in forward sense --- 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); } }