AFLPcore
Class SegregatingScore

java.lang.Object
  |
  +--AFLPcore.Operation
        |
        +--AFLPcore.ScoreFunction
              |
              +--AFLPcore.SegregatingScore
All Implemented Interfaces:
java.lang.Cloneable

public class SegregatingScore
extends ScoreFunction

This scores each bin by assigning different labels to the differnet cutoff regions. A cutoff region is a region between two cutoffs, or between the cutoff and the zero level. For example, in a bin with one cutoff, lanes that have a peak above the cutoff might be labeled "A", and those below "B". For a bin with two cutoffs, those below both may be "B", those between the two would be "h", and those above both would be "A". The options can be used to set the number of levels and the labels. If the number of cutoff levels for a lane does not match the number expected by this function, an error will be thrown. Also, those peaks that are above a cutoff are marked, and are then used to calculate the mean and standard deviation of the values in the bin. It also will count the number of each label that occur in a bin.

See Also:
Cutoff, Lane

Fields inherited from class AFLPcore.Operation
descript, helpFile, name, options
 
Constructor Summary
SegregatingScore()
          Creates a new segregating score function.
 
Method Summary
 java.lang.String[] getChoices(int numLevels)
          Gives the labels that the scoring function can assign.
 java.lang.String getDescription()
          Gives a one sentence description of this score function.
 java.lang.String getHelpFile()
          Gives a file that is the help file for this scoring function
 java.lang.String[] getInfo(java.lang.String[] tags, DataList peaks)
          This returns a set of strings that describes the overall scoring of the bin.
 java.lang.String getName()
          Gives the name of this segregating score function.
 Option[] getOptions()
          Gives the options for this scoring.
 void invert()
          This switches the labels that will be used to there opposite.
 void read(java.io.DataInputStream in)
          Reads in the properties of this class from the specified input stream.
 java.lang.String score(Cutoff cutoff, DataList peaks)
          Scores a lane by seeing if any of the peaks cross the highest cutoff, and then labeling it appropriately.
 void setOptions(Option[] opts)
          Sets the option to the specified values.
 void write(java.io.DataOutputStream out)
          Writes all of the information this class needs to store in order to be recreated.
 
Methods inherited from class AFLPcore.ScoreFunction
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SegregatingScore

public SegregatingScore()
Creates a new segregating score function. The default number of levels is one.
Method Detail

score

public java.lang.String score(Cutoff cutoff,
                              DataList peaks)
Scores a lane by seeing if any of the peaks cross the highest cutoff, and then labeling it appropriately. It then sees if anything crosses the next cutoff, and so on.
Overrides:
score in class ScoreFunction
Parameters:
cutoff - the cutoff used to determine the labels
peaks - the peaks in a region to compare to the cutoff
Throws:
ScoringFailure - occurs if the number of levels in the cutoff do not match the number of levels that the function is expecting. This number can be changed by setting the options for this function.
See Also:
getOptions()

getInfo

public java.lang.String[] getInfo(java.lang.String[] tags,
                                  DataList peaks)
This returns a set of strings that describes the overall scoring of the bin. It includes the mean of all of the peaks with non-zero confidences as well as the standard deviation of those peaks. It tells how many peaks were used to calculate the standard deviation as well as how many peaks were defined ("used/defined"). It also returns a count for each of the different types of labels. For example:

Mean: 98.38 StdDev: 0.06 #A: 20 #B: 14 from 20/20 peaks

Overrides:
getInfo in class ScoreFunction
Parameters:
tags - the label for each lane.
peaks - the peaks that were marked by the score method.
Returns:
a string with the information described above.

getChoices

public java.lang.String[] getChoices(int numLevels)
Gives the labels that the scoring function can assign. Only one label will be assigned per lane, but this method will return all of the possiblities.
Overrides:
getChoices in class ScoreFunction
Following copied from class: AFLPcore.ScoreFunction
Parameters:
numLevels - the number of levels that the score function needs to accomodate.

getOptions

public Option[] getOptions()
Gives the options for this scoring. The first option determines the number of levels the function should handle, and the other options will contain the string for the label of each section. Note that if the nubmer of levels is increased, it will be difficult to add more fields without setting the options and then getting them again. The value that the first option should actually contain is the number of labels, which is simply 1 plus the number of levels.
Overrides:
getOptions in class Operation
Returns:
a list of options.

setOptions

public void setOptions(Option[] opts)
Sets the option to the specified values. The first option should be the number of labels, which is simply one more than the number of levels. The following options should contain the label for each level. If a level is not set, it will have a label of "_" or "?". "_" occurs if an option is provided but not set. "?" is the result of more labels then options specified.
Overrides:
setOptions in class Operation
Parameters:
opts - the options as described above.
Throws:
java.lang.IllegalArgumentException - if the number of options does not match 1 plus the number of labels. This means that changing the number of levels and the labels will require several calls to this method.

invert

public void invert()
This switches the labels that will be used to there opposite. If a peak above the cutoff would have been labeled 'A' and one below 'B', it will now be labeled as a 'B.' If there is a third label, so A, H, B, invert will switch it to B, H, A.
Overrides:
invert in class ScoreFunction

getName

public java.lang.String getName()
Gives the name of this segregating score function.
Overrides:
getName in class Operation
Returns:
the name, which is "Segregating".

getDescription

public java.lang.String getDescription()
Gives a one sentence description of this score function.
Overrides:
getDescription in class Operation
Returns:
the description

getHelpFile

public java.lang.String getHelpFile()
Gives a file that is the help file for this scoring function
Overrides:
getHelpFile in class Operation
Returns:
a plaintext of html file containing help information

write

public void write(java.io.DataOutputStream out)
           throws java.io.IOException
Writes all of the information this class needs to store in order to be recreated. This will be used for things like storing the class in a file. Therefore, the write should output enough information so that read can recreate the essential properties of this class.
Overrides:
write in class ScoreFunction
Parameters:
out - the destination to write the data to.
Throws:
java.io.IOException - occurs when a problem is encountered when writing to the stream.

read

public void read(java.io.DataInputStream in)
          throws java.io.IOException
Reads in the properties of this class from the specified input stream. The stream data should have been created by write. This will retrieve this classes state from the input stream. All of the current data in this class will be replaced by the data from the stream.
Overrides:
read in class ScoreFunction
Parameters:
in - the input stream with the data for the class.
Throws:
java.io.IOException - occurs when a problem is encountered when writing to the stream.