Skip to content

Commit

Permalink
If NaN result, report this as Error.
Browse files Browse the repository at this point in the history
  • Loading branch information
olas committed Jun 30, 2010
1 parent 7ca4762 commit 2f4fc94
Showing 1 changed file with 22 additions and 8 deletions.
Expand Up @@ -79,12 +79,18 @@ protected List<? extends ITestResult> doRunTest( ICDKMolecule cdkmol,
DescriptorValue res= descriptor.calculate( ac);
DoubleResult val = (DoubleResult) res.getValue();
double result=val.doubleValue();
results.add(new net.bioclipse.ds.model.result.DoubleResult(
if (Double.isNaN(result))
results.add(new net.bioclipse.ds.model.result.DoubleResult(
"XLogP"
, result
, ITestResult.INFORMATIVE));


, ITestResult.ERROR));
else{
results.add(new net.bioclipse.ds.model.result.DoubleResult(
"XLogP"
, result
, ITestResult.INFORMATIVE));
logger.debug(" XLogP" + "=" + result);
}
/*
* ALOGP
*/
Expand All @@ -108,10 +114,18 @@ protected List<? extends ITestResult> doRunTest( ICDKMolecule cdkmol,
for (int i=0; i< res2.getNames().length;i++){
String name = res2.getNames()[i];
double value = val2.get( i );
if (i!=1) //Skip alogp2, which is just the squared alogp
results.add(new net.bioclipse.ds.model.result.DoubleResult(
name, value, ITestResult.INFORMATIVE));
// results.add(new SimpleResult(name + ": " + value, ITestResult.INFORMATIVE));

//Skip alogp2, which is just the squared alogp
if (i!=1){
if (Double.isNaN(value))
results.add(new net.bioclipse.ds.model.result.DoubleResult(
name, value, ITestResult.ERROR));
else{
results.add(new net.bioclipse.ds.model.result.DoubleResult(
name, value, ITestResult.INFORMATIVE));
logger.debug(" " + name + "=" + value);
}
}
}

return results;
Expand Down

0 comments on commit 2f4fc94

Please sign in to comment.