2.17.2: 2011-06-17

net.sf.basedb.util.export.spotdata
Class StandardFieldConverter

java.lang.Object
  extended by net.sf.basedb.util.export.spotdata.AbstractFieldConverter
      extended by net.sf.basedb.util.export.spotdata.StandardFieldConverter
All Implemented Interfaces:
ExportableFieldConverter
Direct Known Subclasses:
AdvancedFieldConverter, Base1FieldConverter

public class StandardFieldConverter
extends AbstractFieldConverter

Default field converter implementation that works mainly by checking names and/or external id values of formulas, extra values, experimental factors etc.

Since:
2.15
Author:
nicklas

Constructor Summary
StandardFieldConverter(DbControl dc, BioAssaySet source)
          Create a new standard field converter.
 
Method Summary
 AssayField getAssayField(String name, boolean required)
          Find an assay field.
 DynamicField getReporterField(String name, boolean required)
          Find a reporter dynamic field.
 DynamicField getSpotField(String name, boolean required)
          Find a spot dynamic field.
 
Methods inherited from class net.sf.basedb.util.export.spotdata.AbstractFieldConverter
getAssayAnnotationField, getAssayPropertyField, getDbControl, getExperimentalFactorField, getExtraValueField, getFormulaField, getIntensityField, getRawDataProperty, getReporterProperty, getSnapshotManager, getSource, setSnapshotManager
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardFieldConverter

public StandardFieldConverter(DbControl dc,
                              BioAssaySet source)
Create a new standard field converter.

Parameters:
dc - A DbControl to use for database access
source - The source bioassay set
Method Detail

getAssayField

public AssayField getAssayField(String name,
                                boolean required)
Find an assay field. This method will try to locate a field in the following order:
  1. Check if there is an experimental factor with the given name (case-sensitivity depends on the database that is used).
  2. Check if there is an assay-level annotation type with the given name.
  3. If name is 'name', 'description' or another static property (case-insensitive) the corresponding assay value is used.

Parameters:
name - The name to find
required - If TRUE and no field is found this method will throw an ItemNotFoundException
Returns:
The field or null

getReporterField

public DynamicField getReporterField(String name,
                                     boolean required)
Find a reporter dynamic field. This method will try to locate a field in the following order:
  1. Check if there is an position extra value with the given name (case-sensitivity depends on the database that is used).
  2. Check if there is a formula with the given name (case-sensitivity depends on the database that is used).
  3. If name is 'name', 'externalId', 'description' or another static property (case-insensitive) the corresponding reporter value is used.
  4. Special case for "External ID" and "Internal ID" to simplify pass-throguh to the BFS importer which expects at least one of those columns.

Parameters:
name - The name to find
required - If TRUE and no field is found this method will throw an ItemNotFoundException
Returns:
The field or null

getSpotField

public DynamicField getSpotField(String name,
                                 boolean required)
Find a spot dynamic field. This method will try to locate a field in the following order:
  1. Check if there is a spot extra value with the given name (case-sensitivity depends on the database that is used).
  2. Check if there is a formula with the given name (case-sensitivity depends on the database that is used).
  3. Check if there is a raw data property that matches the name (case-insensitive)
  4. Special values: Ch 1, Ch2, etc. to get channel intensities (case-insensitive)

Parameters:
name - The name to find
required - If TRUE and no field is found this method will throw an ItemNotFoundException
Returns:
The field or null

2.17.2: 2011-06-17