public class BasicScoringScheme extends ScoringScheme
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.
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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. |
String |
toString()
Returns a String representation of this scoring scheme.
|
isCaseSensitive
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
otherwisepublic 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 charactermatch_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 insertedgap_cost
public int scoreDeletion(char a)
gap_cost
for the deletion of any character.scoreDeletion
in class ScoringScheme
a
- the character to be deletedgap_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
Copyright © 2018. All rights reserved.