|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.basedb.util.export.spotdata.AbstractBioAssaySetExporter net.sf.basedb.util.export.spotdata.BaseFileExporter
public abstract class BaseFileExporter
A superclass for exporters that exports spot data to BASEfile format. This class exposes several other configuration parameters that are specific for BASEfile:s.
Field Summary | |
---|---|
private BaseFileWriter |
out
|
private Map<String,String> |
parameters
|
Constructor Summary | |
---|---|
protected |
BaseFileExporter()
|
Method Summary | |
---|---|
void |
addAssayField(AssayField field)
Adds an assay field to the exported file. |
void |
addAssayFields(Collection<? extends AssayField> fields)
Add multiple assay fields in one go. |
void |
addReporterField(DynamicField field)
Add information about a reporter field that should be exported. |
void |
addReporterFields(Collection<? extends DynamicField> fields)
Add multiple reporter fields in one go. |
void |
addSpotField(DynamicField field)
Add information about a spot field that should be exported. |
void |
addSpotFields(Collection<? extends DynamicField> fields)
Add multiple spot fields in one go. |
protected void |
beginExport()
Prepare the export by adding all experimental factors as assay fields if no fields have been specified. |
protected void |
exportAssaysSectionData()
Export data for the 'assays' section that contains information about the bioassays in the source bioassay set. |
protected void |
exportAssaysSectionHeaders()
Exports headers for the 'assays' section which contains metadata information about the assays in the bioassay set. |
protected boolean |
exportGlobalHeader()
Export 'settings' and 'assays' sections. |
protected int |
exportSettingsSection()
Export the settings section which contains all parameter values registered with setParameter(String, String) . |
protected void |
exportSpotSectionData(List<BioAssay> assays,
DynamicSpotQuery spotQuery,
ProgressReporter progress,
long count)
Export the spot data of a 'spot' section. |
protected void |
exportSpotSectionHeaders(List<BioAssay> assays,
long spotCount)
Start a new 'spot' section and export the standard headers: 'channels, 'assays', 'columns', 'assayFields' and 'count'. |
List<AssayField> |
getAssayFields()
Get the list of registered assay fields, in the order they were registered. |
boolean |
getAverageOnReporter()
|
protected BaseFileWriter |
getBaseFileWriter()
Get the writer that writes the data to the file. |
protected DynamicSpotQuery |
getCountQuery(boolean bioAssayRestriction)
Get a configured query that counts the number of data lines that is about to be written in a data section. |
String |
getParameter(String key)
Get the current value of a 'settings' parameter. |
List<DynamicField> |
getReporterFields()
Get the list of registered reporter fields, in the order they were registered. |
List<DynamicField> |
getSpotFields()
Get the list of registered spot fields, in the order they were registered. |
void |
setAverageOnReporter(boolean averageOnReporter)
Specify if the exported data should be averaged on reporter or not. |
void |
setParameter(String key,
String value)
Add a parameter that is exported in the 'settings' section, which is the first section in the BASEfile. |
void |
setWriter(BaseFileWriter out)
Set the stream were the exported data should be written. |
Methods inherited from class net.sf.basedb.util.export.spotdata.AbstractBioAssaySetExporter |
---|
addExperimentalFactorsAsAssayFields, cacheReporterData, checkInterrupted, copyReporterFields, doExport, endExport, exportGlobalFooter, exportSectionData, exportSectionFooter, exportSectionHeader, getAssayIndex, getBioAssays, getDbControl, getProgressReporter, getReporterQuery, getSnapshotManager, getSource, getSpotQuery, prepareAssayIndexMap, setDbControl, setProgress, setProgressReporter, setSnapshotManager, setSource, validate |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Map<String,String> parameters
private BaseFileWriter out
Constructor Detail |
---|
protected BaseFileExporter()
Method Detail |
---|
public void setWriter(BaseFileWriter out)
public void setParameter(String key, String value)
key
- The parameter key (if null this method call is ignored)value
- The parameter value (may be null)public String getParameter(String key)
key
- The parameter key
public void addSpotField(DynamicField field)
AbstractBioAssaySetExporter
addSpotField
in class AbstractBioAssaySetExporter
field
- The spot field (null is ignored)public void addSpotFields(Collection<? extends DynamicField> fields)
fields
- A collection with the fields that should be addedpublic List<DynamicField> getSpotFields()
AbstractBioAssaySetExporter
getSpotFields
in class AbstractBioAssaySetExporter
public void addReporterField(DynamicField field)
AbstractBioAssaySetExporter
addReporterField
in class AbstractBioAssaySetExporter
field
- The reporter field (null is ignored)public void addReporterFields(Collection<? extends DynamicField> fields)
fields
- A collection with the fields that should be addedpublic List<DynamicField> getReporterFields()
AbstractBioAssaySetExporter
getReporterFields
in class AbstractBioAssaySetExporter
public void addAssayField(AssayField field)
addAssayField
in class AbstractBioAssaySetExporter
field
- The assay field (null is ignored)public void addAssayFields(Collection<? extends AssayField> fields)
fields
- A collection with the fields that should be addedpublic List<AssayField> getAssayFields()
AbstractBioAssaySetExporter
getAssayFields
in class AbstractBioAssaySetExporter
public void setAverageOnReporter(boolean averageOnReporter)
AbstractBioAssaySetExporter
setAverageOnReporter
in class AbstractBioAssaySetExporter
public boolean getAverageOnReporter()
getAverageOnReporter
in class AbstractBioAssaySetExporter
protected void beginExport()
beginExport
in class AbstractBioAssaySetExporter
protected boolean exportGlobalHeader()
exportGlobalHeader
in class AbstractBioAssaySetExporter
AbstractBioAssaySetExporter.exportSectionHeader()
,
FALSE to continue with global footers AbstractBioAssaySetExporter.exportGlobalFooter()
protected BaseFileWriter getBaseFileWriter()
protected int exportSettingsSection()
setParameter(String, String)
. If a parameter
with key=section exists the value of that parameter is used as the
name of this section, otherwise 'settings' is used as name.
If the 'section' parameter exists, it must be the first
parameter. It is not allowed in other places and will generate an
exception.
This method leaves the BASEfile writer in the header part in case the caller wants to add more headers.
If no parameters has been registered this section is skipped.
protected void exportAssaysSectionHeaders()
protected void exportAssaysSectionData()
protected void exportSpotSectionHeaders(List<BioAssay> assays, long spotCount)
assays
- The bioassays that this section contains data forspotCount
- The number of data lines that is going to be
written in the data partprotected void exportSpotSectionData(List<BioAssay> assays, DynamicSpotQuery spotQuery, ProgressReporter progress, long count)
AbstractBioAssaySetExporter.cacheReporterData()
and is copied to the output by
AbstractBioAssaySetExporter.copyReporterFields(int, Object[], int)
.
A new data row is generated each time the position number changes. If each row should contain data from more than one assay an index map must be given. The index map should map the bioassay column to the ordinal number of the assay in the list of assays.
assays
- A list of with the bioassays that the current spot
data section contains data forspotQuery
- The query used to retreive the dataprogress
- An optional progress reporter, if given progress
is reported from 0 to 100%count
- The total number of spots must be given for the progress
reporting to workprotected DynamicSpotQuery getCountQuery(boolean bioAssayRestriction)
bioAssayRestriction
- If TRUE a restriction is added to the
query to make it return data for a single bioassay only.
Use query.setParameter("bioAssayColumn", (int)bioAssay.getDataCubeColumnNo(), Type.INT)
to set the value for the restriction
AbstractSqlQuery.count(DbControl)
to
get the count
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |