|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectde.unibi.techfak.jpredictor.operator.ScoringFactory
public class ScoringFactory
Class for working on scores, such as cutoff calculations, band summery and so on. The different init method decide how this factory works.
| Field Summary | |
|---|---|
private static ScoreBand |
actBandAboveCutoff
Stores the last band where at least the first and the last scores are above the cutoff. |
private static ScoreBand |
actBandBelowCutoff
Stores the last band with all scores actually below the cutoff. |
private static java.util.Vector |
bands
Stores all bands found so far. |
private static int[] |
cccBandCounter
For every possible cutoff the absolute number of bands is stored here. |
private static int[] |
cccBandEndpos
For every possible cutoff the mid-window positions of the last score exceeding the cutoff is stored here. |
private static int |
cccStartScore
The starting score for which the band count and band end position is stored at index zero in the appropriate arrays. |
private static double |
cutoff
Stores the maximum of all scores processed. |
private static ScoredSequenceStruct |
max
Stores the maximum of all scores processed. |
private static ScoredSequenceStruct |
min
Stores the minimum of all scores processed. |
private static int |
task
Does specify the tasks this factory is allowed to perform. |
static int |
TASK_COMPRISE_SCORES
This field can be given the init method to turn score comprising on. |
static int |
TASK_CUTOFF_CALC
This field can be given the init method to turn cutoff calculation on. |
| Constructor Summary | |
|---|---|
ScoringFactory()
|
|
| Method Summary | |
|---|---|
static java.util.Vector |
getCutoffTable()
Gives a table over all possible cutoffs together with the number of bands for every cutoff. |
static ScoredSequenceStruct |
getMaxScore()
Gives the maximum of all scores processed by this factory. |
static ScoredSequenceStruct |
getMinScore()
Gives the minimum of all scores processed by this factory. |
static ScoreBand |
getScoreBand()
Returns a band of scores above the cutoff. |
static void |
init(int task,
double cutoff)
Tells the factory what tasks to perform and sets some parameters for the different tasks. |
static void |
processScore(ScoredSequenceStruct found)
Process a given score, that is, joins the score to the results of previous calculations. |
static void |
reset()
Instructs the factory to reset all static members but keeps the task and the cutoff. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int TASK_CUTOFF_CALC
init(int, double),
Constant Field Valuespublic static final int TASK_COMPRISE_SCORES
init(int, double),
Constant Field Valuesprivate static int task
init-method.
private static double cutoff
private static ScoredSequenceStruct max
private static ScoredSequenceStruct min
private static ScoreBand actBandAboveCutoff
private static ScoreBand actBandBelowCutoff
private static java.util.Vector bands
private static int[] cccBandCounter
private static int[] cccBandEndpos
private static int cccStartScore
cccBandCounter,
cccBandEndpos| Constructor Detail |
|---|
public ScoringFactory()
| Method Detail |
|---|
public static void reset()
init(int, double)
public static void init(int task,
double cutoff)
Tells the factory what tasks to perform and sets some parameters for the different tasks. The simplest task the factory does always perform is keeping track of minimum and maximum score. Additionally, the factory can be told to either do a cutoff calculation or to comprise scores above a certain cutoff to bands. A band consists of overlapping sequence windows which mainly exceed the given cutoff.
A call to this method resets all static members of this class. To
instruct the factory what to do with the scores call this method in
the first place. To reset the factory call the
reset-method
which does not clear the task and cutoff field.
task - Describes the tasks the factory is meant to perform on
scores. Its a bit pattern, fill it using the constants from this
class.cutoff - Sets a cutoff for band calculation, give
Double.NaN if band calculation is switched off.reset(),
TASK_COMPRISE_SCORES,
TASK_CUTOFF_CALCpublic static void processScore(ScoredSequenceStruct found)
Process a given score, that is, joins the score to the results of previous calculations. Actually, the calculation methods performed with this call are: (1) keeping track of the minimum and (2) the maximum score, (3) comprising the scores to bands and (4) counting the number of bands for every cutoff possible. While the minimum and maximum calculations and the band counting do work for scores with different sequence numbers, the comprising (task 3) starts new bands every time the sequence number changes.
If found is null all calculations are
forced to store their last results. For the calculation of
comprised bands it would mean to terminate and store the last
band. For the cutoff calculation it means to finish all bands,
so that every new score delivered counts as new band for all
possible cutoffs.
Calling this method with null as parameter
does not neccessarily mean a reset to the underlying variables
in this factory. To peform a reset and make sure that every
calculation starts from scratch call the reset-method.
Note, that if any calculation method needs to save the gotten struct it is cloned before it is stored.
found - The score on a sequence window to be processed.init(int, double),
reset()public static ScoreBand getScoreBand()
null is returned.
null.public static ScoredSequenceStruct getMaxScore()
null
if nothing was processed.public static ScoredSequenceStruct getMinScore()
null
if nothing was processed.public static java.util.Vector getCutoffTable()
Integer. The table is of the form:
cutoff1, #bands1, cutoff2, #bands2, cutoff3, ...
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||