Changeset 4917


Ignore:
Timestamp:
Apr 30, 2009, 2:30:35 PM (13 years ago)
Author:
Nicklas Nordborg
Message:

References #1120: The dynamic part of BASE should keep track whether intensity data is in log space or not

Added intensity transformation information to formulas. Changed places were formulas are used so that only the proper type of formulas are displayed. It remains to change the GUI for editing formulas so that this information can be specified by users.

Location:
trunk
Files:
22 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/clients/web/net/sf/basedb/clients/web/DynamicUtil.java

    r4916 r4917  
    212212 
    213213  public static void addFormulaColumns(List<TableColumn> columns, DbControl dc,
    214     RawDataType rawDataType, Formula.Type type, String idPrefix, String titlePrefix, boolean allowRawFunction)
    215   {
    216     ItemQuery<Formula> query = Formula.getQuery(type, rawDataType);
     214    RawDataType rawDataType, Formula.Type type, IntensityTransform source,
     215    String idPrefix, String titlePrefix, boolean allowRawFunction)
     216  {
     217    ItemQuery<Formula> query = Formula.getQuery(type, rawDataType, source);
    217218    query.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
    218219    query.order(Orders.asc(Hql.property("name")));
  • trunk/src/core/net/sf/basedb/core/Formula.java

    r4889 r4917  
    115115
    116116  /**
     117    @deprecated In 2.12. Use {@link #getQuery(Type, RawDataType, IntensityTransform)} instead
     118  */
     119  public static ItemQuery<Formula> xgetQuery(Formula.Type type, RawDataType rawDataType)
     120  {
     121    return getQuery(type, rawDataType, null);
     122  }
     123 
     124  /**
    117125    Get a query that return formulas that can be used with the specified
    118126    raw data type. The formulas returned are those that match the specified
     
    121129    @param type The type of formula to return, or null to return any type
    122130    @param rawDataType The raw data type the formula should be useful for
     131    @param source Source data intensity transformation that the formula
     132      should be useful for. This includes all formulas that has specified
     133      the same transformation and those that hasn't specified any transformation
     134      at all. If this parameter is null, no filtering on intensity transformation
     135      is done.
    123136    @return An {@link ItemQuery} object
    124   */
    125   public static ItemQuery<Formula> getQuery(Formula.Type type, RawDataType rawDataType)
     137    @since 2.12
     138  */
     139  public static ItemQuery<Formula> getQuery(Formula.Type type, RawDataType rawDataType,
     140    IntensityTransform source)
    126141  {
    127142    ItemQuery<Formula> query = getQuery();
    128143    /*
    129144      (type = :type) AND
    130       ((rawDataType = :rawDataType) OR (rawDataType = null AND channels = :channels))
     145      ((rawDataType = :rawDataType) OR (rawDataType = null AND channels = :channels)) AND
     146      (sourceIntensityTransform = :source OR sourceIntensityTransform IS NULL)
    131147    */
    132148    if (type != null)
     
    145161      )
    146162    );
     163    if (source != null)
     164    {
     165      Expression s = Hql.property("sourceIntensityTransform");
     166      query.restrictPermanent(
     167        Restrictions.or(
     168            Restrictions.eq(s, Expressions.integer(source.getValue())),
     169            Restrictions.eq(s, null)
     170        )
     171      );
     172    }
    147173    return query;
    148174  }
     175
    149176 
    150177  Formula(FormulaData formulaData)
     
    257284    if (parser == null) throw new InvalidUseOfNullException("parser");
    258285    getData().setParser(parser.getValue());
     286  }
     287 
     288  /**
     289    Get the intensity transformation that is required on spot
     290    data if this formula should generate the correct result.
     291    @return An intensity transform or null if the formula can
     292      be used on all types of spot data
     293    @since 2.12
     294  */
     295  public IntensityTransform getSourceIntensityTransform()
     296  {
     297    Integer sit = getData().getSourceIntensityTransform();
     298    return sit == null ? null : IntensityTransform.fromValue(sit);
     299  }
     300  /**
     301    Sets the transform that is required on spot data if this
     302    formula should generate the correct result.
     303    @param transform The required transform or null if the formula works
     304      with all kind of data
     305    @since 2.12
     306  */
     307  public void setSourceIntensityTransform(IntensityTransform transform)
     308  {
     309    checkPermission(Permission.WRITE);
     310    getData().setSourceIntensityTransform(transform == null ? null : transform.getValue());
     311  }
     312
     313  /**
     314    Get the spot intensity transformation that this formula
     315    generates.
     316    @return An intensity transform or null if the formula generates
     317      the same kind of data used as source or doesn't generate intensity
     318      data at all
     319    @since 2.12
     320  */
     321  public IntensityTransform getResultIntensityTransform()
     322  {
     323    Integer sit = getData().getResultIntensityTransform();
     324    return sit == null ? null : IntensityTransform.fromValue(sit);
     325  }
     326  /**
     327    Sets the transform that this formula generates.
     328    @param transform An intensity transform or null if the formula
     329      generates the same kind of data used as source or doesn't generate intensity
     330      data at all
     331    @since 2.12
     332  */
     333  public void setResultIntensityTransform(IntensityTransform transform)
     334  {
     335    checkPermission(Permission.WRITE);
     336    getData().setResultIntensityTransform(transform == null ? null : transform.getValue());
    259337  }
    260338 
     
    712790    /**
    713791      Use the JEP parser.
    714       @see net.sf.basedb.util.jep.Jep#formulaToExpression(String, JepFunction[])
     792      @see net.sf.basedb.util.jep.Jep#formulaToExpression(String, net.sf.basedb.util.jep.JepFunction...)
    715793    */
    716794    JEP(1, "JEP");
  • trunk/src/core/net/sf/basedb/core/Install.java

    r4910 r4917  
    671671      ColoringData RATIO_COLORING = new ColoringData(true, true, -1f, 0f, 1f);
    672672      if (progress != null) progress.display((int)(23*progress_factor), "--Creating formulas...");
    673       createFormula(Formula.Type.COLUMN_EXPRESSION, Formula.Parser.JEP, Formula.AverageMethod.GEOMETRIC_MEAN,
     673      createFormula(Formula.Type.COLUMN_EXPRESSION, Formula.Parser.JEP,
     674        Formula.AverageMethod.GEOMETRIC_MEAN, null, null,
    674675        "Ratio, ch1 / ch2", "The ratio of channel 1 to channel 2", null, 2,
    675676        new String[] { "ch(1) / ch(2)"}, RATIO_COLORING, rootUser, keyEveryoneUse);
    676       createFormula(Formula.Type.COLUMN_EXPRESSION, Formula.Parser.JEP, Formula.AverageMethod.ARITHMETIC_MEAN,
     677      createFormula(Formula.Type.COLUMN_EXPRESSION, Formula.Parser.JEP,
     678        Formula.AverageMethod.ARITHMETIC_MEAN, null, null,
    677679        "M, log2(ch1 / ch2)", "The log of the ratio of channel 1 to channel 2" , null, 2,
    678680        new String[] { "log2(ch(1) / ch(2))" }, NO_COLORING, rootUser, keyEveryoneUse);
    679       createFormula(Formula.Type.COLUMN_EXPRESSION, Formula.Parser.JEP, Formula.AverageMethod.ARITHMETIC_MEAN,
     681      createFormula(Formula.Type.COLUMN_EXPRESSION, Formula.Parser.JEP,
     682        Formula.AverageMethod.ARITHMETIC_MEAN, null, null,
    680683        "A, log10(ch1 * ch2) / 2", "The log of the geometric mean of the two channels", null, 2,
    681684        new String[] { "log(ch(1) * ch(2)) / 2" }, NO_COLORING, rootUser, keyEveryoneUse);
    682       createFormula(Formula.Type.INTENSITY_TRANSFORMATION, Formula.Parser.JEP, Formula.AverageMethod.NONE,
     685      createFormula(Formula.Type.INTENSITY_TRANSFORMATION, Formula.Parser.JEP,
     686        Formula.AverageMethod.NONE, null, null,
    683687        "Swap channel 1 and 2", "Swaps the intensities in channel 1 and 2", null, 2,
    684         new String[] { "ch(2)", "ch(1)" }, NO_COLORING, rootUser, keyEveryoneUse);
     688        new String[] { "rawCh(2)", "rawCh(1)" }, NO_COLORING, rootUser, keyEveryoneUse);
    685689 
    686690      // Intensity expression formulas defined by raw data types
     
    691695        for (IntensityFormula f : rdt.getIntensityFormulas())
    692696        {
    693           createFormula(Formula.Type.INTENSITY_EXPRESSION, Formula.Parser.JEP, Formula.AverageMethod.NONE,
     697          createFormula(Formula.Type.INTENSITY_EXPRESSION, Formula.Parser.JEP,
     698            Formula.AverageMethod.NONE, null, null,
    694699            f.getTitle(), f.getDescription(), rdt.getId(), rdt.getChannels(),
    695700            f.getExpressions(), NO_COLORING, rootUser, keyEveryoneUse);
     
    704709        expression += deliminator + "ch(" + channel + ") > 0";
    705710        deliminator = " && ";
    706         createFormula(Formula.Type.COLUMN_RESTRICTION, Formula.Parser.JEP, Formula.AverageMethod.NONE,
     711        createFormula(Formula.Type.COLUMN_RESTRICTION, Formula.Parser.JEP,
     712          Formula.AverageMethod.NONE, null, null,
    707713          "All intensities > 0", "Remove spots with intensities less than zero",
    708714          null, channel, new String[] { expression }, NO_COLORING, rootUser, keyEveryoneUse);
    709715      }
    710716 
     717      // Logarithmic intensity transformations
     718      List<String> expressions = new ArrayList<String>(maxChannels);
     719      for (int channel = 1; channel <= maxChannels; ++channel)
     720      {
     721        expressions.add("log2(rawCh(" + channel + "))");
     722        createFormula(Formula.Type.INTENSITY_TRANSFORMATION, Formula.Parser.JEP,
     723          Formula.AverageMethod.NONE, IntensityTransform.NONE, IntensityTransform.LOG2,
     724          "Log2", "Transform all intensity values to log2 scale",
     725          null, channel, expressions.subList(0, channel).toArray(new String[0]),
     726          NO_COLORING, rootUser, keyEveryoneUse);
     727      }
     728     
    711729      if (progress != null) progress.display((int)(24*progress_factor), "--Creating job agents...");
    712730      // TODO
     
    24082426    Create a {@link Formula}.
    24092427  */
    2410   private static FormulaData createFormula(Formula.Type type, Formula.Parser parser, Formula.AverageMethod avgMethod, String name, String description,
    2411     String rawDataType, int channels, String[] formulas, ColoringData coloring, UserData owner, ItemKeyData shareTo)
     2428  private static FormulaData createFormula(Formula.Type type, Formula.Parser parser,
     2429    Formula.AverageMethod avgMethod, IntensityTransform source, IntensityTransform result,
     2430    String name, String description,
     2431    String rawDataType, int channels,
     2432    String[] formulas, ColoringData coloring,
     2433    UserData owner, ItemKeyData shareTo)
    24122434    throws BaseException
    24132435  {
     
    24352457      if (formula != null)
    24362458      {
    2437         if (schemaVersion.getSchemaVersion() < 20)
     2459        int sv = schemaVersion.getSchemaVersion();
     2460        if (sv < 20)
    24382461        {
    24392462          // Add coloring information if upgrading
    24402463          formula.setColoring(coloring);
    24412464        }
    2442         if (schemaVersion.getSchemaVersion() < 36)
     2465        if (sv < 36)
    24432466        {
    24442467          // Add average method if upgrading
    24452468          formula.setAverageMethod(avgMethod.getValue());
     2469        }
     2470        if (sv < 70)
     2471        {
     2472          // Add intensity transformation information if upgrading
     2473          formula.setSourceIntensityTransform(source == null ? null : source.getValue());
     2474          formula.setResultIntensityTransform(result == null ? null : result.getValue());
     2475          if (name.startsWith("Swap"))
     2476          {
     2477            // The "Swap intensities" transformation needs to be updated
     2478            formula.getFormulas().clear();
     2479            formula.getFormulas().addAll(Arrays.asList(formulas));
     2480          }
    24462481        }
    24472482        log.info("createFormula: EXISTS [name="+name+"; rawDataType="+rawDataType+"; channels="+channels+"]");
     
    24632498        formula.setColoring(coloring);
    24642499        formula.setAverageMethod(avgMethod.getValue());
     2500        formula.setSourceIntensityTransform(source == null ? null : source.getValue());
     2501        formula.setResultIntensityTransform(result == null ? null : result.getValue());
    24652502
    24662503        HibernateUtil.saveData(session, formula);
  • trunk/src/core/net/sf/basedb/core/Update.java

    r4910 r4917  
    791791      <ul>
    792792      <li>{@link net.sf.basedb.core.data.BioAssaySetData#getIntensityTransform()}.
     793      <li>{@link net.sf.basedb.core.data.FormulaData#getSourceIntensityTransform()}
     794      <li>{@link net.sf.basedb.core.data.FormulaData#getResultIntensityTransform()}
    793795      </ul>
    794796      The update sets the values for all existing bioassay sets to 0 (=no transform).
  • trunk/src/core/net/sf/basedb/core/data/FormulaData.java

    r4889 r4917  
    9393    <ul>
    9494    <li>1 = intensity expression; raw data type required, 1 formula for each channel
    95     <li>2 = analysis expression; raw data type or channels required, 1 formula for each channel
     95    <li>2 = intensity transformation; raw data type or channels required, 1 formula for each channel
    9696    <li>3 = column expression; raw data type or channels required, 1 formula only
    9797    <li>4 = column restriction; raw data type or channels required, 1 formula only
     
    109109  }
    110110 
     111  private Integer sourceIntensityTransform;
     112  /**
     113    A flag indicating what kind of spot source data that the formula
     114    can be used with, or null if the formula can be used with
     115    any kind of source data.
     116    0 = no transformation; 1 = 2-log; 2 = 10-log
     117    @hibernate.property column="`source_transform`" type="int" not-null="false"
     118    @since 2.12
     119  */
     120  public Integer getSourceIntensityTransform()
     121  {
     122    return sourceIntensityTransform;
     123  }
     124  /**
     125    @since 2.12
     126  */
     127  public void setSourceIntensityTransform(Integer sourceIntensityTransform)
     128  {
     129    this.sourceIntensityTransform = sourceIntensityTransform;
     130  }
     131
     132  private Integer resultIntensityTransform;
     133  /**
     134    A flag indicating what kind of result spot data this formula
     135    generates, or null if it generates the same kind of data that
     136    is used as source.
     137    0 = no transformation; 1 = 2-log; 2 = 10-log
     138    @hibernate.property column="`result_transform`" type="int" not-null="false"
     139    @since 2.12
     140  */
     141  public Integer getResultIntensityTransform()
     142  {
     143    return resultIntensityTransform;
     144  }
     145  /**
     146    @since 2.12
     147  */
     148  public void setResultIntensityTransform(Integer resultIntensityTransform)
     149  {
     150    this.resultIntensityTransform = resultIntensityTransform;
     151  }
     152 
    111153  private int parser;
    112154  /**
  • trunk/src/plugins/core/net/sf/basedb/plugins/Base1PluginExecuter.java

    r4889 r4917  
    847847   
    848848    ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION,
    849       bas.getRawDataType());
     849      bas.getRawDataType(), bas.getIntensityTransform());
    850850    queryFormula.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
    851851    queryFormula.order(Orders.asc(Hql.property("name")));
  • trunk/src/plugins/core/net/sf/basedb/plugins/BioAssaySetExporter.java

    r4913 r4917  
    11291129  {
    11301130    List<QueryItem> items = new ArrayList<QueryItem>();
    1131     ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, bas.getRawDataType());
     1131    ItemQuery<Formula> queryFormula = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION,
     1132      bas.getRawDataType(), bas.getIntensityTransform());
    11321133    queryFormula.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
    11331134    queryFormula.order(Orders.asc(Hql.property("name")));
  • trunk/src/plugins/core/net/sf/basedb/plugins/IntensityCalculatorPlugin.java

    r4889 r4917  
    486486       
    487487        ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.INTENSITY_EXPRESSION,
    488             experiment.getRawDataType());
     488            experiment.getRawDataType(), null);
    489489        formulaQuery.include(Include.MINE, Include.SHARED, Include.OTHERS, Include.IN_PROJECT);
    490490        formulaQuery.order(Orders.asc(Hql.property("name")));
  • trunk/src/plugins/core/net/sf/basedb/plugins/JepIntensityTransformer.java

    r4513 r4917  
    3737import net.sf.basedb.core.DbControl;
    3838import net.sf.basedb.core.DynamicSpotQuery;
     39import net.sf.basedb.core.IntensityTransform;
    3940import net.sf.basedb.core.Item;
    4041import net.sf.basedb.core.Job;
     
    6566import net.sf.basedb.core.signal.ThreadSignalHandler;
    6667import net.sf.basedb.util.BioAssaySetUtil;
     68import net.sf.basedb.util.Enumeration;
    6769import net.sf.basedb.util.Values;
    6870
     
    153155      String transformationName = (String)job.getValue(TRANSFORMATION_NAME);
    154156      transformationName = getAbout().getName() + ": " + (transformationName == null ? "" : transformationName);
     157      String resultTransform = (String)job.getValue("resultTransform");
    155158      RawDataType rdt = source.getRawDataType();
    156159     
     
    167170      child.setName(childName);
    168171      child.setDescription(childDescription);
     172      IntensityTransform result = source.getIntensityTransform();
     173      if (resultTransform != null) result = IntensityTransform.valueOf(resultTransform);
     174      child.setIntensityTransform(result);
    169175      dc.saveItem(child);
    170176
     
    188194        else
    189195        {
    190           chExpression = Dynamic.column(VirtualColumn.channel(ch));
     196          chExpression = Dynamic.column(VirtualColumn.channelIntensity(ch));
    191197        }
    192198        query.select(Selects.expression(chExpression, "ch" + ch));
     
    294300       
    295301        // Channel transformations
     302        storeValue(job, request, ri.getParameter("resultTransform"));
    296303        for (int ch = 1; ch <= channelParameters.size(); ++ch)
    297304        {
     
    355362          channelParameters.add(chParameter);
    356363        }
     364        Enumeration<String, String> transforms = new Enumeration<String, String>();
     365        for (IntensityTransform t : IntensityTransform.values())
     366        {
     367          transforms.add(t.name(), t.toString());
     368        }
     369        parameters.add(
     370          new PluginParameter<String>(
     371            "resultTransform",
     372            "Resulting transform",
     373            "The type of spot intensity values this transformation generates. If not " +
     374            "specified it is expected to generate the same type of values as are found " +
     375            "in the source bioassay set",
     376            new StringParameterType(255, null, false, 1, 0, 0, transforms)
     377          )
     378        );
    357379       
    358380        configureJob = new RequestInformation
  • trunk/src/test/TestBioAsssaySetExporter.java

    r4843 r4917  
    386386     
    387387      ArrayList<String> spot = new ArrayList<String>();
    388       ItemQuery<Formula> ratio = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, bas.getRawDataType());
     388      ItemQuery<Formula> ratio = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION,
     389        bas.getRawDataType(), bas.getIntensityTransform());
    389390      ratio.restrict(Restrictions.eq(Hql.property("name"), Expressions.string("Ratio, ch1 / ch2")));
    390391      if (ratio.count(dc) < 1)
  • trunk/src/test/TestWebservices.java

    r4740 r4917  
    239239       
    240240        ArrayList<String> spot = new ArrayList<String>();
    241         ItemQuery<Formula> ratio = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, bas.getRawDataType());
     241        ItemQuery<Formula> ratio = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION,
     242          bas.getRawDataType(), bas.getIntensityTransform());
    242243        ratio.restrict(Restrictions.eq(Hql.property("name"), Expressions.string("Ratio, ch1 / ch2")));
    243244        if (ratio.count(dc) < 1)
  • trunk/src/test/net/sf/basedb/test/performance/Util.java

    r4806 r4917  
    103103  {
    104104    TestUtil.write("--Loading formula: " + name + "\n");
    105     ItemQuery<Formula> query = Formula.getQuery(type, rdt);
     105    ItemQuery<Formula> query = Formula.getQuery(type, rdt, null);
    106106    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name)));
    107107    query.include(Include.SHARED);
  • trunk/src/test/net/sf/basedb/test/roles/Util.java

    r4625 r4917  
    268268  public static Formula findFormula(DbControl dc, RawDataType rdt, Formula.Type type, String name)
    269269  {
    270     ItemQuery<Formula> query = Formula.getQuery(type, rdt);
     270    ItemQuery<Formula> query = Formula.getQuery(type, rdt, null);
    271271    query.restrict(Restrictions.eq(Hql.property("name"), Expressions.string(name)));
    272272    query.include(Include.SHARED);
  • trunk/www/common/expression_builder.jsp

    r4916 r4917  
    3434  import="net.sf.basedb.core.ExtendedProperties"
    3535  import="net.sf.basedb.core.Formula"
     36  import="net.sf.basedb.core.IntensityTransform"
    3637  import="net.sf.basedb.core.ReporterList"
    3738  import="net.sf.basedb.core.ItemQuery"
     
    6768  {
    6869    BioAssaySet bas = bioAssaySetId == -1 ? null : BioAssaySet.getById(dc, bioAssaySetId);
     70    IntensityTransform transform = bas == null ? null : bas.getIntensityTransform();
    6971    int maxRawMappings = bas == null ? 1 : bas.getMaxRawMappingsForSpot();
    7072
    7173    List<TableColumn> spotProperties = new LinkedList<TableColumn>();
    72     DynamicUtil.addSpotColumns(spotProperties, dc, channels, null);
     74    DynamicUtil.addSpotColumns(spotProperties, dc, channels, transform);
    7375    List<TableColumn> rawProperties = new LinkedList<TableColumn>();
    7476    if (rawDataType != null)
    7577    {
    76       DynamicUtil.addFormulaColumns(spotProperties, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION, "", "", maxRawMappings == 1);
     78      DynamicUtil.addFormulaColumns(spotProperties, dc, rawDataType,
     79        Formula.Type.COLUMN_EXPRESSION, transform, "", "", maxRawMappings == 1);
    7780      if (bas != null) DynamicUtil.addExtraColumns(spotProperties, dc, bas, "", "", "[Xtra] ");
    7881      if (maxRawMappings == 1) DynamicUtil.addRawDataColumns(rawProperties, dc, rawDataType, "", "", "");
  • trunk/www/plugins/net/sf/basedb/plugins/jep_extra_value_calculator.jsp

    r4537 r4917  
    108108 
    109109  // Predefined formulas
    110   ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, rdt);
     110  ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_EXPRESSION, rdt,
     111      source.getIntensityTransform());
    111112  formulaQuery.order(Orders.asc(Hql.property("name")));
    112113  formulaQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
  • trunk/www/plugins/net/sf/basedb/plugins/jep_filter.jsp

    r4537 r4917  
    110110 
    111111  // Predefined formulas
    112   ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_RESTRICTION, rdt);
     112  ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_RESTRICTION, rdt,
     113      source.getIntensityTransform());
    113114  formulaQuery.order(Orders.asc(Hql.property("name")));
    114115  formulaQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
  • trunk/www/plugins/net/sf/basedb/plugins/jep_intensity_transformer.jsp

    r4537 r4917  
    3131  import="net.sf.basedb.core.BioAssaySet"
    3232  import="net.sf.basedb.core.Formula"
     33  import="net.sf.basedb.core.IntensityTransform"
    3334  import="net.sf.basedb.core.Job"
    3435  import="net.sf.basedb.core.ItemQuery"
     
    7980 
    8081  // Predefined formulas
    81   ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.INTENSITY_TRANSFORMATION, rdt);
     82  ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.INTENSITY_TRANSFORMATION, rdt,
     83      source.getIntensityTransform());
    8284  formulaQuery.order(Orders.asc(Hql.property("name")));
    8385  formulaQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
     
    106108        frm['parameter:ch'+ch+'.expression'].value = formulas[formulaId+'.'+ch];
    107109      }
     110      Forms.selectListOption(frm['parameter:resultTransform'], formulas[formulaId+'.resultTransform']);
    108111      frm.presets.selectedIndex = 0;
    109112    }
     
    152155      for (Formula f : formulas)
    153156      {
     157        IntensityTransform result = f.getResultIntensityTransform();
     158        %>
     159        formulas['<%=f.getId()%>.resultTransform'] = '<%=result == null ? "" : result.name()%>';
     160        <%
    154161        for (int ch = 1; ch <= rdt.getChannels(); ++ch)
    155162        {
     
    305312      }
    306313      %>
     314      <tr>
     315        <td style="text-align: right">Resulting transform</td>
     316        <td>
     317          <select name="parameter:resultTransform">
     318          <option value="">- same as source data -
     319          <%
     320          for (IntensityTransform t : IntensityTransform.values())
     321          {
     322            %>
     323            <option value="<%=t.name()%>"><%=t.toString()%>
     324            <%
     325          }
     326          %>
     327          </select>
     328        </td>
     329      </tr>
    307330      </table>
    308331    </div>
  • trunk/www/views/experiments/explorer/view/view.jsp

    r4916 r4917  
    115115  List<TableColumn> columns = new LinkedList<TableColumn>();
    116116  DynamicUtil.addFormulaColumns(columns, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION,
    117     "frm.", "", maxRawMappings == 1);
     117    transform, "frm.", "", maxRawMappings == 1);
    118118  DynamicUtil.addExtraColumns(columns, dc, bioAssaySet, "ev", "#", "[Xtra] ");
    119119  if (maxRawMappings == 1)
  • trunk/www/views/experiments/plotter/index.jsp

    r4916 r4917  
    8282  List<TableColumn> formulas = new LinkedList<TableColumn>();
    8383  DynamicUtil.addSpotColumns(formulas, dc, rdt.getChannels(), transform);
    84   DynamicUtil.addFormulaColumns(formulas, dc, rdt, Formula.Type.COLUMN_EXPRESSION, "", "", maxRawMappings == 1);
     84  DynamicUtil.addFormulaColumns(formulas, dc, rdt, Formula.Type.COLUMN_EXPRESSION,
     85      transform, "", "", maxRawMappings == 1);
    8586  DynamicUtil.addExtraColumns(formulas, dc, bas, "ev", "#", "[Xtra] ");
    8687  if (maxRawMappings == 1)
     
    100101 
    101102  StringBuilder filterOptions = new StringBuilder();
    102   ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_RESTRICTION, rdt);
     103  ItemQuery<Formula> formulaQuery = Formula.getQuery(Formula.Type.COLUMN_RESTRICTION, rdt, transform);
    103104  formulaQuery.order(Orders.asc(Hql.property("name")));
    104105  formulaQuery.include(Include.MINE, Include.SHARED, Include.IN_PROJECT, Include.OTHERS);
  • trunk/www/views/experiments/spotdata/list_spotdata.jsp

    r4916 r4917  
    104104  List<TableColumn> columns = new LinkedList<TableColumn>();
    105105  DynamicUtil.addSpotColumns(columns, dc, rawDataType.getChannels(), transform);
    106   DynamicUtil.addFormulaColumns(columns, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION, "frm.", "", true);
     106  DynamicUtil.addFormulaColumns(columns, dc, rawDataType, Formula.Type.COLUMN_EXPRESSION,
     107      transform, "frm.", "", true);
    107108  DynamicUtil.addExtraColumns(columns, dc, bioAssaySet, "ev", "#", "[Xtra] ");
    108109  DynamicUtil.addRawDataColumns(columns, dc, rawDataType, "raw.", "$", "[Raw] ");
Note: See TracChangeset for help on using the changeset viewer.