From: gmungoc Date: Thu, 21 Jan 2016 16:25:55 +0000 (+0000) Subject: JAL-1705 transfer features to the dataset sequence if there is one X-Git-Tag: Release_2_10_0~296^2~65 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=18df4d20bc29043b637efde27a91a17c8fc999ac;p=jalview.git JAL-1705 transfer features to the dataset sequence if there is one --- diff --git a/src/jalview/analysis/AlignmentUtils.java b/src/jalview/analysis/AlignmentUtils.java index d8cb9a2..194e6af 100644 --- a/src/jalview/analysis/AlignmentUtils.java +++ b/src/jalview/analysis/AlignmentUtils.java @@ -1424,6 +1424,12 @@ public class AlignmentUtils protected static void transferFeatures(SequenceI fromSeq, SequenceI toSeq, MapList mapping, String... omitting) { + SequenceI copyTo = toSeq; + while (copyTo.getDatasetSequence() != null) + { + copyTo = copyTo.getDatasetSequence(); + } + SequenceFeature[] sfs = fromSeq.getSequenceFeatures(); if (sfs != null) { @@ -1453,7 +1459,7 @@ public class AlignmentUtils SequenceFeature copy = new SequenceFeature(sf); copy.setBegin(Math.min(mappedTo[0], mappedTo[1])); copy.setEnd(Math.max(mappedTo[0], mappedTo[1])); - toSeq.addSequenceFeature(copy); + copyTo.addSequenceFeature(copy); } } }