From dec3f30e62e66366d1f697157201c95b50a5e395 Mon Sep 17 00:00:00 2001 From: gmungoc Date: Wed, 31 May 2017 09:00:46 +0100 Subject: [PATCH] JAL-2547 handle contact features 'around' a gap correctly --- src/jalview/appletgui/SeqPanel.java | 7 +++++-- src/jalview/gui/SeqPanel.java | 7 +++++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/jalview/appletgui/SeqPanel.java b/src/jalview/appletgui/SeqPanel.java index f0ec51c..4aa205e 100644 --- a/src/jalview/appletgui/SeqPanel.java +++ b/src/jalview/appletgui/SeqPanel.java @@ -909,7 +909,9 @@ public class SeqPanel extends Panel implements MouseMotionListener, /** * Removes from the list of features any that start after, or end before, the * given column position. This allows us to retain only those features - * adjacent to a gapped position that straddle the position. + * adjacent to a gapped position that straddle the position. Contact features + * that 'straddle' the position are also removed, since they are not 'at' the + * position. * * @param features * @param column @@ -924,7 +926,8 @@ public class SeqPanel extends Panel implements MouseMotionListener, while (it.hasNext()) { SequenceFeature sf = it.next(); - if (sequence.findIndex(sf.getBegin()) > column + if (sf.isContactFeature() + || sequence.findIndex(sf.getBegin()) > column || sequence.findIndex(sf.getEnd()) < column) { it.remove(); diff --git a/src/jalview/gui/SeqPanel.java b/src/jalview/gui/SeqPanel.java index 6773611..ef9d8b3 100644 --- a/src/jalview/gui/SeqPanel.java +++ b/src/jalview/gui/SeqPanel.java @@ -804,7 +804,9 @@ public class SeqPanel extends JPanel implements MouseListener, /** * Removes from the list of features any that start after, or end before, the * given column position. This allows us to retain only those features - * adjacent to a gapped position that straddle the position. + * adjacent to a gapped position that straddle the position. Contact features + * that 'straddle' the position are also removed, since they are not 'at' the + * position. * * @param features * @param column @@ -819,7 +821,8 @@ public class SeqPanel extends JPanel implements MouseListener, while (it.hasNext()) { SequenceFeature sf = it.next(); - if (sequence.findIndex(sf.getBegin()) > column + if (sf.isContactFeature() + || sequence.findIndex(sf.getBegin()) > column || sequence.findIndex(sf.getEnd()) < column) { it.remove(); -- 1.7.10.2