AFLPcore
Class SizeFunction

java.lang.Object
  |
  +--AFLPcore.Operation
        |
        +--AFLPcore.SizeFunction
All Implemented Interfaces:
java.lang.Cloneable
Direct Known Subclasses:
LocalSouthern, NoSize

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

This is an abstract class that is used by Lane and anything else that needs to convert back and forth between scan numbers and sizes, in bp. Classes should extend this class to provide a sizing function for the Lane and other classes. The first entry in a Lane should be scan number 0.

See Also:
Lane, Operation

Fields inherited from class AFLPcore.Operation
descript, helpFile, name, options
 
Constructor Summary
SizeFunction()
           
 
Method Summary
 java.lang.Object clone()
          Gives an object where every field has been copied from this object to the new object.
abstract  int getScan(double size)
          Gives the index into the trace array, which should correspond to the scan number for any given size.
abstract  double getSize(int scan)
          Gives the size that corresponds to the scan number using some sort of size curve.
abstract  void init(DataList standardPoints)
          This should be used to initialize the sizing function with a set of known peaks.
abstract  void read(java.io.DataInputStream in)
          Reads in the properties of this class from the specified input stream.
abstract  void setMaxScan(int max)
          Sets the maximum scan number to be returned to the specified value.
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

SizeFunction

public SizeFunction()
Method Detail

init

public abstract void init(DataList standardPoints)
This should be used to initialize the sizing function with a set of known peaks. These known points can then be used by the sizing function to compute whatever formulas it needs.
Parameters:
standardPoints - A list of peaks that consist of the known points. Note: the area of the peak should contain the scan number of the peak.

getSize

public abstract double getSize(int scan)
Gives the size that corresponds to the scan number using some sort of size curve.
Parameters:
scan - this should be the same as the index into the trace array
Returns:
the size in bp

getScan

public abstract int getScan(double size)
Gives the index into the trace array, which should correspond to the scan number for any given size.
Parameters:
size - the size in bp
Returns:
the scan number

setMaxScan

public abstract void setMaxScan(int max)
Sets the maximum scan number to be returned to the specified value. this is useful because some methods may to be able to uniquely determine the scan number, but if one of the possibilities is beyond the max, it can be ignored.
Parameters:
max - the largest scan number that can be used by the lane

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.

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.