/**
* Test normal case for iterating over aligned codons.
*/
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testNext()
{
SequenceI from = new Sequence("Seq1", "-CgC-C-cCtAG-AtG-Gc");
from.createDatasetSequence();
SequenceI to = new Sequence("Seq1", "-PQ-R-");
to.createDatasetSequence();
- MapList map = new MapList(new int[]
- { 1, 1, 3, 4, 6, 6, 8, 10, 12, 13 }, new int[]
- { 1, 3 }, 3, 1);
+ MapList map = new MapList(
+ new int[] { 1, 1, 3, 4, 6, 6, 8, 10, 12, 13 },
+ new int[] { 1, 3 }, 3, 1);
Mapping m = new Mapping(to.getDatasetSequence(), map);
Iterator<AlignedCodon> codons = m.getCodonIterator(from, '-');
/**
* Test weird case where the mapping skips over a peptide.
*/
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testNext_unmappedPeptide()
{
SequenceI from = new Sequence("Seq1", "-CgC-C-cCtAG-AtG-Gc");
from.createDatasetSequence();
SequenceI to = new Sequence("Seq1", "-PQ-TR-");
to.createDatasetSequence();
- MapList map = new MapList(new int[]
- { 1, 1, 3, 4, 6, 6, 8, 10, 12, 13 }, new int[]
- { 1, 2, 4, 4 }, 3, 1);
+ MapList map = new MapList(
+ new int[] { 1, 1, 3, 4, 6, 6, 8, 10, 12, 13 }, new int[] { 1,
+ 2, 4, 4 }, 3, 1);
Mapping m = new Mapping(to.getDatasetSequence(), map);
Iterator<AlignedCodon> codons = m.getCodonIterator(from, '-');
assertEquals("R", codon.product);
assertFalse(codons.hasNext());
}
-
+
/**
* Test for exception thrown for an incomplete codon.
*/
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testNext_incompleteCodon()
{
SequenceI from = new Sequence("Seq1", "-CgC-C-cCgTt");
from.createDatasetSequence();
SequenceI to = new Sequence("Seq1", "-PQ-R-");
to.createDatasetSequence();
- MapList map = new MapList(new int[]
- { 1, 1, 3, 4, 6, 6, 8, 8 }, new int[]
- { 1, 3 }, 3, 1);
+ MapList map = new MapList(new int[] { 1, 1, 3, 4, 6, 6, 8, 8 },
+ new int[] { 1, 3 }, 3, 1);
Mapping m = new Mapping(to.getDatasetSequence(), map);
Iterator<AlignedCodon> codons = m.getCodonIterator(from, '-');
/**
* Test normal case for iterating over aligned codons.
*/
- @Test(groups ={ "Functional" })
+ @Test(groups = { "Functional" })
public void testAnother()
{
SequenceI from = new Sequence("Seq1", "TGCCATTACCAG-");
from.createDatasetSequence();
SequenceI to = new Sequence("Seq1", "CHYQ");
to.createDatasetSequence();
- MapList map = new MapList(new int[]
- { 1, 12 }, new int[]
- { 1, 4 }, 3, 1);
+ MapList map = new MapList(new int[] { 1, 12 }, new int[] { 1, 4 }, 3, 1);
Mapping m = new Mapping(to.getDatasetSequence(), map);
-
+
Iterator<AlignedCodon> codons = m.getCodonIterator(from, '-');
AlignedCodon codon = codons.next();
assertEquals("[0, 1, 2]", codon.toString());