public class NeedlemanWunschAligner extends Object implements IStringAligner
| Modifier and Type | Field and Description |
|---|---|
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 and Description |
|---|
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.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
protected String expected
protected StringBuilder expectedAligned
protected char fillCharacter
protected String received
protected StringBuilder receivedAligned
public NeedlemanWunschAligner(String expected, String received)
expected - The expected string.received - The received string.public String getExpected()
IStringAlignergetExpected in interface IStringAlignerpublic StringBuilder getExpectedAligned()
IStringAlignergetExpectedAligned in interface IStringAlignerpublic char getFillCharacter()
IStringAlignergetFillCharacter in interface IStringAlignerpublic String getReceived()
IStringAlignergetReceived in interface IStringAlignerpublic StringBuilder getReceivedAligned()
IStringAlignergetReceivedAligned 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.Copyright © 2016. All rights reserved.