Changeset 4910


Ignore:
Timestamp:
Apr 29, 2009, 11:05:20 AM (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 this flag to bioassay set and made it possible to modify it in the web interface.

Location:
trunk
Files:
1 added
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/core/common-queries.xml

    r4889 r4910  
    34613461    </description>
    34623462  </query>
     3463  <query id="SET_INTENSITYTRANSFORM_ON_BIOASSAYSETS" type="HQL">
     3464    <sql>
     3465      UPDATE BioAssaySetData bas
     3466      SET bas.intensityTransform = :transform
     3467      WHERE bas.intensityTransform IS NULL
     3468    </sql>
     3469    <description>
     3470      An update query that sets the intensityTransform on all
     3471      bioassay sets that doesn't have a value.
     3472    </description>
     3473  </query>
    34633474</predefined-queries>
  • trunk/src/core/net/sf/basedb/core/BioAssaySet.java

    r4889 r4910  
    107107    {
    108108      bas.setDataCubeFilter(source.getDataCubeFilter());
     109      bas.setIntensityTransform(source.getIntensityTransform());
     110    }
     111    else
     112    {
     113      bas.setIntensityTransform(IntensityTransform.NONE);
    109114    }
    110115    return bas;
     
    541546  {
    542547    return getData().getDataCubeLayer().getDataCube().getMaxRawMappingsForSpot();
     548  }
     549 
     550  /**
     551    Get information about in what way the spot intensities has been
     552    transformed before they were stored in the database.
     553    @since 2.12
     554  */
     555  public IntensityTransform getIntensityTransform()
     556  {
     557    return IntensityTransform.fromValue(getData().getIntensityTransform());
     558  }
     559  /**
     560    Sets the transform used on the spot intensities before they were stored
     561    in the database. NOTE! Calling this method doesn't change the
     562    data in the database!
     563    @param transform The transform that was used to store the data
     564    @since 2.12
     565  */
     566  public void setIntensityTransform(IntensityTransform transform)
     567  {
     568    checkPermission(Permission.WRITE);
     569    if (transform == null) throw new InvalidUseOfNullException("transform");
     570    getData().setIntensityTransform(transform.getValue());
    543571  }
    544572 
  • trunk/src/core/net/sf/basedb/core/Install.java

    r4889 r4910  
    112112    method.
    113113  */
    114   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(69).intValue();
     114  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(70).intValue();
    115115 
    116116  public static synchronized void createTables(boolean update, final ProgressReporter progress)
  • trunk/src/core/net/sf/basedb/core/Update.java

    r4889 r4910  
    785785    </td>
    786786  </tr>
     787  <tr>
     788    <td>70</td>
     789    <td>
     790      Added:
     791      <ul>
     792      <li>{@link net.sf.basedb.core.data.BioAssaySetData#getIntensityTransform()}.
     793      </ul>
     794      The update sets the values for all existing bioassay sets to 0 (=no transform).
     795    </td>
     796  </tr>
    787797  </table>
    788798
     
    10721082        schemaVersion = setSchemaVersionInTransaction(session, 63);
    10731083      }
    1074       // Schemaversion 64-69 only updates the version number
    1075       if (schemaVersion < 69)
    1076       {
    1077         if (progress != null) progress.display((int)(68*progress_factor), "--Updating schema version: " + schemaVersion + " -> 69...");
    1078         schemaVersion = setSchemaVersionInTransaction(session, 69);
     1084      // Schemaversion 64-70 only updates the version number
     1085      if (schemaVersion < 70)
     1086      {
     1087        if (progress != null) progress.display((int)(69*progress_factor), "--Updating schema version: " + schemaVersion + " -> 70...");
     1088        schemaVersion = setSchemaVersionInTransaction(session, 70);
    10791089      }
    10801090     
     
    29822992        }
    29832993       
     2994        if (schemaVersion < 70)
     2995        {
     2996          // Set intensityTransform=0 on all bioassay sets
     2997          org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
     2998            "SET_INTENSITYTRANSFORM_ON_BIOASSAYSETS");
     2999          /*
     3000            UPDATE BioAssaySetData bas
     3001            SET bas.intensityTransform = :transform
     3002            WHERE bas.intensityTransform IS NULL
     3003          */
     3004          query.setInteger("transform", 0);
     3005          HibernateUtil.executeUpdate(query);
     3006        }
     3007       
    29843008        //  Commit the changes
    29853009        HibernateUtil.commit(tx);
  • trunk/src/core/net/sf/basedb/core/data/BioAssaySetData.java

    r4889 r4910  
    300300  }
    301301 
     302  private int intensityTransform;
     303  /**
     304    A flag indicating how the spot intensities has been transformed
     305    before it was stored in the database:
     306    0 = no transformation; 1 = 2-log; 2 = 10-log
     307    @hibernate.property column="`intensity_transform`" type="int" not-null="true"
     308    @since 2.12
     309  */
     310  public int getIntensityTransform()
     311  {
     312    return intensityTransform;
     313  }
     314  /**
     315    @since 2.12
     316  */
     317  public void setIntensityTransform(int intensityTransform)
     318  {
     319    this.intensityTransform = intensityTransform;
     320  }
     321 
    302322}
  • trunk/www/views/experiments/bioassaysets/edit_bioassayset.jsp

    r4889 r4910  
    4040  import="net.sf.basedb.core.PermissionDeniedException"
    4141  import="net.sf.basedb.core.BaseException"
     42  import="net.sf.basedb.core.IntensityTransform"
    4243  import="net.sf.basedb.clients.web.Base"
    4344  import="net.sf.basedb.clients.web.util.HTML"
     
    6869  final String requiredClazz = "class=\"text required\"";
    6970  %>
    70 
    7171  <base:page type="popup" title="<%=title%>">
    7272  <base:head scripts="tabcontrol.js,annotations.js" styles="tabcontrol.css">
     
    171171          size="40" maxlength="<%=BioAssaySet.MAX_NAME_LENGTH%>"></td>
    172172      </tr>
    173      
     173      <tr>
     174        <td class="prompt">Spot intensity<br>transformation</td>
     175        <td>
     176          <select name="intensityTransform">
     177          <%
     178          IntensityTransform transform = bioAssaySet.getIntensityTransform();
     179          for (IntensityTransform t : IntensityTransform.values())
     180          {
     181            String selected = transform == t ? "selected" : "";
     182            %>
     183            <option value="<%=t.name()%>" <%=selected%>><%=t.toString()%>
     184            <%
     185          }
     186          %>
     187          </select>
     188        </td>
     189      </tr>
    174190
    175191      <tr valign=top>
  • trunk/www/views/experiments/bioassaysets/index.jsp

    r4889 r4910  
    1 <%-- $Id$
     1
     2<%@page import="net.sf.basedb.core.IntensityTransform"%><%-- $Id$
    23  ------------------------------------------------------------------
    34  Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson
     
    203204      bas.setName(Values.getStringOrNull(request.getParameter("name")));
    204205      bas.setDescription(Values.getStringOrNull(request.getParameter("description")));
     206      bas.setIntensityTransform(IntensityTransform.valueOf(request.getParameter("intensityTransform")));
    205207
    206208      // Annotations tab
  • trunk/www/views/experiments/bioassaysets/view_bioassayset.jsp

    r4908 r4910  
    383383          <td><%=Base.getLinkedName(ID, experiment, false, writePermission)%>
    384384          (<%=experiment.getRawDataType()%>)</td>
     385        </tr>
     386        <tr>
     387          <td class="prompt">Intensity transformation</td>
     388          <td><%=bioAssaySet.getIntensityTransform().toString()%></td>
    385389        </tr>
    386390        <tr>
Note: See TracChangeset for help on using the changeset viewer.