public class AmbiguityBaseScore extends Object implements Comparable<AmbiguityBaseScore>, Cloneable
Modifier and Type | Field and Description |
---|---|
static int |
ADENINE_INDEX |
static int |
CYTOSINE_INDEX |
static int |
GUANINE_INDEX |
static int |
THYMINE_INDEX |
Constructor and Description |
---|
AmbiguityBaseScore(double[] scores)
Note that no deep copy of the array will be made.
|
AmbiguityBaseScore(double adenine,
double thymine,
double cytosine,
double guanine)
Creates a new instance of this class.
|
AmbiguityBaseScore(double adenine,
double thymine,
double cytosine,
double guanine,
double sum)
Creates a new instance of this class and directly scales is to the specified sum.
|
Modifier and Type | Method and Description |
---|---|
void |
add(AmbiguityBaseScore other) |
protected Object |
clone() |
int |
compareTo(AmbiguityBaseScore other) |
boolean |
equals(Object other) |
double |
getAdenineScore() |
char |
getConsensusBase() |
double |
getCytosineScore() |
double |
getGuanineScore() |
double |
getMaxScore() |
double |
getScoreByIndex(int index) |
double |
getSum()
Returns the sum of all scores.
|
double |
getThymineScore() |
void |
rescale(double sum)
Scales all scores with the same linear factor so that the sum of all scores is equal to
sum . |
void |
setAdeninScore(double score) |
void |
setCytosinScore(double score) |
void |
setGuaninScore(double score) |
void |
setScoreByIndex(int index,
double score) |
void |
setThyminScore(double score) |
public static final int ADENINE_INDEX
public static final int THYMINE_INDEX
public static final int CYTOSINE_INDEX
public static final int GUANINE_INDEX
public AmbiguityBaseScore(double[] scores)
scores
- public AmbiguityBaseScore(double adenine, double thymine, double cytosine, double guanine)
adenine
- the score for adeninethymine
- the score for thymincytosine
- the score for cytosinguanine
- the score for guaninepublic AmbiguityBaseScore(double adenine, double thymine, double cytosine, double guanine, double sum)
adenine
- the score for adeninethymine
- the score for thymincytosine
- the score for cytosinguanine
- the score for guaninesum
- the sum all scroes together shall havepublic double getAdenineScore()
public double getThymineScore()
public double getCytosineScore()
public double getGuanineScore()
public void setAdeninScore(double score)
public void setThyminScore(double score)
public void setCytosinScore(double score)
public void setGuaninScore(double score)
public double getScoreByIndex(int index)
public void setScoreByIndex(int index, double score)
public void add(AmbiguityBaseScore other)
public double getMaxScore()
public double getSum()
public void rescale(double sum)
sum
.
If the current sum of all scores is zero calling this method will have no effect.sum
- the sum all scored together shall havepublic char getConsensusBase()
protected Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public int compareTo(AmbiguityBaseScore other)
compareTo
in interface Comparable<AmbiguityBaseScore>