[Biojava-dev] IsoelectricPointCalc bug?
Pjm
pjm at sanger.ac.uk
Tue Jul 22 18:48:48 EDT 2003
> Ah, OK. I think the problem arises from a very small error in FP
> computations. The binary search algorithm that solves the isoelectric
> point equation expects and requires that successive bounds of the search
> fall on either side of zero. I think what has happened is the small error
> in computation has put both bounds on the same side of zero causing it to
> foobar.
>
> I think we can prevent it by increasing the termination tolerance for the pI
> computation. Try changing in
> org.biojava.bio.proteomics.IsoelectricPointCalc the line:-
> double pI = BinarySearch.solve(1.0, 13.0, 0.001, computeObj);
>
> to:-
> double pI = BinarySearch.solve(1.0, 13.0, 0.005, computeObj);
Thanks for the quick reply.
The binary search does a quick check before doing anything and this is where
the error is thrown. The tolerance is not used I'm affraid. See this from
org/biojava/utils/math/BinarySearch.java
public static double solve(double min, double max, double tolerance,
ComputeObject obj)
throws BioException
{
// compute initial values
double x1 = min;
double y1 = obj.compute(min);
double x2 = max;
double y2 = obj.compute(max);
// validate that function standas some chance of monotonicity
if ((y1 < 0.0) && (y2 < 0.0)) throw new BioException("Illegal initial
range limits.");
if ((y1 > 0.0) && (y2 > 0.0)) throw new BioException("Illegal initial
range limits.");
More information about the biojava-dev
mailing list