Examples of StemStructureAlphabet


Examples of bgu.bio.util.alphabet.StemStructureAlphabet

    System.out.println(score);
  }

  @Test
  public void testSameSimilarity2() {
    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(
        "AGAGGUAAAAUGCAUUU"), new CharBuffer("((..(((...)))..))"));

    sim.setStem1(str1);
    sim.setStem2(str2);
    sim.run();
    sim.buildMatrix();
    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("G|C"), stemAlphabet.mapAndHash("G|C"))
        - structureScoringMatrix.score(stemAlphabet.mapAndHash("G|C"),
            stemAlphabet.mapAndHash("G|U"));
    Assert.assertEquals(expected, diff, 0.01);
  }
View Full Code Here

Examples of bgu.bio.util.alphabet.StemStructureAlphabet

    Assert.assertEquals(expected, diff, 0.01);
  }

  @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

Examples of bgu.bio.util.alphabet.StemStructureAlphabet

    Assert.assertEquals(expected, diff, 0.01);
  }

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

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
View Full Code Here

Examples of bgu.bio.util.alphabet.StemStructureAlphabet

    Assert.assertEquals("Score should be the same", score1, score2, 0.0001);
  }

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

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
View Full Code Here

Examples of bgu.bio.util.alphabet.StemStructureAlphabet

    Assert.assertEquals("Score should be the same", score1, score2, 0.0001);
  }

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

    GlobalStemSimilarity sim = new GlobalStemSimilarity(
View Full Code Here
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.