From 73fd64da56448bcb2a7771cc174d9d9c62da87ad Mon Sep 17 00:00:00 2001 From: gmungoc Date: Tue, 27 Sep 2016 10:04:50 +0100 Subject: [PATCH] JAL-2230 JAL-2049 added sequence feature transfer to testMakeCdsAlignment --- test/jalview/analysis/AlignmentUtilsTests.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index ddd38e7..b4628b8 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -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); } /** -- 1.7.10.2