From: Jim Procter Date: Thu, 14 Jul 2016 13:53:33 +0000 (+0100) Subject: fix for JAL-2147 X-Git-Tag: Release_2_10_0~140^2 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=6cedd15f7decf9a291f380f9bb57c939a1082aef;p=jalview.git fix for JAL-2147 - scope search for codonmappings to local alignment - efficiency - use discovered mappings directly rather than letting highlight search results do the work again --- diff --git a/src/jalview/viewmodel/AlignmentViewport.java b/src/jalview/viewmodel/AlignmentViewport.java index eab4aa5..d3df56c 100644 --- a/src/jalview/viewmodel/AlignmentViewport.java +++ b/src/jalview/viewmodel/AlignmentViewport.java @@ -2700,6 +2700,7 @@ public abstract class AlignmentViewport implements AlignViewportI, * all gapped visible regions */ int lastSeq = alignment.getHeight() - 1; + List seqMappings = null; for (int seqNo = getStartSeq(); seqNo < lastSeq; seqNo++, seqOffset++) { sequence = getAlignment().getSequenceAt(seqNo); @@ -2711,15 +2712,16 @@ public abstract class AlignmentViewport implements AlignViewportI, { continue; } - List seqMappings = MappingUtils - .findMappingsForSequence(sequence, mappings); + seqMappings = MappingUtils + .findMappingsForSequenceAndOthers(sequence, mappings, + getCodingComplement().getAlignment()); if (!seqMappings.isEmpty()) { break; } } - if (sequence == null) + if (sequence == null || seqMappings == null || seqMappings.isEmpty()) { /* * No ungapped mapped sequence in middle column - do nothing @@ -2727,7 +2729,7 @@ public abstract class AlignmentViewport implements AlignViewportI, return 0; } MappingUtils.addSearchResults(sr, sequence, - sequence.findPosition(middleColumn), mappings); + sequence.findPosition(middleColumn), seqMappings); return seqOffset; }