jebl.evolution.align.scores
Class Scores

java.lang.Object
  extended by jebl.evolution.align.scores.Scores
All Implemented Interfaces:
ScoreMatrix
Direct Known Subclasses:
AminoAcidScores, NucleotideScores, SubstScoreMatrix

public abstract class Scores
extends Object
implements ScoreMatrix

Base class for all score matrices in the package.

Author:
Alexei Drummond

Field Summary
 float[][] score
           
 
Constructor Summary
Scores()
           
 
Method Summary
protected  void buildScores(float[][] scores)
           
static Scores duplicate(Scores scores)
           
protected  String getExtraResidues()
           
 float getScore(char x, char y)
           
static Scores includeAdditionalCharacters(Scores scores, String characters)
          includes additional characters in the score matrix which will all have scored zero when compared to other characters.
static Scores includeGaps(Scores scores, float gapVersusResidueCost, float gapVersusGapCost)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface jebl.evolution.align.scores.ScoreMatrix
getAlphabet, getName
 

Field Detail

score

public float[][] score
Constructor Detail

Scores

public Scores()
Method Detail

buildScores

protected void buildScores(float[][] scores)

getScore

public final float getScore(char x,
                            char y)
Specified by:
getScore in interface ScoreMatrix
Returns:
the score for matching char x with char y

toString

public String toString()
Overrides:
toString in class Object

duplicate

public static Scores duplicate(Scores scores)

includeGaps

public static Scores includeGaps(Scores scores,
                                 float gapVersusResidueCost,
                                 float gapVersusGapCost)
Parameters:
scores -
gapVersusResidueCost - should be a negative value
gapVersusGapCost - should be a positive value

includeAdditionalCharacters

public static Scores includeAdditionalCharacters(Scores scores,
                                                 String characters)
includes additional characters in the score matrix which will all have scored zero when compared to other characters. Current system does not handle special characters well, such as ? Or "R" for NucleotideSequences, which represents a "A" or "G". Currently, we just add all characters to the allowed set of characters, and they are scored as zero cost when comparing to other characters, including themselves. One-day, we should probably introduce better scoring system so that "R" is a positive score compared to "A" or "G", but a negative score compared to "C" or "T". example usage: scores = Scores.includeAdditionalCharacters(scores, "?ABCDEFGHIJKLMNOPQRSTUVWXYZ");

Parameters:
scores -
characters -
Returns:
a new score matrix.

getExtraResidues

protected String getExtraResidues()