From: gmungoc Date: Tue, 9 May 2017 08:52:14 +0000 (+0100) Subject: JAL-2480 include sequenceFeatureStore in createDatasetSequence X-Git-Tag: Release_2_10_3b1~290 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=648b167d638390634aa7e1f58c2d1e4feca2d408;p=jalview.git JAL-2480 include sequenceFeatureStore in createDatasetSequence --- diff --git a/src/jalview/datamodel/Sequence.java b/src/jalview/datamodel/Sequence.java index ae7df53..af6592b 100755 --- a/src/jalview/datamodel/Sequence.java +++ b/src/jalview/datamodel/Sequence.java @@ -1185,6 +1185,8 @@ public class Sequence extends ASequence implements SequenceI // move features and database references onto dataset sequence dsseq.sequenceFeatures = sequenceFeatures; sequenceFeatures = null; + dsseq.sequenceFeatureStore = sequenceFeatureStore; + sequenceFeatureStore = null; dsseq.dbrefs = dbrefs; dbrefs = null; // TODO: search and replace any references to this sequence with diff --git a/test/jalview/datamodel/SequenceTest.java b/test/jalview/datamodel/SequenceTest.java index 4a208ae..586cc5d 100644 --- a/test/jalview/datamodel/SequenceTest.java +++ b/test/jalview/datamodel/SequenceTest.java @@ -38,6 +38,8 @@ import java.util.Arrays; import java.util.List; import java.util.Vector; +import junit.extensions.PA; + import org.testng.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.BeforeMethod; @@ -435,11 +437,26 @@ public class SequenceTest public void testCreateDatasetSequence() { SequenceI sq = new Sequence("my", "ASDASD"); + sq.addSequenceFeature(new SequenceFeature("type", "desc", 1, 10, 1f, + "group")); + sq.addDBRef(new DBRefEntry("source", "version", "accession")); assertNull(sq.getDatasetSequence()); + assertNotNull(PA.getValue(sq, "sequenceFeatures")); // to be removed! + assertNotNull(PA.getValue(sq, "sequenceFeatureStore")); + assertNotNull(PA.getValue(sq, "dbrefs")); + SequenceI rds = sq.createDatasetSequence(); assertNotNull(rds); assertNull(rds.getDatasetSequence()); - assertEquals(sq.getDatasetSequence(), rds); + assertSame(sq.getDatasetSequence(), rds); + + // sequence features and dbrefs transferred to dataset sequence + assertNull(PA.getValue(sq, "sequenceFeatures")); + assertNull(PA.getValue(sq, "sequenceFeatureStore")); + assertNull(PA.getValue(sq, "dbrefs")); + assertNotNull(PA.getValue(rds, "sequenceFeatures")); + assertNotNull(PA.getValue(rds, "sequenceFeatureStore")); + assertNotNull(PA.getValue(rds, "dbrefs")); } /**