import java.util.Map;
import java.util.TreeMap;
+import org.testng.Assert;
import org.testng.annotations.Test;
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<AlignedCodonFrame> cdsMappings = cds.getCodonFrames();
- assertEquals(2, cdsMappings.size());
-
+ List<AlignedCodonFrame> 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<AlignedCodonFrame> 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);