AFLPcore
Class ScoreFunction

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

public abstract class ScoreFunction
extends Operation
implements java.lang.Cloneable

This class represents functions used to score a bin. For example, a function could be designed so that the bin was labeled with A's and B's for a segregating population. The function should also be able to give additional information once all of the lanes have been scored, such as the number scored in a certain way. However, the overall information should always be applicable to the case being handled. Note: the first option should be the number of levels expected by the function + 1. This corresponds to the number of different labels, which is a more intuitive value for the user.


Fields inherited from class AFLPcore.Operation
descript, helpFile, name, options
 
Constructor Summary
ScoreFunction()
           
 
Method Summary
 java.lang.Object clone()
          Gives an object where every field has been copied from this object to the new object.
abstract  java.lang.String[] getChoices(int numLevels)
          Gives the possible values that score will return.
abstract  java.lang.String[] getInfo(java.lang.String[] labels, DataList peaks)
          Should provide overall information about a bin scored with this method.
abstract  void invert()
          Changes the score method so that the scoring is opposite of the normal scoring, for example, A becomes B and B becomes A.
abstract  void read(java.io.DataInputStream in)
          Reads in the properties of this class from the specified input stream.
abstract  java.lang.String score(Cutoff cutoff, DataList peaks)
          Gives a label for a lane with the specified cutoff and the specified peaks.
abstract  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.Operation
getDescription, getHelpFile, getName, getOptions, setOptions
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScoreFunction

public ScoreFunction()
Method Detail

getInfo

public abstract java.lang.String[] getInfo(java.lang.String[] labels,
                                           DataList peaks)
Should provide overall information about a bin scored with this method. The labels will contain how each lane was scored and the peaks will be the ones of interest in the bin. The string will contain overall information, such as the number scored each way or means and standard deviations.
Parameters:
labels - the list of how each lane was scored.
peaks - all of the peaks of interest in the bin.
See Also:
score(AFLPcore.Cutoff, AFLPcore.DataList)

score

public abstract java.lang.String score(Cutoff cutoff,
                                       DataList peaks)
Gives a label for a lane with the specified cutoff and the specified peaks. For example, with a population of two parents, A and B, the score method would return either an "A" or a "B" depending on how the peaks related to the cutoff. If parent A was above the cutoff, an A should be returned. Note that this case is only an example, and many other possiblities exist.
Parameters:
cutoff - the cutoff to be used when scoring
peaks - the peaks in the region of interest

getChoices

public abstract java.lang.String[] getChoices(int numLevels)
Gives the possible values that score will return. These could differ based on the number of levels in the cutoff
Parameters:
numLevels - the number of levels that the score function needs to accomodate.

invert

public abstract void invert()
Changes the score method so that the scoring is opposite of the normal scoring, for example, A becomes B and B becomes A.

clone

public java.lang.Object clone()
Gives an object where every field has been copied from this object to the new object.
Overrides:
clone in class java.lang.Object
Returns:
a copy of this object.

write

public abstract 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.
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 abstract 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.
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.