|
NeoBio API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--neobio.alignment.ScoringScheme | +--neobio.alignment.BasicScoringScheme
This class implements a basic scoring scheme. At least three parameters must be provided to the constructor: the reward for a match (a substitution of equal characters), the penalty for a mismatch (a substitution of different characters) and the cost of a gap (an insertion or deletion of a character). Note that it only supports an additive gap cost function.
Although the match reward is expected to be a positive value, and the mismatch penalty and the gap cost are expected to be negative, no attempt is made to enforce these behaviour.
Field Summary | |
protected int |
gap_cost
The cost of a gap (an insertion or deletion of a character). |
protected int |
match_reward
The reward for a match (a substitution of equal characters). |
protected int |
max_absolute_score
The maximum absolute score that this scoring scheme can return, which is the maximum absolute value among match_reward ,
mismatch_penalty and gap_cost . |
protected int |
mismatch_penalty
The penalty for a mismatch (a substitution of different characters). |
Fields inherited from class neobio.alignment.ScoringScheme |
case_sensitive |
Constructor Summary | |
BasicScoringScheme(int match_reward,
int mismatch_penalty,
int gap_cost)
Creates a new instance of a basic scoring scheme with the specified values of match reward, mismatch penalty and gap cost. |
|
BasicScoringScheme(int match_reward,
int mismatch_penalty,
int gap_cost,
boolean case_sensitive)
Creates a new instance of basic scoring scheme with the specified values of match reward, mismatch penalty and gap cost. |
Method Summary | |
boolean |
isPartialMatchSupported()
Tells whether this scoring scheme supports partial matches, which it does not. |
int |
maxAbsoluteScore()
Returns the maximum absolute score that this scoring scheme can return for any substitution, deletion or insertion, which is the maximum absolute value among match_reward , mismatch_penalty and
gap_cost . |
int |
scoreDeletion(char a)
Always returns gap_cost for the deletion of any character. |
int |
scoreInsertion(char a)
Always returns gap_cost for the insertion of any character. |
int |
scoreSubstitution(char a,
char b)
Returns the score of a substitution of character a for character
b according to this scoring scheme. |
java.lang.String |
toString()
Returns a String representation of this scoring scheme. |
Methods inherited from class neobio.alignment.ScoringScheme |
isCaseSensitive |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected int match_reward
protected int mismatch_penalty
protected int gap_cost
protected int max_absolute_score
match_reward
,
mismatch_penalty
and gap_cost
.
Constructor Detail |
public BasicScoringScheme(int match_reward, int mismatch_penalty, int gap_cost)
match_reward
- reward for a substitution of equal charactersmismatch_penalty
- penalty for a substitution of different charactersgap_cost
- cost of an insertion or deletion of any characterpublic BasicScoringScheme(int match_reward, int mismatch_penalty, int gap_cost, boolean case_sensitive)
case_sensitive
is
true
, the case of characters is significant when subsequently
computing their score; otherwise the case is ignored.
match_reward
- reward for a substitution of equal charactersmismatch_penalty
- penalty for a substitution of different charactersgap_cost
- cost of an insertion or deletion of any charactercase_sensitive
- true
if the case of characters must be
significant, false
otherwiseMethod Detail |
public int scoreSubstitution(char a, char b)
a
for character
b
according to this scoring scheme. It is match_reward
if a
equals b
, mismatch_penalty
otherwise.
scoreSubstitution
in class ScoringScheme
a
- first characterb
- second character
match_reward
if a
equals b
,
mismatch_penalty
otherwise.public int scoreInsertion(char a)
gap_cost
for the insertion of any character.
scoreInsertion
in class ScoringScheme
a
- the character to be inserted
gap_cost
public int scoreDeletion(char a)
gap_cost
for the deletion of any character.
scoreDeletion
in class ScoringScheme
a
- the character to be deleted
gap_cost
public int maxAbsoluteScore()
match_reward
, mismatch_penalty
and
gap_cost
.
maxAbsoluteScore
in class ScoringScheme
match_reward
,
mismatch_penalty
and gap_cost
.public boolean isPartialMatchSupported()
isPartialMatchSupported
in class ScoringScheme
false
public java.lang.String toString()
toString
in class java.lang.Object
|
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |