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