From: Jim Procter Date: Wed, 16 Sep 2020 16:43:18 +0000 (+0100) Subject: JAL-3748 make findAlignedSequence require mapped from/to to properly contain the... X-Git-Tag: Release_2_11_1_3~5^2~29 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=689f9cf4bdb57417fcb93db5b7cf5d9cf8154e3f;p=jalview.git JAL-3748 make findAlignedSequence require mapped from/to to properly contain the given CDS or protein sequence --- diff --git a/src/jalview/datamodel/AlignedCodonFrame.java b/src/jalview/datamodel/AlignedCodonFrame.java index d1b12d3..c3d17dc 100644 --- a/src/jalview/datamodel/AlignedCodonFrame.java +++ b/src/jalview/datamodel/AlignedCodonFrame.java @@ -474,7 +474,9 @@ public class AlignedCodonFrame */ for (SequenceToSequenceMapping ssm : mappings) { - if (ssm.fromSeq == seq || ssm.fromSeq == seq.getDatasetSequence()) + int mStart=ssm.getMapping().getMap().getFromLowest(),mEnd=ssm.getMapping().map.getFromHighest(); + if ((ssm.fromSeq == seq || ssm.fromSeq == seq.getDatasetSequence()) + && seq.getStart()>=mStart && seq.getEnd()<=mEnd) { for (SequenceI sourceAligned : al.getSequences()) { @@ -495,8 +497,10 @@ public class AlignedCodonFrame */ for (SequenceToSequenceMapping ssm : mappings) { - if (ssm.mapping.to == seq + int mStart=ssm.getMapping().getMap().getToLowest(),mEnd=ssm.getMapping().map.getToHighest(); + if ((ssm.mapping.to == seq || ssm.mapping.to == seq.getDatasetSequence()) + && seq.getStart()>=mStart && seq.getEnd()<=mEnd) { for (SequenceI sourceAligned : al.getSequences()) {