JAL-2230 JAL-2049 added sequence feature transfer to
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 27 Sep 2016 09:04:50 +0000 (10:04 +0100)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Tue, 27 Sep 2016 09:04:50 +0000 (10:04 +0100)
testMakeCdsAlignment

test/jalview/analysis/AlignmentUtilsTests.java

index ddd38e7..b4628b8 100644 (file)
@@ -977,7 +977,7 @@ public class AlignmentUtilsTests
     /*
      * scenario:
      *     dna1 --> [4, 6] [10,12]        --> pep1 
-     *     dna2 --> [1, 3] [7, 9] [13,15] --> pep1 
+     *     dna2 --> [1, 3] [7, 9] [13,15] --> pep2
      */
     SequenceI dna1 = new Sequence("dna1", "aaaGGGcccTTTaaa");
     SequenceI dna2 = new Sequence("dna2", "GGGcccTTTaaaCCC");
@@ -993,6 +993,13 @@ public class AlignmentUtilsTests
     dna.setDataset(null);
 
     /*
+     * put a variant feature on dna2 base 8
+     * - should transfer to cds2 base 5
+     */
+    dna2.addSequenceFeature(new SequenceFeature("variant", "hgmd", 8, 8,
+            0f, null));
+
+    /*
      * need a sourceDbRef if we are to construct dbrefs to the CDS
      * sequence from the dna contig sequences
      */
@@ -1154,6 +1161,16 @@ public class AlignmentUtilsTests
     assertSame(cds2Dss, m.getSequence());
     assertEquals(7, m.getStart());
     assertEquals(9, m.getEnd());
+
+    /*
+     * check cds2 acquired a variant feature in position 5
+     */
+    SequenceFeature[] sfs = cds2Dss.getSequenceFeatures();
+    assertNotNull(sfs);
+    assertEquals(1, sfs.length);
+    assertEquals("variant", sfs[0].type);
+    assertEquals(5, sfs[0].begin);
+    assertEquals(5, sfs[0].end);
   }
 
   /**