From 7370d1738f28c093f2f08db5730193fae6c72939 Mon Sep 17 00:00:00 2001 From: Jim Procter Date: Thu, 16 Jun 2016 13:50:16 +0100 Subject: [PATCH] JAL-2110 change test for desired behaviour of getCodonFrame() --- test/jalview/analysis/AlignmentUtilsTests.java | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/test/jalview/analysis/AlignmentUtilsTests.java b/test/jalview/analysis/AlignmentUtilsTests.java index 2d1f6ff..afa6edb 100644 --- a/test/jalview/analysis/AlignmentUtilsTests.java +++ b/test/jalview/analysis/AlignmentUtilsTests.java @@ -53,6 +53,7 @@ import java.util.List; import java.util.Map; import java.util.TreeMap; +import org.testng.Assert; import org.testng.annotations.Test; public class AlignmentUtilsTests @@ -1028,19 +1029,27 @@ public class AlignmentUtilsTests .contains(cds.getSequenceAt(1).getDatasetSequence())); /* - * Verify mappings from CDS to peptide and cDNA to CDS + * Verify mappings from CDS to peptide, cDNA to CDS, and cDNA to peptide * the mappings are on the shared alignment dataset */ - assertSame(dna.getCodonFrames(), cds.getCodonFrames()); - List cdsMappings = cds.getCodonFrames(); - assertEquals(2, cdsMappings.size()); - + List cdsMappings = cds.getDataset().getCodonFrames(); + /* + * 6 mappings, 2*(DNA->CDS), 2*(DNA->Pep), 2*(CDS->Pep) + */ + assertEquals(6, cdsMappings.size()); + /* + * verify that mapping sets for dna and cds alignments are different + */ + Assert.assertNotSame(dna.getCodonFrames(), cds.getCodonFrames()); + assertEquals(4, dna.getCodonFrames()); + assertEquals(4, cds.getCodonFrames()); /* * Mapping from pep1 to GGGTTT in first new exon sequence */ List pep1Mapping = MappingUtils - .findMappingsForSequence(pep1, cdsMappings); - assertEquals(1, pep1Mapping.size()); + .findMappingsForSequence(pep1, cds.getCodonFrames()); + assertEquals(1, pep1Mapping.size()); // CDS->Pep + // map G to GGG SearchResults sr = MappingUtils .buildSearchResults(pep1, 1, cdsMappings); -- 1.7.10.2