Skip to content

Commit 2781293

Browse files
author
aegugup
committed
Test local, linear scheme alignment
1 parent 8a64963 commit 2781293

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

biojava-alignment/src/test/java/org/biojava/nbio/alignment/TestDNAAlignment.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,4 +165,16 @@ public void testLinearAlignment() throws CompoundNotFoundException {
165165
PairwiseSequenceAligner<DNASequence, NucleotideCompound> aligner = Alignments.getPairwiseAligner(query, target, PairwiseSequenceAlignerType.GLOBAL, gapP, matrix);
166166
Assert.assertEquals(String.format("GTAAAA-G----------%nG-AAAACGTTTTTTTTTT%n"), aligner.getPair().toString());;
167167
}
168+
/**
169+
* @author aegugup
170+
*/
171+
@Test
172+
public void testLinearAlignmentLocal() throws CompoundNotFoundException {
173+
DNASequence query = new DNASequence("TGTTACGG", DNACompoundSet.getDNACompoundSet());
174+
DNASequence target = new DNASequence("GGTTGACTA", DNACompoundSet.getDNACompoundSet());
175+
SubstitutionMatrix<NucleotideCompound> matrix = SubstitutionMatrixHelper.getNuc4_4();
176+
SimpleGapPenalty gapP = new SimpleGapPenalty((short)0, (short)8);
177+
PairwiseSequenceAligner<DNASequence, NucleotideCompound> aligner = Alignments.getPairwiseAligner(query, target, PairwiseSequenceAlignerType.LOCAL, gapP, matrix);
178+
Assert.assertEquals(String.format("GTT-AC%nGTTGAC%n"), aligner.getPair().toString());;
179+
}
168180
}

0 commit comments

Comments
 (0)