Class AdvancedFieldConverter
- java.lang.Object
-
- net.sf.basedb.util.export.spotdata.AbstractFieldConverter
-
- net.sf.basedb.util.export.spotdata.StandardFieldConverter
-
- net.sf.basedb.util.export.spotdata.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 theStandardFieldConverter
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.- =property("name", ["title"]): Lookup a static property with the given name. Can be used on assay, reporter and spot (=raw data properties) fields.
- =factor("name" [,"title"]): Lookup an experimental factor with the
given name or external id. Can be used in
getAssayField(String, boolean)
. - =annotation("name" [,"title"]): Lookup an assay annotation with the
given name or external id. Can be used in
getAssayField(String, boolean)
. - =xtra("name" [,"title"]): Lookup an extra value with the given name
or external id. Can be used in
getReporterField(String, boolean)
andgetSpotField(String, boolean)
. - =formula("name" [,"title"]): Lookup a formula with the given name.
Can be used in
getReporterField(String, boolean)
andgetSpotField(String, boolean)
. - =jep("jep expression", "title" [,"datatype"]): Use the given JEP formula
to calculate the exported value. Can be used in
getReporterField(String, boolean)
andgetSpotField(String, boolean)
. The "title" is required. The "datatype" is optional. If not given "string" will be used. Valid values are constants from theType
enumeration (case-insensitive).
StandardFieldConverter
.- Since:
- 2.16
- Author:
- Nicklas
- Last modified
- $Date: 2010-08-05 13:16:18 +0200 (to, 05 aug 2010) $
-
-
Constructor Summary
Constructors Constructor Description AdvancedFieldConverter(DbControl dc, BioAssaySet source)
Create a new advanced field converter.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AssayField
getAdvancedAssayField(String expression, boolean required)
Convert an expression to an assay field.protected DynamicField
getAdvancedReporterField(String expression, boolean required)
Convert an expression to a reporter field.protected DynamicField
getAdvancedSpotField(String expression, boolean required)
Convert an expression to a spot field.AssayField
getAssayField(String name, boolean required)
Find an assay field.private Pattern
getPattern(String function, int requiredParameters, int optionalParameters)
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
-
-
-
-
Constructor Detail
-
AdvancedFieldConverter
public AdvancedFieldConverter(DbControl dc, BioAssaySet source)
Create a new advanced field converter.- Parameters:
dc
- A DbControl to use for database accesssource
- The source bioassay set
-
-
Method Detail
-
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:- Check if there is an experimental factor with the given name (case-sensitivity depends on the database that is used).
- Check if there is an assay-level annotation type with the given name.
- If name is 'name', 'description' or another static property (case-insensitive) the corresponding assay value is used.
- Specified by:
getAssayField
in interfaceExportableFieldConverter
- Overrides:
getAssayField
in classStandardFieldConverter
- Parameters:
name
- The name to findrequired
- 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:- Check if there is an position extra value with the given name (case-sensitivity depends on the database that is used).
- Check if there is a formula with the given name (case-sensitivity depends on the database that is used).
- If name is 'name', 'externalId', 'description' or another static property (case-insensitive) the corresponding reporter value is used.
- 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 interfaceExportableFieldConverter
- Overrides:
getReporterField
in classStandardFieldConverter
- Parameters:
name
- The name to findrequired
- 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:- Check if there is a spot extra value with the given name (case-sensitivity depends on the database that is used).
- Check if there is a formula with the given name (case-sensitivity depends on the database that is used).
- Check if there is a raw data property that matches the name (case-insensitive)
- Special values: Ch 1, Ch2, etc. to get channel intensities (case-insensitive)
- Specified by:
getSpotField
in interfaceExportableFieldConverter
- Overrides:
getSpotField
in classStandardFieldConverter
- Parameters:
name
- The name to findrequired
- 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.
-
-