Class AdvancedFieldConverter

All Implemented Interfaces:
ExportableFieldConverter

public class AdvancedFieldConverter extends StandardFieldConverter
Field converter implementation that gives more detailed control how fields are converted and used in the export. The implementation builds on the StandardFieldConverter which is used as a fallback. The advanced options can be accessed by using formula-like field "names" as shown below. In most cases the "title" parameter is optional. If not given, the name is used as the title. Field names that doesn't start with an equal character (=) are passed on to the StandardFieldConverter.
Since:
2.16
Author:
Nicklas
Last modified
$Date: 2010-08-05 13:16:18 +0200 (to, 05 aug 2010) $
  • Field Details

  • Constructor Details

    • AdvancedFieldConverter

      public AdvancedFieldConverter(DbControl dc, BioAssaySet source)
      Create a new advanced field converter.
      Parameters:
      dc - A DbControl to use for database access
      source - The source bioassay set
  • Method Details

    • getAssayField

      public AssayField getAssayField(String name, boolean required)
      Description copied from class: StandardFieldConverter
      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.
      Specified by:
      getAssayField in interface ExportableFieldConverter
      Overrides:
      getAssayField in class StandardFieldConverter
      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)
      Description copied from class: StandardFieldConverter
      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.
      Specified by:
      getReporterField in interface ExportableFieldConverter
      Overrides:
      getReporterField in class StandardFieldConverter
      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)
      Description copied from class: StandardFieldConverter
      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)
      Specified by:
      getSpotField in interface ExportableFieldConverter
      Overrides:
      getSpotField in class StandardFieldConverter
      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
    • getAdvancedAssayField

      protected AssayField getAdvancedAssayField(String expression, boolean required)
      Convert an expression to an assay field. Supported expressions are listed below. The "title" parameter is optional in all cases.
      • =property("name" [,"title"]): Get the value of the property with the given name.
      • =factor("name" [,"title"]): Get the value of the experimental factor with the given name or external id.
      • =annotation("name" [,"title"]): Get the value of the assay annotation with the given name or external id.
    • getAdvancedReporterField

      protected DynamicField getAdvancedReporterField(String expression, boolean required)
      Convert an expression to a reporter field. Supported expressions are listed below. The "title" parameter is optional in the "jep" expression.
      • =property("name" [,"title"]): Get the value of the reporter property with the given name.
      • =formula("name" [,"title"]): Get the value of the formula with the given name. The formula should only use properties that are related to the reporter and it's position.
      • =xtra("name" [,"title"]): Get the value of the extra value with the given name or external id. The extra value should be a position-based extra value.
      • =jep("expression", "title" [,"datatype"]): Calculate the value using the given JEP expression. A title is required. The datatype is optional (default is STRING). Valid datatypes are those defined by the Type enumeration.
    • getAdvancedSpotField

      protected DynamicField getAdvancedSpotField(String expression, boolean required)
      Convert an expression to a spot field. Supported expressions are listed below. The "title" parameter is optional in the "jep" expression.
      • =property("name" [,"title"]): Get the value of the raw data property with the given name.
      • =formula("name" [,"title"]): Get the value of the formula with the given name. The formula should only use properties that are related to the spot and raw data.
      • =xtra("name" [,"title"]): Get the value of the extra value with the given name or external id. The extra value should be a spot-based extra value.
      • =jep("expression", "title" [,"datatype"]): Calculate the value using the given JEP expression. A title is required. The datatype is optional (default is STRING). Valid datatypes are those defined by the Type enumeration.
    • getPattern

      private Pattern getPattern(String function, int requiredParameters, int optionalParameters)