Package bgu.bio.algorithms.alignment

Source Code of bgu.bio.algorithms.alignment.DiagonalSequenceAlignmentTest

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);
  }

}
TOP

Related Classes of bgu.bio.algorithms.alignment.DiagonalSequenceAlignmentTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.