|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.specrunner.util.aligner.core.NeedlemanWunschAligner
public class NeedlemanWunschAligner
Default alignment implementation, a Needleman-Wunsch algorithm.
| Field Summary | |
|---|---|
protected String |
expected
The expected value. |
protected StringBuilder |
expectedAligned
The expected value aligned. |
protected char |
fillCharacter
The character to be using on error report. |
protected String |
received
The received string. |
protected StringBuilder |
receivedAligned
The received value aligned. |
| Constructor Summary | |
|---|---|
NeedlemanWunschAligner(String expected,
String received)
Creates an aligner with default fill character. |
|
NeedlemanWunschAligner(String expected,
String received,
char fillCharacter)
Creates an aligner with both strings and fill character. |
|
| Method Summary | |
|---|---|
protected void |
align()
Perform alignment. |
protected List<Character> |
alphabet(String a,
String b)
Creates the local alphabet. |
protected int[][] |
calculate(String a,
String b,
List<Character> list,
int[][] s,
int d)
Calculate the matrix of gaps. |
String |
getExpected()
The expected string. |
StringBuilder |
getExpectedAligned()
The base string aligned. |
char |
getFillCharacter()
Fill character in alignment. |
String |
getReceived()
The received string. |
StringBuilder |
getReceivedAligned()
The received string aligned. |
protected int |
penalty(int size)
Calculate penalty. |
protected int[][] |
scoring(int size)
The scoring matrix. |
protected String |
toString(int[][] d)
String representation of a matrix. |
protected void |
traceback(String a,
String b,
List<Character> list,
int[][] s,
int d,
int[][] f)
Fill the alignment result. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected String expected
protected StringBuilder expectedAligned
protected char fillCharacter
protected String received
protected StringBuilder receivedAligned
| Constructor Detail |
|---|
public NeedlemanWunschAligner(String expected,
String received)
expected - The expected string.received - The received string.
public NeedlemanWunschAligner(String expected,
String received,
char fillCharacter)
expected - The expected string.received - The received string.fillCharacter - The fill character.| Method Detail |
|---|
public String getExpected()
IStringAligner
getExpected in interface IStringAlignerpublic StringBuilder getExpectedAligned()
IStringAligner
getExpectedAligned in interface IStringAlignerpublic char getFillCharacter()
IStringAligner
getFillCharacter in interface IStringAlignerpublic String getReceived()
IStringAligner
getReceived in interface IStringAlignerpublic StringBuilder getReceivedAligned()
IStringAligner
getReceivedAligned in interface IStringAlignerprotected void align()
protected List<Character> alphabet(String a,
String b)
a - Left string.b - Right string.
protected int[][] calculate(String a,
String b,
List<Character> list,
int[][] s,
int d)
a - The left string.b - The right string.list - The alphabet.s - The scoring matrix.d - The penalty.
protected int[][] scoring(int size)
size - The size.
protected int penalty(int size)
size - The size of alphabet.
protected void traceback(String a,
String b,
List<Character> list,
int[][] s,
int d,
int[][] f)
a - The left string.b - The right string.list - The alphabet.s - The scoring matrix.d - The penalty.f - The current proximity matrix.protected String toString(int[][] d)
d - The matrix.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||