Class AbstractFieldConverter
java.lang.Object
net.sf.basedb.util.export.spotdata.AbstractFieldConverter
- All Implemented Interfaces:
ExportableFieldConverter
- Direct Known Subclasses:
StandardFieldConverter
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 Summary
Modifier and TypeFieldDescriptionprivate ItemQuery<AnnotationType>
private final DbControl
private ItemQuery<ExtraValue>
private ItemQuery<AnnotationType>
private SnapshotManager
private final BioAssaySet
-
Constructor Summary
ModifierConstructorDescriptionprotected
AbstractFieldConverter
(DbControl dc, BioAssaySet source) Creates a new field converter to be used with a specific bioassay set source. -
Method Summary
Modifier and TypeMethodDescriptionprotected AnnotationAssayField
getAssayAnnotationField
(String name, String exportTitle) Get an assay annotation field.protected AssayPropertyField
getAssayPropertyField
(String name, String exportTitle) Get a static assay property field, such as name, description or id.protected DbControl
Get the DbControl to use for database access.protected AnnotationAssayField
getExperimentalFactorField
(String name, String exportTitle) Get an experimental factor assay field.protected DynamicField
getExtraValueField
(String name, ExtraValue.CoordinateType type, String exportTitle) Get an extra value dynamic field.protected DynamicField
getFormulaField
(String name, String exportTitle) Get a formula dynamic field.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.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.protected DynamicField
getReporterProperty
(String name, String exportTitle) Get a static or extended reporter property field, such as name, description or id.Get the snapshot manager to use with annotation-based fields.protected BioAssaySet
Get the source bioassay set.void
setSnapshotManager
(SnapshotManager snapshotManager) Set a snapshot manager that should be used with annotation-based fields.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.sf.basedb.util.export.spotdata.ExportableFieldConverter
getAssayField, getReporterField, getSpotField
-
Field Details
-
dc
-
source
-
snapshotManager
-
factorQuery
-
assayAnnotationQuery
-
extraQuery
-
formulaQuery
-
-
Constructor Details
-
AbstractFieldConverter
Creates a new field converter to be used with a specific bioassay set source.- Parameters:
dc
- A DbControl to use for database accesssource
- The source bioassay set
-
-
Method Details
-
getDbControl
Get the DbControl to use for database access. -
getSource
Get the source bioassay set. -
setSnapshotManager
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
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
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 nameexportTitle
- The title as it should be in the exported file- Returns:
- An AssayPropertyField or null if not found
-
getExperimentalFactorField
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 findexportTitle
- 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
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 findexportTitle
- 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
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 propertyexportTitle
- 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
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 propertyexportTitle
- 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 findtype
- 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
Get a formula dynamic field. A database query is used to locate the formula which must be aFormula.Type.COLUMN_EXPRESSION
and be suitable for theRawDataType
andIntensityTransform
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 findexportTitle
- 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
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
-