Package bgu.bio.util

Examples of bgu.bio.util.ScoringMatrix


  }

  @Test
  public void randomTest() {
    AlphabetUtils alphabet = RnaAlphabet.getInstance();
    ScoringMatrix matrix = new IdentityScoringMatrix(alphabet);

    GlobalSequenceAlignment alignMat = new GlobalSequenceAlignment(0, 0,
        alphabet, matrix);
    GlobalSequenceAlignmentNoMatrix alignNoMat = new GlobalSequenceAlignmentNoMatrix(
        0, 0, alphabet, matrix);
View Full Code Here


            "matrix" + File.separator
                + "interval-RIBOSUM85-60.matrix",
            RnaAlphabet.getInstance()));

    RnaSpecificCostFunction cost = new RnaSpecificCostFunction(
        new ScoringMatrix("matrix" + File.separator
            + "bp-RIBOSUM85-60.matrix",
            RNABasePairAlphabet.getInstance()), aligner);

    final RNASpecificTree t = new RNASpecificTree("T");
    t.buildFromViennaFormat(
View Full Code Here

            "matrix" + File.separator
                + "interval-RIBOSUM85-60.matrix",
            RnaAlphabet.getInstance()));

    RnaSpecificCostFunction cost = new RnaSpecificCostFunction(
        new ScoringMatrix("matrix" + File.separator
            + "bp-RIBOSUM85-60.matrix",
            RNABasePairAlphabet.getInstance()), aligner);

    RNASpecificTree t = new RNASpecificTree();
    // t.buildFromViennaFormat("GAGCCGUAUGCGAUGAAAGUCGCACGUACGGUUC".toCharArray(),
View Full Code Here

public class TestAffineGapStemSimilarity {

  @Test
  public void testSameSimilarity() {
    GlobalStemSimilarity simGlobal = new GlobalStemSimilarity(
        new ScoringMatrix("matrix/tests/STEMS-test2.matrix",
            StemStructureAlphabet.getInstance()),
        new GlobalSequenceAlignment(10, 10, RnaAlphabet.getInstance(),
            new IdentityScoringMatrix(RnaAlphabet.getInstance())));

    AffineGapStemSimilarity simAffine = new AffineGapStemSimilarity(
View Full Code Here

            "matrix" + File.separator
                + "interval-RIBOSUM85-60.matrix",
            RnaAlphabet.getInstance()));

    RnaSpecificCostFunction cost = new RnaSpecificCostFunction(
        new ScoringMatrix("matrix" + File.separator
            + "bp-RIBOSUM85-60.matrix",
            RNABasePairAlphabet.getInstance()), aligner);

    final RNASpecificTree t = new RNASpecificTree("T");
    t.buildFromViennaFormat(
View Full Code Here

            "matrix" + File.separator
                + "interval-RIBOSUM85-60.matrix",
            RnaAlphabet.getInstance()));

    RnaSpecificCostFunction cost = new RnaSpecificCostFunction(
        new ScoringMatrix("matrix" + File.separator
            + "bp-RIBOSUM85-60.matrix",
            RNABasePairAlphabet.getInstance()), aligner);

    final RNASpecificTree t = new RNASpecificTree("T");
    t.buildFromViennaFormat(
View Full Code Here

            "matrix" + File.separator
                + "interval-RIBOSUM85-60.matrix",
            RnaAlphabet.getInstance()));

    RnaSpecificCostFunction cost = new RnaSpecificCostFunction(
        new ScoringMatrix("matrix" + File.separator
            + "bp-RIBOSUM85-60.matrix",
            RNABasePairAlphabet.getInstance()), aligner);

    final RNASpecificTree t = new RNASpecificTree("T");
    /*t.buildFromViennaFormat(
 
View Full Code Here

            "matrix" + File.separator
                + "interval-RIBOSUM85-60.matrix",
            RnaAlphabet.getInstance()));

    RnaSpecificCostFunction cost = new RnaSpecificCostFunction(
        new ScoringMatrix("matrix" + File.separator
            + "bp-RIBOSUM85-60.matrix",
            RNABasePairAlphabet.getInstance()), aligner);

    RNASpecificTree t = new RNASpecificTree();
    // t.buildFromViennaFormat("GAGCCGUAUGCGAUGAAAGUCGCACGUACGGUUC".toCharArray(),
View Full Code Here

public class TestGlobalStemSimilarity {

  @Test
  public void testSameSimilarity() {
    GlobalStemSimilarity sim = new GlobalStemSimilarity(new ScoringMatrix(
        "matrix/tests/STEMS-test2.matrix",
        StemStructureAlphabet.getInstance()),
        new GlobalSequenceAlignment(10, 10, RnaAlphabet.getInstance(),
            new IdentityScoringMatrix(RnaAlphabet.getInstance())));
View Full Code Here

  @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

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.