Package bgu.bio.util.alphabet

Examples of bgu.bio.util.alphabet.AlphabetUtils


    Assert.assertEquals(-3.0, affine.getAlignmentScore(), 0.001);
  }

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

    Random rand = new Random();
    final int size = 200;
    final int repeats = 1000;
    char[] seq1 = new char[size];
    char[] seq2 = new char[size];
    for (int i = 0; i < repeats; i++) {

      alphabet.randomSequence(seq1, size, rand);
      alphabet.randomSequence(seq2, size, rand);

      alignMat.setSequences(new String(seq1), new String(seq2));
      alignNoMat.setSequences(seq1, seq2);

      alignMat.buildMatrix();
View Full Code Here


public class TestAffineGapWithAndWithoutMatrix {

  @Test
  public void randomTest() {
    AlphabetUtils alphabet = RnaAlphabet.getInstance();
    AffineGapScoringMatrix matrix = new IdentityAffineScoringMatrix(
        alphabet, 1, -10f, -1f, 0f);

    AffineGapGlobalSequenceAlignment alignMat = new AffineGapGlobalSequenceAlignment(
        0, 0, alphabet, matrix);
    AffineGapGlobalSequenceAlignmentNoMatrix alignNoMat = new AffineGapGlobalSequenceAlignmentNoMatrix(
        0, 0, alphabet, matrix);

    Random rand = new Random();
    final int size = 200;
    final int repeats = 12000;
    char[] seq1 = new char[size];
    char[] seq2 = new char[size / 2];
    for (int i = 0; i < repeats; i++) {

      alphabet.randomSequence(seq1, size, rand);
      alphabet.randomSequence(seq2, size / 2, rand);

      alignMat.setSequences(new String(seq1), new String(seq2));
      alignNoMat.setSequences(seq1, seq2);

      alignMat.buildMatrix();
View Full Code Here

  @Test
  public void test1() {
    String str1 = "CNCNANGUNC";
    String str2 = "UNUUG";

    AlphabetUtils alphabet = RnaAlphabet.getInstance();
    AffineGapScoringMatrix matrix = new IdentityAffineScoringMatrix(
        alphabet, 1, -10f, -0.5f, 0f);

    AffineGapGlobalSequenceAlignment alignMat = new AffineGapGlobalSequenceAlignment(
        0, 0, alphabet, matrix);
View Full Code Here

  @Test
  public void test2() {
    String str1 = "CNCNANGUNC";
    String str2 = "CNCNANGUNCAAAAAA";

    AlphabetUtils alphabet = RnaAlphabet.getInstance();
    AffineGapScoringMatrix matrix = new IdentityAffineScoringMatrix(
        alphabet, 1, -10f, -0.5f, 0f);

    AffineGapGlobalSequenceAlignment alignMat = new AffineGapGlobalSequenceAlignment(
        0, 0, alphabet, matrix);
View Full Code Here

TOP

Related Classes of bgu.bio.util.alphabet.AlphabetUtils

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.