Class AbstractFieldConverter

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

public abstract class AbstractFieldConverter
extends Object
implements ExportableFieldConverter
Abstract helper class for implementing ExportableFieldConverter. It contains a lot of helper method for locating formulas, extra values, experimental factors, etc.
Since:
2.15
Author:
nicklas
  • Field Details

  • Constructor Details

    • AbstractFieldConverter

      protected AbstractFieldConverter​(DbControl dc, BioAssaySet source)
      Creates a new field converter to be used with a specific bioassay set source.
      Parameters:
      dc - A DbControl to use for database access
      source - The source bioassay set
  • Method Details

    • getDbControl

      protected DbControl getDbControl()
      Get the DbControl to use for database access.
    • getSource

      protected BioAssaySet getSource()
      Get the source bioassay set.
    • setSnapshotManager

      public void setSnapshotManager​(SnapshotManager snapshotManager)
      Set a snapshot manager that should be used with annotation-based fields. If no snapshot manager is provided, a new manager will automatically be created if needed.
      Parameters:
      snapshotManager - The snapshot manager to use
    • getSnapshotManager

      public SnapshotManager getSnapshotManager()
      Get the snapshot manager to use with annotation-based fields. If no snapshot manager has been configured a new one is automatically created.
      Returns:
      A snapshot manager object
    • getAssayPropertyField

      protected AssayPropertyField getAssayPropertyField​(String name, String exportTitle)
      Get a static assay property field, such as name, description or id. Property lookup is not case-sensitive. Eg. both 'name' and 'Name' will match.
      Parameters:
      name - The property name
      exportTitle - The title as it should be in the exported file
      Returns:
      An AssayPropertyField or null if not found
    • getExperimentalFactorField

      protected AnnotationAssayField getExperimentalFactorField​(String name, String exportTitle)
      Get an experimental factor assay field. A database query is used to locate an experimental factor for the experiment that has the given name or external id. Depending on the underlying database, the lookup may be case-sensitive or case-insensitive. If more than one experimental factor is found an exception is thrown.
      Parameters:
      name - The name or external id of the experimental factor to find
      exportTitle - The title as it should be in the exported file or null to use the name of the experimental factor
      Returns:
      An AnnotationAssayField or null if no experimental factor is found
    • getAssayAnnotationField

      protected AnnotationAssayField getAssayAnnotationField​(String name, String exportTitle)
      Get an assay annotation field. A database query is used to locate an annotation type that has been used on at least one assay in the bioassay set. Depending on the underlying database, the lookup may be case-sensitive or case-insensitive. If more than one annotation type is found an exception is thrown.
      Parameters:
      name - The name or external id of the annotation type to find
      exportTitle - The title as it should be in the exported file or null to use the name of the annotation type
      Returns:
      An AnnotationAssayField or null if no annotation type is found
    • getReporterProperty

      protected DynamicField getReporterProperty​(String name, String exportTitle)
      Get a static or extended reporter property field, such as name, description or id. Property lookup is not case-sensitive. Eg. both 'name' and 'Name' will match.
      Parameters:
      name - The name of the reporter property
      exportTitle - The exported title or null to use the title of the extended property (which can be different from the name)
      Returns:
      A dynamic field, or null if no reporter property is found
    • getRawDataProperty

      protected DynamicField getRawDataProperty​(String name, String exportTitle)
      Find an extended raw data property with the given name and create a dynamic field from it using exportTitle as the title.
      Parameters:
      name - The name of the extended raw data property
      exportTitle - The exported title or null to use the title of the extended property (which can be different from the name)
      Returns:
      A dynamic field, or null if no raw data property is found
    • getExtraValueField

      protected DynamicField getExtraValueField​(String name, ExtraValue.CoordinateType type, String exportTitle)
      Get an extra value dynamic field. A database query is used to locate an extra value for the bioassay set that has the given name or external id. Depending on the underlying database, the lookup may be case-sensitive or case-insensitive. If more than one extra value is found an exception is thrown.
      Parameters:
      name - The name or external id of the experimental factor to find
      type - The coordinate type of the extra value (eg. POSITION for reporter extra values, and SPOT for spot extra values)
      exportTitle - The title as it should be in the exported file or null to use the name of the extra value
      Returns:
      A DynamicField or null if no extra value is found
    • getFormulaField

      protected DynamicField getFormulaField​(String name, String exportTitle)
      Get a formula dynamic field. A database query is used to locate the formula which must be a Formula.Type.COLUMN_EXPRESSION and be suitable for the RawDataType and IntensityTransform used by the source bioassay set. Depending on the underlying database, the lookup may be case-sensitive or case-insensitive. If more than one formula is found an exception is thrown.
      Parameters:
      name - The name of the formula to find
      exportTitle - The title as it should be in the exported file or null to use the name of the formula
      Returns:
      A DynamicField or null if no extra value is found
    • getIntensityField

      protected DynamicField getIntensityField​(String fieldName, String exportTitle)
      Create a dynamic field for spot intensity if the field name has the pattern 'Ch X' where 'X' is a channel number between 1 and the number of channels in the raw data type used by the source bioassay set.
      Parameters:
      fieldName - The field name
      Returns:
      A dynamic field, or null if the name doesn't match the pattern