AFLPcore
Class Peak

java.lang.Object
  |
  +--AFLPcore.Data
        |
        +--AFLPcore.SortableData
              |
              +--AFLPcore.Peak

public class Peak
extends SortableData

This class represents a peak. A peak is a point of interest in a lane, which theoretically should represent a fragement of a given size. Peaks are used by the ScoreFunction to determine how to score a lane. The peaks can be choosen by a class that extends PeakLocate. The lane will contain a list of peaks.

See Also:
PeakLocate, Lane, ScoreFunction

Constructor Summary
Peak(double location, double height, double area)
          Creates a new peak with the specified parameters.
 
Method Summary
 java.lang.Object clone()
          Clones this peak Not implemented
 double getArea()
          Gives the area of this peek.
 double getConfidence()
          Gives the confidence associated with this peak.
 double getHeight()
          Gives the height of the peak.
 double getLocation()
          Gives the location of the peek in the data.
 double getSearchKey()
          This gives the location of the peek, and is used when searching or sorting objects of this type.
 boolean isMarked()
          Tells whether or not this peak is marked.
 void read(java.io.DataInputStream in)
          Reads in the properties of this class from the specified input stream.
 void set(double location, double height, double area)
          Changes this peak so that the location, height, and size are set to the values given.
 void setConfidence(double confidence)
          Sets the confidence to the specified value.
 void setMarkedState(boolean state)
          Sets the peak as specified.
 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 java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Peak

public Peak(double location,
            double height,
            double area)
Creates a new peak with the specified parameters. The confidence of this peak is set to 1 by default. Also, by default the peak is not marked.
Parameters:
location - the size in bp of the center (top) of the peak
height - the intensity of the trace at the peak location
area - the area of the peak.
Method Detail

getSearchKey

public final double getSearchKey()
This gives the location of the peek, and is used when searching or sorting objects of this type.
Overrides:
getSearchKey in class SortableData
Returns:
a value that provides a logical way to sort this object

getLocation

public final double getLocation()
Gives the location of the peek in the data.
Returns:
the position in bp

getHeight

public final double getHeight()
Gives the height of the peak.
Returns:
the height

getArea

public final double getArea()
Gives the area of this peek. The actual calculation of the area is handled outside of this class.
Returns:
the area

set

public void set(double location,
                double height,
                double area)
Changes this peak so that the location, height, and size are set to the values given. Remember that changing the location will also change the height and area.
Parameters:
location - the position in the trace, in bp.
height - the height of the peak
area - the area of the peak

getConfidence

public final double getConfidence()
Gives the confidence associated with this peak. The confidence is a measure of how sure the program is that this peak is actually a peak. It should be set by whatever algorithm is used to select the peak.
Returns:
a measure of the certainty that this is a peak, between 0 and 1.0

setConfidence

public final void setConfidence(double confidence)
Sets the confidence to the specified value. This value should be between 0.0 and 1.0. See getConfidence for a description of confidence.
Parameters:
confidence - the value to set the confidence to
See Also:
getConfidence()

isMarked

public boolean isMarked()
Tells whether or not this peak is marked. This could be used to include/exclude a peak from analysis. It could also determine if the peak is drawn with a label/indicator of some kind.
Returns:
the state of the peak

setMarkedState

public void setMarkedState(boolean state)
Sets the peak as specified. Marking could be used to indicate which peak will be used in analysis.
Parameters:
state - the value for the marked state of this peak.

clone

public java.lang.Object clone()
Clones this peak Not implemented
Overrides:
clone in class Data

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 info in this class will be replaced with 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 reading from the stream.

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.
Parameters:
out - the destination to write the data to.
Throws:
java.io.IOException - occurs when a problem is encountered when writing to the stream.