Changeset 4080


Ignore:
Timestamp:
Jan 15, 2008, 2:58:53 PM (14 years ago)
Author:
Nicklas Nordborg
Message:

References #894: Support for array designs with other feature identification methods than coordinates

The functionality is now implemented. Test programs run fine with the COORDINATES method. Needs testing with the other methods. RawBioAssay?.updateArrayDesign needs to be recoded.

Location:
trunk
Files:
1 added
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/appendix/incompatible.xml

    r3944 r4080  
    4545    </para>
    4646  </note>
     47 
     48  <sect1 id="appendix.incompatible.2.6">
     49    <title>BASE 2.6 release</title>
     50   
     51    <bridgehead>Feature identification methods</bridgehead>
     52    <para>
     53      Array design features can now be identified by three different methods:
     54      COORDINATES, POSITION and EXTERNAL_ID. The coordinates method was the
     55      only one supported earlier.
     56    </para>
     57   
     58    <itemizedlist>
     59    <listitem>
     60      <para>
     61      Client and plug-in code that depends on features having unique COORDINATES
     62      may no longer work if used with an array design using a different identification method.
     63      Code that is, directly or indirectly, using a
     64      <classname docapi="net.sf.basedb.core">FeatureBatcher</classname> or
     65      <classname docapi="net.sf.basedb.core">RawDataBatcher</classname> are
     66      probably affected by this. For example, includes raw data importers which
     67      doesn't know how to set the position or the feature ID when those identification
     68      methods are used.
     69      </para>
     70    </listitem>
     71   
     72    <listitem>
     73      <para>
     74      The POSITION identification method will require a unqiue position number.
     75      This value used to be an auto-generated sequence starting at 1. The other
     76      identification methods will still do that, but when using the POSITION identification
     77      method the only requirement is that the position value is a unique positive integer.
     78      Client or plug-in code that depends on the position beeing a number between
     79      1 and the number of features may fail if used with an array design using
     80      the POSITION identification method.
     81      </para>
     82    </listitem>   
     83    </itemizedlist>
     84
     85  </sect1> 
    4786 
    4887  <sect1 id="appendix.incompatible.2.5">
  • trunk/doc/src/docbook/developerdoc/api_overview.xml

    r4078 r4080  
    19581958          from plates. In the first case the features on an array design
    19591959          are described by a reporter map. A reporter map is a file
    1960           that maps a coordinate on an array design to a reporter.
     1960          that maps a coordinate (block, meta-grid, row, column),
     1961          position or an external ID on an array design to a
     1962          reporter. Which method to use is given by the
     1963          <property>ArrayDesign.featureIdentificationMethod</property> property.
    19611964          The coordinate system on an array design is divided into blocks.
    19621965          Each block can be identified either by a <property>blockNumber</property>
     
    19651968          contains several <classname docapi="net.sf.basedb.core.data">FeatureData</classname> items, each
    19661969          one identified by a row and column coordinate. Platforms that doesn't
    1967           divide the array design into block should create a single super-block
    1968           that holds all features.
     1970          divide the array design into blocks or doesn't use the coordinate system at all
     1971          must still create a single super-block that holds all features.
    19691972        </para>
    19701973       
  • trunk/src/clients/migrate/net/sf/basedb/clients/migrate/ArrayBlockTransfer.java

    r3683 r4080  
    3333import net.sf.basedb.core.DbControl;
    3434import net.sf.basedb.core.FeatureBatcher;
     35import net.sf.basedb.core.FeatureIdentificationMethod;
    3536import net.sf.basedb.core.ItemNotFoundException;
    3637import net.sf.basedb.core.Plate;
     
    113114          ArrayDesign arrayDesign = ArrayDesign.getById(dc, base2Id);
    114115          PreparedStatement ps = prepareStatementFromFile("selectArrayBlocksByArrayType");
    115           FeatureBatcher featureBatcher = arrayDesign.getFeatureBatcher();
     116          FeatureBatcher featureBatcher = arrayDesign.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
    116117          log.debug("Setting batch size to: " + getBatchSize());
    117118          featureBatcher.setBatchSize(getBatchSize());
  • trunk/src/core/common-queries.xml

    r4006 r4080  
    30143014    </description>
    30153015  </query>
     3016 
     3017  <query id="SET_FEATUREIDENTIFICATIONMETHOD_ON_ARRAYDESIGNS" type="HQL">
     3018    <sql>
     3019      UPDATE ArrayDesignData ad
     3020      SET ad.featureIdentificationMethod = :method
     3021      WHERE ad.featureIdentificationMethod IS NULL
     3022    </sql>
     3023    <description>
     3024      A HQL query that set the featureIdentificationMethod property
     3025      on all array designs with a null value.
     3026    </description>
     3027  </query>
    30163028
    30173029</predefined-queries>
  • trunk/src/core/net/sf/basedb/core/ArrayDesign.java

    r4011 r4080  
    107107    ad.setName("New array design");
    108108    ad.setPlatform(platform);
     109    ad.getData().setFeatureIdentificationMethod(FeatureIdentificationMethod.NONE.getValue());
    109110    return ad;
    110111  }
     
    126127    ad.setName("New array design");
    127128    ad.setVariant(variant);
     129    ad.getData().setFeatureIdentificationMethod(FeatureIdentificationMethod.NONE.getValue());
    128130    return ad;
    129131  }
     
    422424
    423425  /**
     426    Get the method used to identify features on this array design.
     427    @return A <code>FeatureIdentificationMethod</code>
     428    @since 2.6
     429  */
     430  public FeatureIdentificationMethod getFeatureIdentificationMethod()
     431  {
     432    return FeatureIdentificationMethod.fromValue(getData().getFeatureIdentificationMethod());
     433  }
     434 
     435  /**
    424436    Get a query that returns the plates that are used by this arraydesign.
    425437    @return An {@link ItemQuery} object
     
    638650 
    639651  /**
     652    Get a feature batcher that uses the COORDINATES feature identification
     653    method.
     654    @deprecated Use {@link #getFeatureBatcher(FeatureIdentificationMethod)} instead
     655  */
     656  public FeatureBatcher getFeatureBatcher()
     657    throws PermissionDeniedException, BaseException
     658  {
     659    return getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
     660  }
     661
     662  /**
    640663    Get a feature batcher which can be used to add regular features to the
    641664    array design.   
     
    644667    file-only platform. The must store feature information in files
    645668    instead. See {@link Platform} and {@link DataFileType}.
     669    @param fiMethod The method to use for identifying features
    646670    @return The feature batcher of the array design.
    647671    @throws PermissionDeniedException If raw data has already been added
    648672      or the logged in user doesn't have write permission
    649673    @throws BaseException If there is another error
    650   */
    651   public FeatureBatcher getFeatureBatcher()
     674    @since 2.6
     675  */
     676  public FeatureBatcher getFeatureBatcher(FeatureIdentificationMethod fiMethod)
    652677    throws PermissionDeniedException, BaseException
    653678  {
     
    661686      throw new PermissionDeniedException("Features has already been added to "+this.getName());
    662687    }
     688    if (fiMethod == FeatureIdentificationMethod.NONE)
     689    {
     690      throw new InvalidDataException("Feature identification method NONE is not supported: " + this.getName());
     691    }
     692    getData().setFeatureIdentificationMethod(fiMethod.getValue());
    663693    if (featureBatcher == null)
    664694    {
  • trunk/src/core/net/sf/basedb/core/FeatureBatcher.java

    r4034 r4080  
    3434import java.sql.PreparedStatement;
    3535import java.sql.SQLException;
     36import java.util.HashSet;
     37import java.util.Set;
     38import java.util.TreeSet;
    3639
    3740/**
    3841  Batcher class for Features or AffyFeatures. A single instance can be used
    3942  for features belonging to a single {@link ArrayDesign}.
     43  <p>
     44  Create new {@link FeatureData} objects with either
     45  {@link #newFeature(ArrayDesignBlock, ReporterData)} or
     46  {@link #newFeature(ArrayDesignBlock, Well)}. Use the latter method if the array
     47  desing is connected to plates.
     48  <p>
     49  Depending on the {@link FeatureIdentificationMethod} used by the array design,
     50  you must set different properties on the <code>FeatureData</code> object.
     51 
     52  <ul>
     53  <li>NONE: Not supported
     54  <li>COORDINATES: {@link FeatureData#setRow(int)} and {@link FeatureData#setColumn(int)}
     55  <li>POSITION: {@link FeatureData#setPosition(int)}
     56  <li>EXTERNAL_ID: {@link FeatureData#setExternalId(String)}
     57  </ul>
     58 
     59  For all methods, each feature that is inserted must have a unqiue value. For example,
     60  there can't be two features with the same external ID if the EXTERNAL_ID method is
     61  used. Values for the methods that are not used can still be set and saved to the
     62  database, but the uniqueness is not checked. The position number will be auto-generated
     63  (and overwritten) if the identification method is not POSITION.
    4064 
    4165  @base.modified $Date$
     
    76100  private final ArrayDesignData arrayDesignData;
    77101 
     102  private final FeatureIdentificationMethod fiMethod;
     103 
     104  /**
     105    Holds identification of already inserted features.
     106  */
     107  private Set<Object> featureIds;
     108 
    78109  /**
    79110    Keeps track of the position number.
     
    81112  private int currentPosition = 0;
    82113
     114  @SuppressWarnings("unchecked")
    83115  FeatureBatcher(DbControl dc, ArrayDesign arrayDesign)
    84116    throws BaseException
     
    87119    this.arrayDesign = arrayDesign;
    88120    this.arrayDesignData = arrayDesign.getData();
     121    this.fiMethod = arrayDesign.getFeatureIdentificationMethod();
     122    this.featureIds = fiMethod.caseInsensitive() && HibernateUtil.getDbEngine().caseInsensitiveComparison() ?
     123      new TreeSet(String.CASE_INSENSITIVE_ORDER) : new HashSet();
    89124    setDbControl(dc);
    90125  }
     
    105140    <li>The data object is not null
    106141    <li>An array design block has been specfied
     142    <li>The postion number is > 0
     143    <li>The external id is not null or too long
     144    <li>The feature identification is unique
    107145    <li>The data object belongs to the correct array design
    108146    <li>The reporter match the well's reporter if a well has been specified
    109     <li>
    110147    </ul>
    111148  */
     
    116153    if (data == null) throw new InvalidUseOfNullException("data");
    117154
     155    // Array design block must be set
    118156    ArrayDesignBlockData adb = (ArrayDesignBlockData)getPropertyValue(data, "arrayDesignBlock");
    119157    if (adb == null) throw new InvalidUseOfNullException("arrayDesignBlock");
    120158   
     159    // Position must be > 0
     160    if (data.getPosition() <= 0)
     161    {
     162      throw new NumberOutOfRangeException("position", data.getPosition(), 1, false);
     163    }
     164
     165    // External ID must not be too long
     166    data.setExternalId(StringUtil.setNullableString(data.getExternalId(),
     167      "externalId", FeatureData.MAX_EXTERNAL_ID_LENGTH));
     168
     169    // Feature identifier must be unique
     170    Object featureId = fiMethod.getIdentifier(data);
     171    if (featureIds.contains(featureId))
     172    {
     173      throw new InvalidDataException("Another feature with the same identifier already exists: " +
     174        fiMethod.toString() + "=" + featureId);
     175    }
     176    featureIds.add(featureId);
     177
    121178    // verify that the data object belongs to the correct raw bioassay
    122179    if (!arrayDesignData.equals(adb.getArrayDesign()))
     
    144201    throws BaseException
    145202  {
    146     setPropertyValue(data, "position", ++currentPosition);
     203    if (fiMethod != FeatureIdentificationMethod.POSITION)
     204    {
     205      data.setPosition(++currentPosition);
     206    }
    147207    super.insert(data);
    148208  }
  • trunk/src/core/net/sf/basedb/core/Install.java

    r4075 r4080  
    107107    method.
    108108  */
    109   public static final int NEW_SCHEMA_VERSION = Integer.valueOf(48).intValue();
     109  public static final int NEW_SCHEMA_VERSION = Integer.valueOf(49).intValue();
    110110 
    111111  public static synchronized void createTables(boolean update, final ProgressReporter progress)
  • trunk/src/core/net/sf/basedb/core/RawDataBatcher.java

    r4020 r4080  
    146146  private org.hibernate.Query findReporter;
    147147
    148   /*
     148  /**
     149    The method to use for identifying features.
     150  */
     151  private FeatureIdentificationMethod fiMethod;
     152 
     153  /**
    149154    Holds info about the features of an array design. Using the
    150     coordinates we can look up position number and reporter on
     155    feature identifier we can look up position number and reporter on
    151156    each location and verify this against the raw data.
    152   */
    153   private final Map<FeatureCoordinate, FeatureData> preloaded;
     157    @see FeatureIdentificationMethod
     158  */
     159  private final Map<Object, FeatureData> preloaded;
    154160 
    155161  /**
     
    171177      throw new BaseException("Raw data for raw data type '" + rawDataType + "' is not stored in the database.");
    172178    }
    173    
    174     if (arrayDesign != null && arrayDesign.getHasFeatures())
     179
     180    this.fiMethod = arrayDesign != null && arrayDesign.getHasFeatures() ?
     181        FeatureIdentificationMethod.fromValue(arrayDesign.getFeatureIdentificationMethod()) :
     182        FeatureIdentificationMethod.NONE;
     183
     184    if (fiMethod != FeatureIdentificationMethod.NONE)
    175185    {
    176186      org.hibernate.Query query = HibernateUtil.getPredefinedQuery(dc.getStatelessSession(), "COUNT_FEATURES_FOR_ARRAYDESIGN");
     
    182192      query.setInteger("arrayDesign", arrayDesign.getId());
    183193      int numFeatures = HibernateUtil.loadData(Long.class, query).intValue();
    184       preloaded = new HashMap<FeatureCoordinate, FeatureData>(numFeatures);
     194      preloaded = new HashMap<Object, FeatureData>(numFeatures);
    185195      query = HibernateUtil.getPredefinedQuery(dc.getStatelessSession(), "PRELOAD_FEATURES");
    186196      /*
     
    196206      while (si.hasNext())
    197207      {
    198         FeatureData f = si.next();
    199         FeatureCoordinate fc = Feature.getFeatureCoordinate(f);
    200         preloaded.put(fc, f);
     208        FeatureData feature = si.next();
     209        Object featureId = fiMethod.getIdentifier(feature);
     210        preloaded.put(featureId, feature);
    201211      }
    202212      si.close();
     
    223233    <li>The data object is not null
    224234    <li>The data object belongs to the correct raw bioassay
     235    <li>The position value is > 0
    225236    <li>All of the extra properties using the
    226237      {@link ExtendedProperty#validateValue(Object)} method
     
    231242  {
    232243    if (data == null) throw new InvalidUseOfNullException("data");
     244
     245    // Position must be > 0
     246    if (data.getPosition() <= 0)
     247    {
     248      throw new NumberOutOfRangeException("position", data.getPosition(), 1, false);
     249    }
    233250   
    234251    // verify that the data object belongs to the correct raw bioassay
     
    252269    throws BaseException
    253270  {
    254     doInsert(data, null, false);
     271    doInsert(data, null, null, false);
    255272  }
    256273 
     
    337354  /**
    338355    Insert a raw data spot and verify the external id of the
    339     reporter. The external id is only verified if the raw bioassauy
     356    reporter. The external id is only verified if the raw bioassay
    340357    is connected to an array design with features. The external id
    341358    is verified to match the external id of the reporter attached to
     
    348365      be found at the feature of this spot
    349366    @throws BaseException If the insertion failed.
     367    @deprecated
    350368  */
    351369  public void insert(RawData data, String externalReporterId)
    352370    throws BaseException
    353371  {
    354     doInsert(data, externalReporterId, true);
    355   }
    356 
     372    doInsert(data, externalReporterId, null, true);
     373  }
     374
     375  public void insert(RawData data, String externalReporterId, String externalFeatureId)
     376  {
     377    doInsert(data, externalReporterId, externalFeatureId, true);
     378  }
     379 
    357380  /**
    358381    Do the actual insert.
    359382  */
    360   void doInsert(RawData data, String externalReporterId, boolean validateReporterId)
     383  void doInsert(RawData data, String externalReporterId, String externalFeatureId, boolean validateReporterId)
    361384    throws BaseException
    362385  {
     
    364387    if (preloaded == null)
    365388    {
    366       setPropertyValue(data, "position", ++currentPosition);
     389      if (data.getPosition() == 0) data.setPosition(++currentPosition);
    367390      // If no reporter has been set on the RawData object we try to find the external id
    368391      if (externalReporterId != null && data.getReporter() == null)
     
    384407    else
    385408    {
    386       FeatureCoordinate fc = new FeatureCoordinate(data.getBlock(), data.getMetaGridX(),
    387         data.getMetaGridY(), data.getRow(), data.getColumn());
    388       FeatureData f = preloaded.get(fc);
     409      Object featureId = fiMethod.getIdentifier(data, externalFeatureId);
     410      FeatureData f = preloaded.get(featureId);
    389411      if (f == null)
    390412      {
    391         throw new ItemNotFoundException("Feature[row="+data.getRow()+", column="+data.getColumn()+
    392           ", block="+data.getBlock()+", metaGridX="+data.getMetaGridX()+", metaGridY="+data.getMetaGridY()+
    393           "]");
     413        throw new ItemNotFoundException("Feature["+ fiMethod.toString() + "=" + featureId + "]");
    394414      }
    395415      ReporterData r = f.getReporter();
     
    404424        }
    405425      }
    406       setPropertyValue(data, "position", f.getPosition());
     426      data.setPosition(f.getPosition());
    407427      setPropertyValue(data, "feature", f);
    408428      data.setReporter(r);
  • trunk/src/core/net/sf/basedb/core/Update.java

    r4075 r4080  
    553553    </td>
    554554  </tr>
     555
     556  <tr>
     557    <td>49</td>
     558    <td>
     559      <ul>
     560      <li>Added {@link net.sf.basedb.core.data.FeatureData#getExternalId()}
     561      <li>Added {@link net.sf.basedb.core.data.ArrayDesignData#getFeatureIdentificationMethod()}
     562      </ul>
     563      The update sets the identification method to COORDINATES for all existing
     564      array designs, and deletes the unique index on row, column, block on
     565      the Features table.
     566    </td>
     567  </tr>
     568 
    555569  </table>
    556570
     
    779793      }
    780794     
    781       if (schemaVersion < 46)
    782       {
    783         if (progress != null) progress.display((int)(45*progress_factor), "--Updating schema version: " + schemaVersion + " -> 46...");
    784         schemaVersion = setSchemaVersionInTransaction(session, 46);
    785       }
    786 
    787       if (schemaVersion < 47)
    788       {
    789         if (progress != null) progress.display((int)(46*progress_factor), "--Updating schema version: " + schemaVersion + " -> 47...");
    790         schemaVersion = setSchemaVersionInTransaction(session, 47);
    791       }
    792      
     795      // Schemaversion 46-48 only updates the version number
    793796      if (schemaVersion < 48)
    794797      {
     
    797800      }
    798801
     802      if (schemaVersion < 49)
     803      {
     804        if (progress != null) progress.display((int)(48*progress_factor), "--Updating schema version: " + schemaVersion + " -> 49...");
     805        schemaVersion = updateToSchemaVersion49(session);
     806      }
     807     
     808     
    799809      sc.logout();
    800810      if (progress != null) progress.display(100, "Database updated successfully.");
     
    19771987    return schemaVersion;   
    19781988  }
     1989 
     1990  /**
     1991    Find the unique index on Feature (row, column and block) and remove it.
     1992   
     1993    @return The new schema version (=49)
     1994  */
     1995  private static int updateToSchemaVersion49(org.hibernate.Session session)
     1996    throws BaseException
     1997  {
     1998    final int schemaVersion = 49;
     1999    org.hibernate.Transaction tx = null;
     2000    try
     2001    {
     2002      Connection connection = HibernateUtil.getConnection(session);
     2003      DatabaseMetaData metaData = null;
     2004      TableInfo info = null;
     2005      try
     2006      {
     2007        metaData = connection.getMetaData();
     2008        Table table = new Table("Features");
     2009        info = new TableInfo(table, metaData);
     2010      }
     2011      catch (SQLException ex)
     2012      {
     2013        throw new BaseException(ex);
     2014      }
     2015 
     2016      tx = HibernateUtil.newTransaction(session);
     2017      DbEngine dbEngine = HibernateUtil.getDbEngine();
     2018      String indexName = info.findIndexName("uniquecoordinate",
     2019        new HashSet<String>(Arrays.asList(new String[] {"arraydesignblock_id", "row", "column"})));
     2020      if (indexName != null)
     2021      {
     2022        String sql = dbEngine.getDropIndexSql(null, null, "Features", indexName, true);
     2023        try
     2024        {
     2025          Statement st = connection.createStatement();
     2026          log.info("Dropping index: " + sql);
     2027          st.executeUpdate(sql);
     2028          st.close();
     2029        }
     2030        catch (SQLException ex)
     2031        {
     2032          throw new BaseException(ex);
     2033        }
     2034      }
     2035 
     2036      // Update the schema version number
     2037      setSchemaVersion(session, schemaVersion);
     2038 
     2039      // Commit the changes
     2040      HibernateUtil.commit(tx);
     2041      log.info("updateToSchemaVersion49: OK");
     2042    }
     2043    catch (BaseException ex)
     2044    {
     2045      if (tx != null) HibernateUtil.rollback(tx);
     2046      log.error("updateToSchemaVersion49: FAILED", ex);
     2047      throw ex;
     2048    }
     2049    return schemaVersion;
     2050  }
    19792051 
    19802052  /**
     
    23482420          */
    23492421          HibernateUtil.executeUpdate(query);
    2350         }       
     2422        }
     2423       
     2424        if (schemaVersion < 49)
     2425        {
     2426          // Set featureIdentificationMethod to COORDINATE for all array designs
     2427          org.hibernate.Query query = HibernateUtil.getPredefinedQuery(session,
     2428            "SET_FEATUREIDENTIFICATIONMETHOD_ON_ARRAYDESIGNS");
     2429          /*
     2430            UPDATE ArrayDesignData ad
     2431            SET ad.featureIdentificationMethod = :method
     2432            WHERE ad.featureIdentificationMethod IS NULL
     2433          */
     2434          query.setInteger("method", FeatureIdentificationMethod.COORDINATES.getValue());
     2435          HibernateUtil.executeUpdate(query);
     2436        }
    23512437       
    23522438        //  Commit the changes
  • trunk/src/core/net/sf/basedb/core/data/ArrayDesignData.java

    r3948 r4080  
    156156  }
    157157 
     158  private int featureIdentificationMethod;
     159  /**
     160    The method to use for identiying features.
     161    1 = COORDINATES, 2 = POSITION, 3 = EXTERNAL_ID
     162    @hibernate.property column="`identification_method`" type="int" not-null="true"
     163    @since 2.6
     164  */
     165  public int getFeatureIdentificationMethod()
     166  {
     167    return featureIdentificationMethod;
     168  }
     169  public void setFeatureIdentificationMethod(int featureIdentificationMethod)
     170  {
     171    this.featureIdentificationMethod = featureIdentificationMethod;
     172  }
     173 
     174 
    158175  private Set<ArrayDesignBlockData> arrayDesignBlocks;
    159176  /**
  • trunk/src/core/net/sf/basedb/core/data/FeatureData.java

    r3948 r4080  
    6767    Get the column coordinate of the feature.
    6868    @hibernate.property type="int" update="false"
    69     @hibernate.column name="`column`" not-null="true" unique-key="uniquecoordinate"
     69    @hibernate.column name="`column`" not-null="true"
    7070  */
    7171  public int getColumn()
     
    8383    Get the row coordinate of the feature.
    8484    @hibernate.property type="int" update="false"
    85     @hibernate.column name="`row`" not-null="true" unique-key="uniquecoordinate"
     85    @hibernate.column name="`row`" not-null="true"
    8686  */
    8787  public int getRow()
     
    104104    return position;
    105105  }
    106   void setPosition(int position)
     106  /**
     107    This method was private until 2.6. The value will be overwritten with an
     108    autogenerated value unless the feature identification method is POSITION.
     109    The value must be a positive integer.
     110    @since 2.6
     111  */
     112  public void setPosition(int position)
    107113  {
    108114    this.position = position;
    109115  }
    110116
     117  /**
     118    The maximum length of the external ID that can be stored in the database.
     119    @see #setExternalId(String)
     120  */
     121  public static final int MAX_EXTERNAL_ID_LENGTH = 255;
     122  private String externalId;
     123  /**
     124    Get the external id for this <code>FeatureData</code> item. If given,
     125    it must be unique per array design.
     126    @return The features external ID.
     127    @hibernate.property column="`external_id`" type="string" length="255" not-null="false" update="false"
     128    @since 2.6
     129  */
     130  public String getExternalId()
     131  {
     132    return externalId;
     133  }
     134  public void setExternalId(String externalId)
     135  {
     136    this.externalId = externalId;
     137  }
     138 
    111139  private ArrayDesignBlockData arrayDesignBlock;
    112140  /**
     
    115143
    116144    @hibernate.many-to-one outer-join="false" update="false"
    117     @hibernate.column name="`arraydesignblock_id`" not-null="true" unique-key="uniquecoordinate"
     145    @hibernate.column name="`arraydesignblock_id`" not-null="true"
    118146  */
    119147  ArrayDesignBlockData getArrayDesignBlock()
  • trunk/src/core/net/sf/basedb/core/data/RawData.java

    r3948 r4080  
    116116    return position;
    117117  }
    118   void setPosition(int position)
     118  /**
     119    This method was private before 2.6. If the raw bioassay is connected to
     120    an array design which uses the POSITION feature identifier method
     121    a value must be set. If the raw bioassay is connected to an array design
     122    which uses another feature identifier method this value will be overwritten
     123    with the position value from the feature. If the raw bioassay is not connected
     124    to an array design a position will be automatically generated if no value
     125    has been set, ie. if the value is 0.
     126    The value must be a positive integer.
     127    @param position The position number of the spot
     128    @since 2.6
     129  */
     130  public void setPosition(int position)
    119131  {
    120132    this.position = position;
  • trunk/src/plugins/core/net/sf/basedb/plugins/IlluminaRawDataImporter.java

    r3820 r4080  
    4343import net.sf.basedb.core.DbControl;
    4444import net.sf.basedb.core.Experiment;
     45import net.sf.basedb.core.FeatureIdentificationMethod;
    4546import net.sf.basedb.core.File;
    4647import net.sf.basedb.core.Include;
     
    9293  to an experiment.
    9394  <p>
    94   Since the data files doesn't have any coordinate information, the plug-in create
    95   fake coordinates like this: block=1, column=1, row=linenumber in file.
    96   The linenmbers start with 1 at the first data line, ie. header lines are not counted.
     95  Since the data files doesn't have any coordinate information the importer will
     96  use one of the following methods.
     97 
     98  <ul>
     99  <li>
     100    If no array design has been selected or if the array design is using the
     101    {@link FeatureIdentificationMethod#COORDINATES} method for identifying features:
     102    The plug-in create fake coordinates like this: block=1, column=1, row=linenumber in file.
     103    The linenmbers start with 1 at the first data line, ie. header lines are not counted.
     104
     105  <li>
     106    If the array design uses the {@link FeatureIdentificationMethod#POSITION}
     107    method for identiyfing features: The plug-in sets the position=line number in file.
     108    The linenmbers start with 1 at the first data line, ie. header lines are not counted.
     109   
     110  <li>
     111    If the array design uses the {@link FeatureIdentificationMethod#EXTERNAL_ID}
     112    method for identifying features. The plug-in assumes that the feature ID is the
     113    same as the reporter ID.
     114  </ul>
     115 
     116  <p>
     117  NOTE! Since the methods are not conflicting with each other, there will not
     118  be an actual check which method to use by this plug-in. We will simple set all
     119  values as specified above and let the BASE core handle the identification.
    97120
    98121  @author nicklas
     
    417440  {
    418441    String externalId = reporterMapper.getValue(data);
     442    int lineNo = data.dataLineNo();
    419443    for (BatchAndMapHolder holder : holders)
    420444    {
    421445      RawData raw = holder.batcher.newRawData();
     446      raw.setPosition(lineNo);
    422447      raw.setBlock(1);
    423448      raw.setColumn(1);
    424       raw.setRow(data.dataLineNo());
     449      raw.setRow(lineNo);
    425450      for (Map.Entry<RawDataProperty, Mapper> entry : holder.mappers.entrySet())
    426451      {
     
    429454        raw.setExtended(ep.getName(), ep.parseString(m.getValue(data), numberFormat, nullIfException));
    430455      }
    431       holder.batcher.insert(raw, externalId);
     456      holder.batcher.insert(raw, externalId, externalId);
    432457    }
    433458    numInserted++;
  • trunk/src/plugins/core/net/sf/basedb/plugins/PrintMapFlatFileImporter.java

    r3820 r4080  
    3333import net.sf.basedb.core.DbControl;
    3434import net.sf.basedb.core.FeatureBatcher;
     35import net.sf.basedb.core.FeatureIdentificationMethod;
    3536import net.sf.basedb.core.File;
    3637import net.sf.basedb.core.FileParameterType;
     
    326327    }
    327328   
    328     batcher = arrayDesign.getFeatureBatcher();
     329    batcher = arrayDesign.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
    329330    numFeatures = 0;
    330331    numBlocks = 0;
  • trunk/src/plugins/core/net/sf/basedb/plugins/RawDataFlatFileImporter.java

    r3979 r4080  
    5050import net.sf.basedb.core.RequestInformation;
    5151import net.sf.basedb.core.StringParameterType;
     52import net.sf.basedb.core.data.FeatureData;
    5253import net.sf.basedb.core.data.RawData;
    5354import net.sf.basedb.core.data.ReporterData;
     
    115116  private static final StringParameterType requiredColumnMapping = new StringParameterType(255, null, true);
    116117 
     118  private static final PluginParameter<String> positionColumnMapping = new PluginParameter<String>(
     119    "positionColumnMapping",
     120    "Position",
     121    "Mapping that picks the spot's position from the data columns. This column is only " +
     122    "used when the raw data is connected to an array design which uses the POSITION method " +
     123    "for identifying features. If the raw data is not connected to an array design " +
     124    "position values will automatically be generated if no mapping has been specified. In all" +
     125    "cases, position value must be unique." +
     126    "Mapping example: \\Position\\",
     127    optionalColumnMapping
     128    );
     129
     130 
    117131  private static final PluginParameter<String> blockColumnMapping = new PluginParameter<String>(
    118132    "blockColumnMapping",
    119133    "Block",
    120     "Mapping that picks the spot's block from the data columns. " +
     134    "Mapping that picks the spot's block number from the data columns. This column is only " +
     135    "used when the raw data is connected to an array design which uses the COORDINATES method " +
     136    "for identifying features. In all other cases, the value is stored as is." +
    121137    "For example: \\Block\\",
    122138    optionalColumnMapping
     
    126142    "columnColumnMapping",
    127143    "Column",
    128     "Mapping that picks the spot's column in the block from the data columns. " +
     144    "Mapping that picks the spot's column coordinate from the data columns. This column is only " +
     145    "used when the raw data is connected to an array design which uses the COORDINATES method " +
     146    "for identifying features. In all other cases, the value is stored as is." +
    129147    "For example: \\Column\\",
    130148    optionalColumnMapping
     
    134152    "rowColumnMapping",
    135153    "Row",
    136     "Mapping that picks the spot's row in the block from the data columns. " +
     154    "Mapping that picks the spot's row coordinate from the data columns. This column is only " +
     155    "used when the raw data is connected to an array design which uses the COORDINATES method " +
     156    "for identifying features. In all other cases, the value is stored as is." +
    137157    "For example: \\Row\\",
    138158    optionalColumnMapping
     
    142162    "metaGridXColumnMapping",
    143163    "MetaGridX",
    144     "Mapping that picks the spot's meta-Grid X-axis from the data columns. " +
     164    "Mapping that picks the spot's meta-Grid X-axis from the data columns. This column is only " +
     165    "used when the raw data is connected to an array design which uses the COORDINATES method " +
     166    "for identifying features. In all other cases, the value is stored as is." +
    145167    "For example: \\Meta grid X\\",
    146168    optionalColumnMapping
     
    150172    "metaGridYColumnMapping",
    151173    "MetaGridY",
    152     "Mapping that picks the spot's meta-Grid Y-axis from the data columns. " +
     174    "Mapping that picks the spot's meta-Grid Y-axis from the data columns. This column is only " +
     175    "used when the raw data is connected to an array design which uses the COORDINATES method " +
     176    "for identifying features. In all other cases, the value is stored as is." +
    153177    "For example: \\Meta grid Y\\",
    154178    optionalColumnMapping
     
    178202    requiredColumnMapping
    179203    );
     204
     205  private static final PluginParameter<String> featureIdColumnMapping = new PluginParameter<String>(
     206      "featureIdColumnMapping",
     207      "Feature ID",
     208      "Mapping that picks the spot's feature ID from the data columns. " +
     209      "This column is only used when the raw data is connected to an array design " +
     210      "which uses the EXTERNAL_ID method for identifying features. The value is not saved " +
     211      "to the database." +
     212      "For example: \\Feature ID\\",
     213      optionalColumnMapping
     214    );
     215 
    180216 
    181217  protected static final PluginParameter<String> missingReporterErrorParameter = new PluginParameter<String>(
     
    226262  private FileSetMember rawDataMember;
    227263
     264  private Mapper featureIdMapper;
    228265  private Mapper reporterMapper;
     266  private Mapper positionMapper;
    229267  private Mapper blockMapper;
    230268  private Mapper columnMapper;
     
    529567    reporterMapper = getMapper(ffp, (String)configuration.getValue("reporterIdColumnMapping"),
    530568      cropStrings ? ReporterData.MAX_EXTERNAL_ID_LENGTH : null, nullMapper);
    531 
     569   
     570    featureIdMapper = getMapper(ffp, (String)configuration.getValue("featureIdColumnMapping"),
     571      cropStrings ? FeatureData.MAX_EXTERNAL_ID_LENGTH : null, nullMapper);
     572
     573    positionMapper = getMapper(ffp, (String)configuration.getValue("positionColumnMapping"), null, nullMapper);
    532574    blockMapper = getMapper(ffp, (String)configuration.getValue("blockColumnMapping"), null, nullMapper);
    533575    columnMapper = getMapper(ffp, (String)configuration.getValue("columnColumnMapping"), null, nullMapper);
     
    584626
    585627    String externalId = reporterMapper.getValue(data);
     628    String featureId = featureIdMapper.getValue(data);
     629    Integer position = positionMapper.getInt(data);
     630    if (position != null) raw.setPosition(position);
    586631    raw.setBlock(blockMapper.getInt(data));
    587632    raw.setColumn(columnMapper.getInt(data));
     
    599644    }
    600645
    601     batcher.insert(raw, externalId);
     646    batcher.insert(raw, externalId, featureId);
    602647    numInserted++;
    603648  }
     
    633678    {
    634679      allColumnMappings = new ArrayList<PluginParameter<String>>();
     680      allColumnMappings.add(positionColumnMapping);
    635681      allColumnMappings.add(blockColumnMapping);
    636682      allColumnMappings.add(columnColumnMapping);
     
    641687      allColumnMappings.add(yColumnMapping);
    642688      allColumnMappings.add(reporterIdColumnMapping);
     689      allColumnMappings.add(featureIdColumnMapping);
    643690      for(RawDataProperty rdp : rdt.getProperties())
    644691      {
  • trunk/src/plugins/core/net/sf/basedb/plugins/ReporterMapFlatFileImporter.java

    r4076 r4080  
    3333import net.sf.basedb.core.DbControl;
    3434import net.sf.basedb.core.FeatureBatcher;
     35import net.sf.basedb.core.FeatureIdentificationMethod;
    3536import net.sf.basedb.core.File;
    3637import net.sf.basedb.core.FileParameterType;
     
    3839import net.sf.basedb.core.FileStoreUtil;
    3940import net.sf.basedb.core.FileType;
     41import net.sf.basedb.core.InvalidDataException;
    4042import net.sf.basedb.core.InvalidUseOfNullException;
    4143import net.sf.basedb.core.ItemContext;
     
    9496      "Reporter map importer",
    9597      "This plugin is used to import features to an ArrayDesign from a simple flat file.",
    96       "2.0",
     98      "2.6",
    9799      "2006, Base 2 development team",
    98100      null,
     
    109111  private static final StringParameterType optionalColumnMapping = new StringParameterType(255, null, false);
    110112 
    111 
     113  private static final PluginParameter<String> featureIdentificationParameter =
     114    new PluginParameter<String>(
     115      "featureIdentification",
     116      "Identify features by",
     117      "Choose which method to use for identifying features: \n" +
     118      "COORDINATES: Use block, meta-grid, row and column coordinates\n" +
     119      "POSITION: Use a position number only\n" +
     120      "EXTERNAL_ID: Use the feature ID value (string)\n" +
     121      "In all cases, the identifier value must be unique.",
     122      new StringParameterType(255, "COORDINATES", true, 1, 0, 0,
     123        Arrays.asList(new String[] {"COORDINATES", "POSITION", "EXTERNAL_ID"}))
     124    );
     125 
    112126  private static final PluginParameter<String> reporterIdColumnMapping = new PluginParameter<String>(
    113127    "reporterIdColumnMapping",
     
    117131    requiredColumnMapping
    118132    );
    119 
     133 
     134  private static final PluginParameter<String> featureIdColumnMapping = new PluginParameter<String>(
     135    "featureIdColumnMapping",
     136    "Feature ID",
     137    "Mapping that picks the feature's ID from the data columns. This column is " +
     138    "only used when the array design uses the EXTERNAL_ID method for " +
     139    "identifying features. In the other cases, the value is just stored as it is." +
     140    "For example: \\Feature ID\\",
     141    optionalColumnMapping
     142    );
     143
     144  private static final PluginParameter<String> positionColumnMapping = new PluginParameter<String>(
     145    "positionColumnMapping",
     146    "Position",
     147    "Mapping that picks the feature's position from the data columns. This column is only " +
     148    "used when the array design uses the POSITION method " +
     149    "for identifying features. The other identification methods will always " +
     150    "overwrite the position with an autogenerated value." +
     151    "Mapping example: \\Position\\",
     152    optionalColumnMapping
     153    );
     154 
     155 
    120156  private static final PluginParameter<String> blockColumnMapping = new PluginParameter<String>(
    121157    "blockColumnMapping",
    122158    "Block",
    123     "Mapping that picks the feature's block number from the data columns. "+
    124     "You must specify either this mapping or mappings for the meta coordinates. " +
     159    "Mapping that picks the feature's block number from the data columns. This column is only " +
     160    "used when the array design uses the COORDINATES method " +
     161    "for identifying features. In the other cases, the value is just stored as it is. " +
     162    "You must specify either this mapping or mappings for the meta coordinates when using " +
     163    "the COORDINATES method. " +
    125164    "Example: \\Block\\",
    126165    optionalColumnMapping
     
    130169    "metaGridXColumnMapping",
    131170    "Meta grid X",
    132     "Mapping that picks the feature's meta grid X coordinate from the data columns. "+
    133     "Required if you don't specify a block mapping. Example: \\Meta grid X\\",
     171    "Mapping that picks the feature's meta grid X coordinate from the data columns. This column is only " +
     172    "used when the array design uses the COORDINATES method " +
     173    "for identifying features. In the other cases, the value is just stored as it is. " +
     174    "You must specify either this mapping or mappings for the block number when using " +
     175    "the COORDINATES method. Example: \\Meta grid X\\",
    134176    optionalColumnMapping
    135177    );
     
    138180    "metaGridYColumnMapping",
    139181    "Meta grid Y",
    140     "Mapping that picks the feature's meta grid Y coordinate from the data columns. " +
    141     "Required if you don't specify a block mapping. Example: \\Meta grid Y\\",
     182    "Mapping that picks the feature's meta grid Y coordinate from the data columns. This column is only " +
     183    "used when the array design uses the COORDINATES method " +
     184    "for identifying features. In the other cases, the value is just stored as it is. " +
     185    "You must specify either this mapping or mappings for the block number when using " +
     186    "the COORDINATES method. Example: \\Meta grid Y\\",
    142187    optionalColumnMapping
    143188    );
     
    147192    "Column",
    148193    "Mapping that picks the feature's column position in a block from the data columns. " +
    149     "For example: \\Column\\",
    150     requiredColumnMapping
     194    "This column is only used when the array design uses the COORDINATES method " +
     195    "for identifying features. In the other cases, the value is just stored as it is. " +
     196    "This value is required when using the COORDINATES method. Example: \\Column\\",
     197    optionalColumnMapping
    151198    );
    152199 
     
    155202    "Row",
    156203    "Mapping that picks the feature's row position in a block from the data columns. " +
    157     "For example: \\Row\\",
    158     requiredColumnMapping
     204    "This column is only used when the array design uses the COORDINATES method " +
     205    "for identifying features. In the other cases, the value is just stored as it is. " +
     206    "This value is required when using the COORDINATES method. Example: \\Row\\",
     207    optionalColumnMapping
    159208    );
    160209 
     
    190239  private boolean errorIfNotFound;
    191240  private Mapper reporterMapper;
     241  private Mapper featureIdMapper;
     242  private Mapper positionMapper;
    192243  private Mapper blockMapper;
    193244  private Mapper columnMapper;
     
    328379        }
    329380       
    330         // Check that either block or meta coordinates have been mapped
    331         String blockMapping = (String)request.getParameterValue("blockColumnMapping");
    332         String metaGridXMapping = (String)request.getParameterValue("metaGridXColumnMapping");
    333         String metaGridYMapping = (String)request.getParameterValue("metaGridYColumnMapping");
    334         if (blockMapping == null && (metaGridXMapping == null || metaGridYMapping == null))
     381        // Check that enough mappings have been set for the
     382        // specific feature identification method
     383        String fiParameter = (String)request.getParameterValue("featureIdentification");
     384        FeatureIdentificationMethod fiMethod = fiParameter == null ?
     385          FeatureIdentificationMethod.COORDINATES :
     386          FeatureIdentificationMethod.valueOf(fiParameter);
     387       
     388        List<Throwable> mapErrors = new ArrayList<Throwable>();
     389        if (fiMethod == FeatureIdentificationMethod.COORDINATES)
    335390        {
    336           response.setError("You must at least map either block or meta coordinates to columns.", null);
     391          String blockMapping = (String)request.getParameterValue("blockColumnMapping");
     392          String metaGridXMapping = (String)request.getParameterValue("metaGridXColumnMapping");
     393          String metaGridYMapping = (String)request.getParameterValue("metaGridYColumnMapping");
     394          String columnMapping = (String)request.getParameterValue("columnColumnMapping");
     395          String rowMapping = (String)request.getParameterValue("rowColumnMapping");
     396         
     397          if (blockMapping == null && (metaGridXMapping == null || metaGridYMapping == null))
     398          {
     399            mapErrors.add(new InvalidDataException("You must at least map either block or meta coordinates to columns."));
     400          }
     401          if (columnMapping == null)  mapErrors.add(new InvalidUseOfNullException("Column"));
     402          if (rowMapping == null) mapErrors.add(new InvalidUseOfNullException("Row"));
     403        }
     404        else if (fiMethod == FeatureIdentificationMethod.POSITION)
     405        {
     406          String positionMapping = (String)request.getParameterValue("positionColumnMapping");
     407          if (positionMapping == null) mapErrors.add(new InvalidUseOfNullException("Position"));
     408        }
     409        else if (fiMethod == FeatureIdentificationMethod.EXTERNAL_ID)
     410        {
     411          String positionMapping = (String)request.getParameterValue("featureIdColumnMapping");
     412          if (positionMapping == null) mapErrors.add(new InvalidUseOfNullException("Feature ID"));
     413        }
     414        else
     415        {
     416          response.setError("Unknown feature identification method: " + fiMethod, null);
    337417          return;
     418        }
     419        if (mapErrors.size() > 0)
     420        {
     421          response.setError("Missing column mapping for feature identification method: "
     422            + fiMethod, mapErrors);
    338423        }
    339424       
     
    350435
    351436        // Column mappings
     437        storeValue(configuration, request, featureIdentificationParameter);
    352438        storeValue(configuration, request, complexMappings);
    353439        boolean allowComplex = "allow".equals(request.getParameterValue(complexMappings.getName()));
     
    379465        storeValue(job, request, invalidUseOfNullErrorParameter);
    380466        storeValue(job, request, numberFormatErrorParameter);
     467        storeValue(job, request, stringTooLongErrorParameter);
    381468       
    382469        response.setDone("Job configuration complete", Job.ExecutionTime.SHORT);
     
    408495    File reporterMapFile = (File)job.getValue("file");
    409496    arrayDesign = ArrayDesign.getById(dc, arrayDesign.getId());
     497    if (arrayDesign.getNumDbFeatures() > 0)
     498    {
     499      throw new PermissionDeniedException("The array design already has features. "+arrayDesign.getName()+"["+arrayDesign.getId()+"]");
     500    }
     501    String fiParameter = (String)configuration.getValue("featureIdentification");
     502    FeatureIdentificationMethod fiMethod = fiParameter == null ?
     503      FeatureIdentificationMethod.COORDINATES :
     504      FeatureIdentificationMethod.valueOf(fiParameter);
    410505    reporterMapMember = FileStoreUtil.setGenericDataFile(dc, arrayDesign,
    411506        FileType.REPORTER_MAP, DataFileType.GENERIC_REPORTER_MAP, reporterMapFile);
    412     if (arrayDesign.getNumDbFeatures() > 0)
    413     {
    414       throw new PermissionDeniedException("The array design already has features. "+arrayDesign.getName()+"["+arrayDesign.getId()+"]");
    415     }
    416     batcher = arrayDesign.getFeatureBatcher();
     507    batcher = arrayDesign.getFeatureBatcher(fiMethod);
    417508    reporterBatcher = ReporterBatcher.getNew(dc);
    418509    this.ffp = ffp;
     
    439530  protected void beginData()
    440531  {
     532    boolean cropStrings = ("crop".equals(job.getValue("stringTooLongError")));
    441533    Mapper nullMapper = new ConstantMapper((String)null);
    442     reporterMapper = getMapper(ffp, (String)configuration.getValue("reporterIdColumnMapping"), null, nullMapper);
     534    reporterMapper = getMapper(ffp, (String)configuration.getValue("reporterIdColumnMapping"),
     535      cropStrings ? ReporterData.MAX_EXTERNAL_ID_LENGTH : null, nullMapper);
     536    featureIdMapper = getMapper(ffp, (String)configuration.getValue("featureIdColumnMapping"),
     537      cropStrings ? FeatureData.MAX_EXTERNAL_ID_LENGTH : null, nullMapper);
     538    positionMapper = getMapper(ffp, (String)configuration.getValue("positionColumnMapping"), null, nullMapper);
    443539    blockMapper = getMapper(ffp, (String)configuration.getValue("blockColumnMapping"), null, nullMapper);
    444540    columnMapper = getMapper(ffp, (String)configuration.getValue("columnColumnMapping"), null, nullMapper);
     
    453549  {
    454550    String externalId = reporterMapper.getValue(data);
     551    String featureId = featureIdMapper.getValue(data);
    455552    ReporterData reporter = externalId == null ?
    456553      null : reporterBatcher.getByExternalId(externalId, errorIfNotFound);
     
    474571   
    475572    FeatureData feature = batcher.newFeature(adb, reporter);
     573    Integer position = positionMapper.getInt(data);
    476574    Integer row = rowMapper.getInt(data);
    477575    Integer column = columnMapper.getInt(data);
    478     if (row == null) throw new InvalidUseOfNullException("row");
    479     if (column == null) throw new InvalidUseOfNullException("column");
    480     feature.setRow(row);
    481     feature.setColumn(column);
     576    feature.setPosition(position == null ? 0 : position);
     577    if (row != null)
     578    {
     579      feature.setRow(row);
     580      if (row > adb.getBlockSizeY()) adb.setBlockSizeY(row);
     581    }
     582    if (column != null)
     583    {
     584      feature.setColumn(column);
     585      if (column > adb.getBlockSizeX()) adb.setBlockSizeX(feature.getColumn());
     586    }
    482587   
    483588    batcher.insert(feature);
    484589    numFeatures++;
    485     if (feature.getRow() > adb.getBlockSizeY())
    486     {
    487       adb.setBlockSizeY(feature.getRow());
    488     }
    489     if (feature.getColumn() > adb.getBlockSizeX())
    490     {
    491       adb.setBlockSizeX(feature.getColumn());
    492     }
    493590  }
    494591
     
    535632      allColumnMappings = new ArrayList<PluginParameter<String>>();
    536633      allColumnMappings.add(reporterIdColumnMapping);
     634      allColumnMappings.add(featureIdColumnMapping);
     635      allColumnMappings.add(positionColumnMapping);
    537636      allColumnMappings.add(blockColumnMapping);
    538637      allColumnMappings.add(metaGridXColumnMapping);
     
    593692      parameters.add(invalidUseOfNullErrorParameter);
    594693      parameters.add(numberFormatErrorParameter);
     694      parameters.add(stringTooLongErrorParameter);
    595695     
    596696      configureJob = new RequestInformation
     
    626726      // Column mappings
    627727      parameters.add(mappingSection);
     728      parameters.add(featureIdentificationParameter);
    628729      parameters.add(complexMappings);
    629730      parameters.addAll(getAllColumnMappings());
  • trunk/src/test/TestArrayDesign.java

    r3820 r4080  
    3131import net.sf.basedb.core.Feature;
    3232import net.sf.basedb.core.FeatureBatcher;
     33import net.sf.basedb.core.FeatureIdentificationMethod;
    3334import net.sf.basedb.core.File;
    3435import net.sf.basedb.core.FileSetMember;
     
    328329      }
    329330     
    330       FeatureBatcher batcher = ad.getFeatureBatcher();
     331      FeatureBatcher batcher = ad.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
    331332      int block = 1;
    332333      int row = 1;
     
    395396        wells.addAll(plate.getWells().list(dc));
    396397      }
    397       FeatureBatcher batcher = ad.getFeatureBatcher();
     398      FeatureBatcher batcher = ad.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
    398399      int block = 1;
    399400      int row = 1;
     
    549550      dc = TestUtil.getDbControl();
    550551      ArrayDesign ad = ArrayDesign.getById(dc, arrayDesignId);
    551       FeatureBatcher featureBatcher = ad.getFeatureBatcher();
     552      FeatureBatcher featureBatcher = ad.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
    552553      ReporterBatcher reporterBatcher = ReporterBatcher.getNew(dc);
    553554   
  • trunk/src/test/net/sf/basedb/test/merge/MergeTest.java

    r3820 r4080  
    4242import net.sf.basedb.core.Experiment;
    4343import net.sf.basedb.core.FeatureBatcher;
     44import net.sf.basedb.core.FeatureIdentificationMethod;
    4445import net.sf.basedb.core.Formula;
    4546import net.sf.basedb.core.ItemParameterType;
     
    200201    TestUtil.write("--Creating features for array design: " + design.getName() + "\n");
    201202    dc.reattachItem(design);
    202     FeatureBatcher batcher = design.getFeatureBatcher();
     203    FeatureBatcher batcher = design.getFeatureBatcher(FeatureIdentificationMethod.COORDINATES);
    203204    ReporterBatcher reporterBatcher = ReporterBatcher.getNew(dc);
    204205    for (int block = 1; block <= 10; block++)
     
    252253        rawData.setExtended("ch1FgMean", ch1 + noise);
    253254        rawData.setExtended("ch2FgMean", ch1 * ratio - noise);
    254         batcher.insert(rawData, externalId);
     255        batcher.insert(rawData, externalId, null);
    255256      }
    256257    }
Note: See TracChangeset for help on using the changeset viewer.