package bgu.bio.algorithms.alignment;
import static org.junit.Assert.*;
import org.junit.Test;
import bgu.bio.util.IdentityScoringMatrix;
import bgu.bio.util.alphabet.RnaAlphabet;
public class DiagonalSequenceAlignmentTest {
@Test
public void testSmallScore() {
DiagonalSequenceAlignmentNoMatrix dsanm = new DiagonalSequenceAlignmentNoMatrix(
"AGCGCGUU", "GUCAGACG", RnaAlphabet.getInstance(),
new IdentityScoringMatrix(RnaAlphabet.getInstance()), 24, 2);
dsanm.buildMatrix();
assertEquals(5.0, dsanm.getMaxScore(), 0);
}
@Test
public void testSmallMatrices() {
DiagonalSequenceAlignmentNoMatrix dsanm = new DiagonalSequenceAlignmentNoMatrix(
"AGCGCGUU", "GUCAGACG", RnaAlphabet.getInstance(),
new IdentityScoringMatrix(RnaAlphabet.getInstance()), 24, 2);
dsanm.buildMatrix();
GlobalSequenceAlignment gsa = new GlobalSequenceAlignment("AGCGCGUU",
"GUCAGACG", RnaAlphabet.getInstance(),
new IdentityScoringMatrix(RnaAlphabet.getInstance()));
gsa.buildMatrix();
assertEquals(gsa.getAlignmentScore(), dsanm.getMaxScore(), 0);
}
@Test
public void testLargeScore() {
GlobalSequenceAlignment dsanm = new GlobalSequenceAlignment(
"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGCTTCTGAACTGGTTACCTGCCGTGAGTAAATTAAAATTTTATTGACTTAGGTCACTAAATACTTTAACCAATATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCATCACCATTACCACAGGTAACGGTGCGGGCTGACGCGTACAGGAAACACAGAAAAAAGCCCGCACCTGACAGTGCGGGCTTTTTTTTCGACCAAAGGTAACGAGGTAACAACCATGCGAGTGTTGAAGTTCGGCGGTACATCAGTGGCAAATGCAGAACGTTTTCTGCGGGTTGCCGATATTCTGGAAAGCAATGCCAGGCAGGGGCAGGTGGCCACCGTCCTCTCTGCCCCCGCCAAAATCACCAACCACCTGGTGGCGATGATTGAAAAAACCATTAGCGGCCAGGATGCTTTACCCAATATCAGCGATGCCGAACGTATTTTTGCCGAACTTCTGACGGGACTCACCGCCGCCCAGCCGGGATTCCCGCTGGCGCAACTGAAAACTTTCGTCGACCAGGAATTTG",
"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGCTTCTGAACTGGTTACCTGCCGTGAGTAAATTAAAATTTTATTGACTTAGGTCACTAAATACTTTAACCAATATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCATCACCATTACCACAGGTAACGGTGCGGGCTGACGCGTACAGGAAACACAGAAAAAAGCCCGCACCTGACAGTGCGGGCTTTTTTTTTCGACCAAAGGTAACGAGGTAACAACCATGCGAGTGTTGAAGTTCGGCGGTACATCAGTGGCAAATGCAGAACGTTTTCTGCGTGTTGCCGATATTCTGGAAAGCAATGCCAGGCAGGGGCAGGTGGCCACCGTCCTCTCTGCCCCCGCCAAAATCACCAACCACCTGGTGGCGATGATTGAAAAAACCATTAGCGGCCAGGATGCTTTACCCAATATCAGCGATGCCGAACGTATTTTTGCCGAACTTTTGACGGGACTCGCCGCCGCCCAGCCGGGGTTCCCGCTGGCGCAATTGAAAACTTTCGTCGATCAGGAATTT",
RnaAlphabet.getInstance(), new IdentityScoringMatrix(
RnaAlphabet.getInstance()));
dsanm.buildMatrix();
assertEquals(623.0, dsanm.getAlignmentScore(), 0);
}
@Test
public void testLargeScoreDiagonalNoMatrix() {
DiagonalSequenceAlignmentNoMatrix dsanm = new DiagonalSequenceAlignmentNoMatrix(
"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGCTTCTGAACTGGTTACCTGCCGTGAGTAAATTAAAATTTTATTGACTTAGGTCACTAAATACTTTAACCAATATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCATCACCATTACCACAGGTAACGGTGCGGGCTGACGCGTACAGGAAACACAGAAAAAAGCCCGCACCTGACAGTGCGGGCTTTTTTTTCGACCAAAGGTAACGAGGTAACAACCATGCGAGTGTTGAAGTTCGGCGGTACATCAGTGGCAAATGCAGAACGTTTTCTGCGGGTTGCCGATATTCTGGAAAGCAATGCCAGGCAGGGGCAGGTGGCCACCGTCCTCTCTGCCCCCGCCAAAATCACCAACCACCTGGTGGCGATGATTGAAAAAACCATTAGCGGCCAGGATGCTTTACCCAATATCAGCGATGCCGAACGTATTTTTGCCGAACTTCTGACGGGACTCACCGCCGCCCAGCCGGGATTCCCGCTGGCGCAACTGAAAACTTTCGTCGACCAGGAATTTG",
"AGCTTTTCATTCTGACTGCAACGGGCAATATGTCTCTGTGTGGATTAAAAAAAGAGTGTCTGATAGCAGCTTCTGAACTGGTTACCTGCCGTGAGTAAATTAAAATTTTATTGACTTAGGTCACTAAATACTTTAACCAATATAGGCATAGCGCACAGACAGATAAAAATTACAGAGTACACAACATCCATGAAACGCATTAGCACCACCATTACCACCACCATCACCATTACCACAGGTAACGGTGCGGGCTGACGCGTACAGGAAACACAGAAAAAAGCCCGCACCTGACAGTGCGGGCTTTTTTTTTCGACCAAAGGTAACGAGGTAACAACCATGCGAGTGTTGAAGTTCGGCGGTACATCAGTGGCAAATGCAGAACGTTTTCTGCGTGTTGCCGATATTCTGGAAAGCAATGCCAGGCAGGGGCAGGTGGCCACCGTCCTCTCTGCCCCCGCCAAAATCACCAACCACCTGGTGGCGATGATTGAAAAAACCATTAGCGGCCAGGATGCTTTACCCAATATCAGCGATGCCGAACGTATTTTTGCCGAACTTTTGACGGGACTCGCCGCCGCCCAGCCGGGGTTCCCGCTGGCGCAATTGAAAACTTTCGTCGATCAGGAATTT",
RnaAlphabet.getInstance(), new IdentityScoringMatrix(
RnaAlphabet.getInstance()), 24, 100);
dsanm.buildMatrix();
assertEquals(623.0, dsanm.getMaxScore(), 0);
}
}