Package bgu.bio.util

Examples of bgu.bio.util.ScoringMatrix


  @Test
  public void testSameSimilarity3() {
    final StemStructureAlphabet stemAlphabet = StemStructureAlphabet
        .getInstance();
    ScoringMatrix structureScoringMatrix = new ScoringMatrix(
        "matrix/Structure-sim-RIBOSUM85-60.matrix", stemAlphabet);

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
        structureScoringMatrix, new AffineGapGlobalSequenceAlignment(
            10, 10, RnaAlphabet.getInstance(),
            new AffineGapScoringMatrix(
                "matrix/NUC-Affine-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())));

    StemStructure str1 = new StemStructure(">1", new CharBuffer(
        "AGAGGUAAAAUGCAUCU"), new CharBuffer("((..(((...)))..))"));

    StemStructure str2 = new StemStructure(">1", new CharBuffer(
        "AGAGAAAAUAUCU"), new CharBuffer("((..(...)..))"));

    sim.setStem1(str1);
    sim.setStem2(str2);
    sim.run();
    double score = sim.getAlignmentScore();
    String[] alignment = sim.getAlignment();
    for (int i = 0; i < alignment[0].length(); i++) {
      System.out.print(" "
          + Arrays.toString(stemAlphabet.decodePair(alignment[0]
              .charAt(i))));
    }
    System.out.println();
    for (int i = 0; i < alignment[1].length(); i++) {
      System.out.print(" "
          + Arrays.toString(stemAlphabet.decodePair(alignment[1]
              .charAt(i))));
    }
    System.out.println();

    sim.setStem1(str1);
    sim.setStem2(str1);
    sim.run();
    double scoreSelf = sim.getAlignmentScore();
    double diff = scoreSelf - score;
    double expected = structureScoringMatrix.score(
        stemAlphabet.mapAndHash("U|G"), stemAlphabet.mapAndHash("U|G"))
        + structureScoringMatrix.score(stemAlphabet.mapAndHash("G|C"),
            stemAlphabet.mapAndHash("G|C"))
        - (structureScoringMatrix.score(stemAlphabet.mapAndHash("U|G"),
            stemAlphabet.emptyLetterHashed()) + structureScoringMatrix
            .score(stemAlphabet.mapAndHash("G|C"),
                stemAlphabet.emptyLetterHashed()));
    Assert.assertEquals(expected, diff, 0.01);
  }
View Full Code Here


  @Test
  public void testSimilarityWithDangling() {
    final StemStructureAlphabet stemAlphabet = StemStructureAlphabet
        .getInstance();
    ScoringMatrix structureScoringMatrix = new ScoringMatrix(
        "matrix/Structure-sim-RIBOSUM85-60.matrix", stemAlphabet);

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
        structureScoringMatrix, new AffineGapGlobalSequenceAlignment(
            10, 10, RnaAlphabet.getInstance(),
            new AffineGapScoringMatrix(
                "matrix/NUC-Affine-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())),
        new LocalSequenceAlignment(10, 10, RnaAlphabet.getInstance(),
            new ScoringMatrix("matrix/NUC-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())));

    StemStructure str1 = new StemStructure(">1", new CharBuffer(
        "AAAGAGGUAAAAUGCAUCUAA"), new CharBuffer(
        "..((..(((...)))..)).."));
View Full Code Here

  @Test
  public void testSimilarityWithDangling1() {
    final StemStructureAlphabet stemAlphabet = StemStructureAlphabet
        .getInstance();
    ScoringMatrix structureScoringMatrix = new ScoringMatrix(
        "matrix/Structure-sim-RIBOSUM85-60.matrix", stemAlphabet);

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
        structureScoringMatrix, new AffineGapGlobalSequenceAlignment(
            10, 10, RnaAlphabet.getInstance(),
            new AffineGapScoringMatrix(
                "matrix/NUC-Affine-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())),
        new LocalSequenceAlignment(10, 10, RnaAlphabet.getInstance(),
            new ScoringMatrix("matrix/NUC-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())));

    StemStructure str1 = new StemStructure(">1", new CharBuffer(
        "AGAGGUAAAAUGCAUCU"), new CharBuffer("((..(((...)))..))"));
View Full Code Here

  @Test
  public void testSimilarityWithDangling2() {
    final StemStructureAlphabet stemAlphabet = StemStructureAlphabet
        .getInstance();
    ScoringMatrix structureScoringMatrix = new ScoringMatrix(
        "matrix/Structure-sim-RIBOSUM85-60.matrix", stemAlphabet);

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
        structureScoringMatrix, new AffineGapGlobalSequenceAlignment(
            10, 10, RnaAlphabet.getInstance(),
            new AffineGapScoringMatrix(
                "matrix/NUC-Affine-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())),
        new LocalSequenceAlignment(10, 10, RnaAlphabet.getInstance(),
            new ScoringMatrix("matrix/NUC-sim-RIBOSUM85-60.matrix",
                RnaAlphabet.getInstance())));

    StemStructure str1 = new StemStructure(
        ">1",
        new CharBuffer(
View Full Code Here

TOP

Related Classes of bgu.bio.util.ScoringMatrix

Copyright © 2018 www.massapicom. 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.