* @param dna
* aligned dna sequences
* @param dataset
+ * - throws error if not given a dataset
* @return an alignment whose sequences are the cds-only parts of the dna
* sequences (or null if no mappings are found)
*/
public static AlignmentI makeCdsAlignment(SequenceI[] dna,
AlignmentI dataset)
{
+ if (dataset.getDataset() != null)
+ {
+ throw new Error(
+ "IMPLEMENTATION ERROR: dataset.getDataset() must be null!");
+ }
List<SequenceI> cdsSeqs = new ArrayList<SequenceI>();
List<AlignedCodonFrame> mappings = dataset.getCodonFrames();
+
/*
* construct CDS sequences from the (cds-to-protein) mappings made earlier;
* this makes it possible to model multiple products from dna (e.g. EMBL);
* execute method under test:
*/
AlignmentI cds = AlignmentUtils.makeCdsAlignment(new SequenceI[] {
- dna1, dna2 }, dna);
+ dna1, dna2 }, dna.getDataset());
assertEquals(2, cds.getSequences().size());
assertEquals("GGGTTT", cds.getSequenceAt(0)