Class ChannelFunction

  • All Implemented Interfaces:
    JepExpressionFunction, JepFunction, org.nfunk.jep.function.PostfixMathCommandI

    public class ChannelFunction
    extends Object
    implements JepExpressionFunction
    A JEP function class that adds a ch(int) function to a JEP expression parser. The function will look up the intensity value for the given channel. For example: ch(1) / ch(2)

    Note! If the current bioassay set has stored transformed intensity values, the values are un-transformed before returned by the this function. Use RawChannelFunction if you need the raw values exactly as they are stored in the database.

    To be able to use this function it must be registered with the JEP parser and, before the expression is evaluated, a SqlResult object must be set. For example we can evaluate an expression for every position in a bioassay:

    DbControl dc = ...
    BioAssay assay = ...
    String expression = "ch(1) / ch(2)";
    ChannelFunction ch = new ChannelFunction({3, 4});
    JEP jep = JepUtil.newJep(expression, ch);
    DynamicResultIterator result = 
       assay.getSpotData().iterate(dc);
    while (result.hasNext())
    {
       ch.setSqlResult(result.next());
       double value = jep.getValue();
       // Do something with the value
    }
    result.close();
    
    Version:
    2.0
    Author:
    Nicklas
    See Also:
    Jep, BioAssaySetUtil.createJepExpression(DbControl, String, DynamicQuery)
    Last modified
    $Date: 2015-04-20 11:08:18 +0200 (må, 20 apr 2015) $