Search in sources :

Example 1 with FingerIdWebMethod

use of io.github.msdk.id.sirius.FingerIdWebMethod in project mzmine2 by mzmine.

the class FingerIdWebMethodTask method run.

@Override
public void run() {
    setStatus(TaskStatus.PROCESSING);
    try {
        method = new FingerIdWebMethod(experiment, annotation, candidatesAmount);
        fingerResults = method.execute();
        logger.debug("Successfully processed {} by FingerWebMethod", formula);
    } catch (RuntimeException e) {
        e.printStackTrace();
        logger.error("Error during processing FingerIdWebMethod --- return initial compound");
        fingerResults = null;
    } catch (MSDKException e) {
        e.printStackTrace();
        logger.error("Internal FingerIdWebMethod error occured.");
        fingerResults = null;
    }
    // Check exception handling and empty results from web request
    if (fingerResults == null || fingerResults.size() == 0) {
        logger.info("No results found by FingerId Web Method for {}, adding initial compound", formula);
        fingerResults = new LinkedList<>();
        fingerResults.add(annotation);
    }
    // Update containers
    submitResults(fingerResults);
    // If Barrier exists - count it down
    if (latch != null)
        latch.countDown();
    setStatus(TaskStatus.FINISHED);
}
Also used : FingerIdWebMethod(io.github.msdk.id.sirius.FingerIdWebMethod) MSDKException(io.github.msdk.MSDKException)

Aggregations

MSDKException (io.github.msdk.MSDKException)1 FingerIdWebMethod (io.github.msdk.id.sirius.FingerIdWebMethod)1