From 6cedd15f7decf9a291f380f9bb57c939a1082aef Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 14 Jul 2016 14:53:33 +0100 Subject: [PATCH] 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 --- src/jalview/viewmodel/AlignmentViewport.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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; } -- 1.7.10.2