X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fio%2FSequenceAnnotationReport.java;h=a4c489572e885a216e8e9308af3c53392fffaee1;hb=ae91bd2b6c74d4b6267d0df5670db7207707130b;hp=8328e7ab45b64ffa6f5f1efeafd30d52ad203a09;hpb=5a631296dd1dcc1df7b50487a647c27333696c74;p=jalview.git diff --git a/src/jalview/io/SequenceAnnotationReport.java b/src/jalview/io/SequenceAnnotationReport.java index 8328e7a..a4c4895 100644 --- a/src/jalview/io/SequenceAnnotationReport.java +++ b/src/jalview/io/SequenceAnnotationReport.java @@ -210,12 +210,32 @@ public class SequenceAnnotationReport * if this is a virtual features, convert begin/end to the * coordinates of the sequence it is mapped to */ - int[] beginRange = null; - int[] endRange = null; + int[] beginRange = null; // feature start in local coordinates + int[] endRange = null; // feature end in local coordinates if (mf != null) { - beginRange = mf.getMappedPositions(begin, begin); - endRange = mf.getMappedPositions(end, end); + if (feature.isContactFeature()) + { + /* + * map start and end points individually + */ + beginRange = mf.getMappedPositions(begin, begin); + endRange = begin == end ? beginRange + : mf.getMappedPositions(end, end); + } + else + { + /* + * map the feature extent + */ + beginRange = mf.getMappedPositions(begin, end); + endRange = beginRange; + } + if (beginRange == null || endRange == null) + { + // something went wrong + return false; + } begin = beginRange[0]; end = endRange[endRange.length - 1]; }