|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--AFLPcore.Operation | +--AFLPcore.SizeFunction | +--AFLPcore.LocalSouthern
This class implements the Local Southern sizing method described by E.M. Southern (Southern, E. M. "Measurement of DNA Length by Gel Electrophoresis." (1979) Analytical Biochemistry 100, 319-323.)
The equation
c L = --------- + Lo m - Mois used, where L is the size of the unknown fragement, m is the mobility (scan number) of the fragment, and c, Mo, and Lo are constants. The constants are determined in the following manner. Fragments of known size (from the size standard) are used as known values for L and m. For every set of three standard points, a curve is defined. Let the point (xi, yi) denote a standard point, where xi is the mobility of the known fragement and yi is the size of the known fragement. These three points give us the following system of equations:
c y1 = ------- + Lo (1) x1 - Mo
c y2 = ------- + Lo (2) x2 - Mo
c y3 = ------- + Lo (3) x3 - MoSolving this system of equations yields:
-(-x3 + x2) (-x3 + x1) (x1 - x2) (-y3 + y2) (y1 - y3) (-y2 + y1) c = ---------------------------------------------------------------- 2 (-y1 x3 + y2 x3 - y2 x1 + x2 y1 - x2 y3 + x1 y3)
- (-y1 x1 y3 + y1 y3 x3 - y2 x2 y1 + y2 x2 y3 - y2 y3 x3 + y2 y1 x1) Lo = -------------------------------------------------------------------- (-y1 x3 + y2 x3 - y2 x1 + x2 y1 - x2 y3 + x1 y3)
(-y2 x2 x1 + y2 x2 x3 - y1 x1 x3 + x1 y3 x3 - x2 y3 x3 + x2 y1 x1) Mo = -------------------------------------------------------------------- (-y1 x3 + y2 x3 - y2 x1 + x2 y1 - x2 y3 + x1 y3)However, a problem is encountered when all three of the standard points used are on a line. In this case, the denominator (which is the same for all three constants) becomes 0. When that happens, this class abandons the equation suggested by E.M. Southern and instead uses a line for the curve between those two points.
To size an unknown fragment, the following method is used. For most fragements, the average of two curves will be used to find the size. The first curve will be defined by two standard points below the unknown fragement and one above. The second curve will be defined by one standard point below and two above. (Above and below are determined by scan number.) Remember that one (or both) of these curves can be linear. In the case that the unknown fragement is near the beginning or the end of the size standard ranges, only one curve is used. For example, if the curve with only one size standard point below includes the first size standard point, the curve with two points below does not exists. For points smaller than the first size standard point, a line is used. The line is defined by the first size standard point and by assuming the size at scan number 0 is 0. For points greater than the largest size standard point, the curve for the last three points is simply extended. Note: This is not very accurate at all for points outside of the defined size standards! For those points inside, the sizing agrees with that of the ABI software and appears to be reliable. Therefore, it is recommended that only the points between defined size standards be used.
This class also allows one to convert from base pairs to scan numbers. This answer is not unique (see below). However, in almost every case, one of the answers is clearly out of bounds. The bounds are defined such that if a fragements size is between two standard points, it's scan number must also be between the two size standards. If the correct value cannot be determined, the class will print out an error message to the standard output and then take the smaller value.
The conversion back is broken down into three cases, a size derived from two curves, a line and a curve, and two lines. For two curves, the size s is defined as:
c1/(m - m1) + L1 + c2/(m - m2) + L2 s = ------------------------------------- 2solving for m yeilds:
-c1m2 - c2m1 2 m = f + sqrt(-------------- - m1m2 + f ) 2s - L1 - L2or
-c1m2 - c2m1 2 m = f - sqrt(-------------- - m1m2 + f ) 2s - L1 - L2where
1 c1 + c2 f = - ( m1m2 + -----------) 2 2s - L1 -L2For a curve and a line, the size is determined by:
c/(m -mo) + Lo + am + b s = -------------------------- 2solving yields:
g + sqrt(g^2 - 4a(mo*d + c)) g - sqrt(g^2 - 4a(mo*d + c)) m = -----------------------------, or m = ------------------------------ 2a 2awhere
d = 2s - Lo - b g = amo + dFinally, for two lines, the solution is trivial and unique. This is because if points a, b, and c are on a line and points b, c, and d are on a line, then a and d must be on the same line.
Overall, this class performs the conversions between base pairs and scan numbers required by the program.
Lane
,
SizeFunction
,
SizeMgr
,
FeatureList
Fields inherited from class AFLPcore.Operation |
descript, helpFile, name, options |
Constructor Summary | |
LocalSouthern()
|
Method Summary | |
java.lang.String |
getDescription()
Gives a brief description of this sizing function. |
java.lang.String |
getHelpFile()
Gives the help file that describes the function in more detail |
java.lang.String |
getName()
Gives the name describing this sizing function. |
Option[] |
getOptions()
There are no options for this sizing function. |
int |
getScan(double size)
Gives the scan number that will produce the specified size. |
double |
getSize(int scan)
Gives the size in bp from the scan number, using the method described in the class description. |
void |
init(DataList standardPeaks)
This takes a list of peaks with the location containing the size in base pairs, and the AREA must contain the scan number of that peak. |
void |
read(java.io.DataInputStream in)
Reads in the properties of this class from the specified input stream. |
void |
setMaxScan(int max)
Sets the maximum scan number to the specified value. |
void |
setOptions(Option[] opts)
Since there are no options, this method doesn't do much. |
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.SizeFunction |
clone |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LocalSouthern()
Method Detail |
public java.lang.String getName()
getName
in class Operation
public java.lang.String getDescription()
getDescription
in class Operation
public java.lang.String getHelpFile()
getHelpFile
in class Operation
public Option[] getOptions()
getOptions
in class Operation
null
public void setOptions(Option[] opts)
Operation
, which this class is a child of.setOptions
in class Operation
AFLPcore.Operation
opts
- the values for the options that this operation
understands.public void init(DataList standardPeaks)
init
in class SizeFunction
standardPeaks
- a list of peaks with the area containing the
scan number and the location having the size in bp.public void setMaxScan(int max)
setMaxScan
in class SizeFunction
max
- the largest possible scan number that should be returned
by getScan(double)
.LocalSouthern
public final double getSize(int scan)
getSize
in class SizeFunction
scan
- the scan numberpublic final int getScan(double size)
getSize
.
Remember that due to rounding errors, these two methods may not be
exact inverses. Also, it is likely that this method will be called
frequently, so it should be as fast as possible. The
setMaxScan
should be used to assist this method. It will
tell the method what the largest possible value is, which will help
it determine which possible scan number is the correct one.getScan
in class SizeFunction
size
- the size in bpScanCalcError
- occurs when the method cannot determine
the correct scan number. Since the size is determined by an
average of two values, the scan number that produces it may
not be unique. Most of the time one can be discarded, but if not
this exception will occur. The class description contains more
info. Currently, this exception is not thrown and output is
dumped to standard out instead. The smaller of the two values
is taken so that the program can continue.LocalSouthern
public void read(java.io.DataInputStream in) throws java.io.IOException
write
. This
will retrieve this classes state from the input stream. All current
data in the class will be replaced.read
in class SizeFunction
in
- the input stream with the data for the class.java.io.IOException
- occurs when a problem is encountered when
reading from the stream.public void write(java.io.DataOutputStream out) throws java.io.IOException
read
can recreate the essential properties of this
class.write
in class SizeFunction
out
- the destination to write the data to.java.io.IOException
- occurs when a problem is encountered when
writing to the stream.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |