|
2.8.3: 2008-10-15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.basedb.core.plugin.AbstractPlugin
net.sf.basedb.core.plugin.AbstractExporterPlugin
net.sf.basedb.plugins.BioAssaySetExporter
public class BioAssaySetExporter
Exporter for bioassay sets. Supported formats: - Tab Delimited, Multiple Sample Files (TDMS Format) for use in MeV (available from http://www.tm4.org). - BASEfile. - Plain Matrix, see documentation for exportPlainMatrix method for a description of the format.
Nested Class Summary | |
---|---|
class |
BioAssaySetExporter.QueryItem
|
private class |
BioAssaySetExporter.QueryItemTitleComparator
|
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Field Summary | |
---|---|
private static About |
about
|
private BioAssaySet |
bas
|
private PluginParameter<BioAssaySet> |
bioAssaySetParameter
|
private static String |
COMMAND_CONFIGURE_BASEFILE
|
private RequestInformation |
configureJob
|
private RequestInformation |
configureJobBasefile
|
private DbControl |
dc
|
private static String |
FORMAT_BASEFILE
|
private static String |
FORMAT_MEV
|
private static String |
FORMAT_PLAIN_MATRIX
|
private PluginParameter<String> |
formatParameter
|
private PluginParameter<Boolean> |
geneAveragesParameter
|
private static Set<GuiContext> |
guiContexts
|
private static Set<Permissions> |
permissions
|
private PluginParameter<Boolean> |
serialFormatParameter
|
private ThreadSignalHandler |
signalHandler
|
private PluginParameter<String> |
usedColumnsParameter
|
private PluginParameter<String> |
usedFieldsParameter
|
Fields inherited from class net.sf.basedb.core.plugin.AbstractExporterPlugin |
---|
optionalSaveAsType, OVERWRITE, overwriteType, requiredSaveAsType, SAVE_AS |
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Constructor Summary | |
---|---|
BioAssaySetExporter()
|
Method Summary | |
---|---|
protected void |
begin(DbControl dc)
Called just before the export starts. |
void |
configure(GuiContext context,
Request request,
Response response)
Configure the plugin. |
protected void |
end(boolean success)
Called just after everything has been committed to the database, or immediately after an error has ocurred. |
void |
exportBaseFileMatrix(BioAssaySet bas,
File file,
Map<String,String> parameters,
List<String> reporterFields,
List<String> spotFields,
Boolean mergeReporters)
Export the data from a bioassayset as a serial BASEfile. |
void |
exportBaseFileMatrix(BioAssaySet bas,
OutputStream os,
Map<String,String> parameters,
List<String> reporterFields,
List<String> spotFields,
boolean mergeReporters)
|
private void |
exportBaseFileSectionAssays(PrintWriter out,
DbControl dc,
BioAssaySet bas)
|
private void |
exportBaseFileSectionHead(PrintWriter out,
Map<String,String> parameters)
|
private void |
exportBaseFileSectionSpots(PrintWriter out,
DbControl dc,
BioAssaySet bas,
DynamicSpotQuery query,
List<String> reporterFields,
List<String> spotFields,
List<BioAssay> assays,
Map<String,BioAssaySetExporter.QueryItem> qi,
long count,
boolean mergeOnReporters)
|
void |
exportBaseFileSerial(BioAssaySet bas,
File file,
Map<String,String> parameters,
List<String> reporterFields,
List<String> spotFields,
Boolean mergeReporters)
Export the data from a bioassayset as a serial BASEfile. |
void |
exportBaseFileSerial(BioAssaySet bas,
OutputStream os,
Map<String,String> parameters,
List<String> reporterFields,
List<String> spotFields,
boolean mergeReporters)
|
void |
exportMeV(BioAssaySet bioassayset,
OutputStream to,
ProgressReporter progress)
Export bioassayset data in MeV format. |
void |
exportPlainMatrix(BioAssaySet bioassayset,
OutputStream os,
ProgressReporter progress)
Export bioassayset data in plain matrix format. |
About |
getAbout()
Get information about the plugin, such as name, version, authors, etc. |
private List<BioAssaySetExporter.QueryItem> |
getBaseFileExtraQI(DbControl dc,
BioAssaySet bas)
|
private List<BioAssaySetExporter.QueryItem> |
getBaseFileFormulaQI(DbControl dc,
BioAssaySet bas)
|
private Map<String,BioAssaySetExporter.QueryItem> |
getBaseFileQIMap(DbControl dc,
BioAssaySet bas)
|
private List<BioAssaySetExporter.QueryItem> |
getBaseFileRawQI(BioAssaySet bas)
|
private List<BioAssaySetExporter.QueryItem> |
getBaseFileReporterQI()
|
private List<BioAssaySetExporter.QueryItem> |
getBaseFileSpotQI(BioAssaySet bas)
|
private long |
getBaseFileSpotSectionCount(DbControl dc,
DynamicSpotQuery count,
boolean mergeReporters)
|
private RequestInformation |
getConfigureBasefileParameters(GuiContext context)
|
private RequestInformation |
getConfigureJobParameters(GuiContext context,
Boolean requireFile)
|
List<AnnotationType> |
getExperimentalFactors(DbControl dc,
BioAssaySet bas)
|
Set<GuiContext> |
getGuiContexts()
Get a set containing all items that the plugin handles. |
Plugin.MainType |
getMainType()
Get the type of the plugin. |
Collection<Permissions> |
getPermissions()
Request create and write access to File:s and Directory:s and read access to Experiment:s and User:s. |
RequestInformation |
getRequestInformation(GuiContext context,
String command)
This method will return the RequestInformation for a given command, i.e. |
SignalHandler |
getSignalHandler()
Get the signal handler that is handling signals on behalf of this object. |
protected String |
getSuccessMessage()
Called if the export was successful to let the subclass generate a simple message that is sent back to the core and user interface. |
String |
isInContext(GuiContext context,
Object item)
Check if the plugin can be used on the specified object. |
protected void |
performExport(ExportOutputStream out,
ProgressReporter progress)
Perform the export. |
boolean |
requiresConfiguration()
Returns FALSE, since that is how the plugins used to work before this method was introduced. |
boolean |
supportsConfigurations()
Returns TRUE, since that is how the plugins used to work before this method was introduced. |
Methods inherited from class net.sf.basedb.core.plugin.AbstractExporterPlugin |
---|
doExport, getOverwrite, getOverwriteParameter, getSaveAsParameter, getSaveAsPath, getSaveTo, pathCanBeUsed, run |
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
checkInterrupted, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getOverwriteAnnotationsParameters, init, log, log, storeValue, storeValue, storeValues, validateRequestParameters |
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.core.plugin.Plugin |
---|
done, init, run |
Field Detail |
---|
private ThreadSignalHandler signalHandler
private DbControl dc
private BioAssaySet bas
private static final About about
private RequestInformation configureJob
private RequestInformation configureJobBasefile
private static final Set<GuiContext> guiContexts
private static final Set<Permissions> permissions
private PluginParameter<BioAssaySet> bioAssaySetParameter
private PluginParameter<String> formatParameter
private PluginParameter<Boolean> serialFormatParameter
private PluginParameter<Boolean> geneAveragesParameter
private PluginParameter<String> usedFieldsParameter
private PluginParameter<String> usedColumnsParameter
private static final String COMMAND_CONFIGURE_BASEFILE
private static final String FORMAT_BASEFILE
private static final String FORMAT_MEV
private static final String FORMAT_PLAIN_MATRIX
Constructor Detail |
---|
public BioAssaySetExporter()
Method Detail |
---|
public void configure(GuiContext context, Request request, Response response)
InteractivePlugin
InteractivePlugin.getRequestInformation(GuiContext, String)
.
configure
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
request
- Request object with the command and parametersresponse
- Response object in for the plugin to response
throughpublic SignalHandler getSignalHandler()
SignalTarget
getSignalHandler
in interface SignalTarget
public void exportBaseFileMatrix(BioAssaySet bas, File file, Map<String,String> parameters, List<String> reporterFields, List<String> spotFields, Boolean mergeReporters) throws IOException, SQLException
reporterFields
and spotFields
parameter
must identify the data to export.
The reporterFields
parameter supports the following:
rep.<property> | The reporter property with the specified name, for example: rep.externalId, rep.symbol or a property defined in the extended properties file. |
spotFields
parameter supports the following:
intensityN | The intensity in channel N |
position | The position number for this spot in the data matrix |
raw.<property> | The raw data property with the specified name, for example: raw.x, raw.row or a property defined by the raw data type. |
frm.<id> | The value of the formula with the specified ID. |
xtra.<externalId> | The value of the extra value with the specified external ID. |
bas
- The bioassayset to exportfile
- The file to export toparameters
- Header information that should go at the top of
the BASEfilereporterFields
- The reporter fields that should be exporteredspotFields
- The spot fields that should be exportedmergeReporters
- TRUE to merge spot data having the same reporter
(currently not supported)
IOException
- If there is an IO error
SQLException
- If there is an error reading from the databasepublic void exportBaseFileMatrix(BioAssaySet bas, OutputStream os, Map<String,String> parameters, List<String> reporterFields, List<String> spotFields, boolean mergeReporters) throws IOException, SQLException
IOException
SQLException
private void exportBaseFileSectionAssays(PrintWriter out, DbControl dc, BioAssaySet bas)
private void exportBaseFileSectionHead(PrintWriter out, Map<String,String> parameters)
public void exportBaseFileSerial(BioAssaySet bas, File file, Map<String,String> parameters, List<String> reporterFields, List<String> spotFields, Boolean mergeReporters) throws IOException, SQLException
exportBaseFileMatrix(BioAssaySet, File, Map, List, List, Boolean)
for information about the naming of parameters.
bas
- The bioassayset to exportfile
- The file to export toparameters
- Header information that should go at the top of
the BASEfilereporterFields
- The reporter fields that should be exporteredspotFields
- The spot fields that should be exportedmergeReporters
- TRUE to merge spot data having the same reporter
(currently not supported)
IOException
- If there is an IO error
SQLException
- If there is an error reading from the databasepublic void exportBaseFileSerial(BioAssaySet bas, OutputStream os, Map<String,String> parameters, List<String> reporterFields, List<String> spotFields, boolean mergeReporters) throws IOException, SQLException
IOException
SQLException
private void exportBaseFileSectionSpots(PrintWriter out, DbControl dc, BioAssaySet bas, DynamicSpotQuery query, List<String> reporterFields, List<String> spotFields, List<BioAssay> assays, Map<String,BioAssaySetExporter.QueryItem> qi, long count, boolean mergeOnReporters) throws SQLException
SQLException
public void exportMeV(BioAssaySet bioassayset, OutputStream to, ProgressReporter progress) throws IOException, SQLException
bioassayset
- The bioassayset to exportto
- The stream to write the exported data toprogress
- An optional progress reporter
IOException
- If there is an IO error
SQLException
- If there is an error reading from the databasepublic void exportPlainMatrix(BioAssaySet bioassayset, OutputStream os, ProgressReporter progress) throws IOException, SQLException
bioassayset
- The bioassayset to exportos
- The stream to write the exported data toprogress
- An optional progress reporter
IOException
- If there is an IO error
SQLException
- If there is an error reading from the databasepublic About getAbout()
Plugin
getAbout
in interface Plugin
About
objectprivate long getBaseFileSpotSectionCount(DbControl dc, DynamicSpotQuery count, boolean mergeReporters)
private List<BioAssaySetExporter.QueryItem> getBaseFileExtraQI(DbControl dc, BioAssaySet bas)
private List<BioAssaySetExporter.QueryItem> getBaseFileFormulaQI(DbControl dc, BioAssaySet bas)
private Map<String,BioAssaySetExporter.QueryItem> getBaseFileQIMap(DbControl dc, BioAssaySet bas)
private List<BioAssaySetExporter.QueryItem> getBaseFileRawQI(BioAssaySet bas)
private List<BioAssaySetExporter.QueryItem> getBaseFileReporterQI()
private List<BioAssaySetExporter.QueryItem> getBaseFileSpotQI(BioAssaySet bas)
private RequestInformation getConfigureBasefileParameters(GuiContext context)
private RequestInformation getConfigureJobParameters(GuiContext context, Boolean requireFile)
public List<AnnotationType> getExperimentalFactors(DbControl dc, BioAssaySet bas)
public Set<GuiContext> getGuiContexts()
InteractivePlugin
Item.REPORTER
.
This information is used by client applications to put the plugin
in the proper place in the user interface.
getGuiContexts
in interface InteractivePlugin
Set
containing Item
:s, or null
if the plugin is not concerned about itemspublic Plugin.MainType getMainType()
Plugin
getMainType
in interface Plugin
getMainType
in class AbstractExporterPlugin
public Collection<Permissions> getPermissions()
getPermissions
in interface Plugin
getPermissions
in class AbstractPlugin
public RequestInformation getRequestInformation(GuiContext context, String command) throws BaseException
InteractivePlugin
RequestInformation
for a given command, i.e.
the list of parameters and some nice help text.
getRequestInformation
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
command
- The command
RequestInformation
for the command
BaseException
- if there is an errorpublic String isInContext(GuiContext context, Object item)
InteractivePlugin
BasicItem
or BasicData
object, or null if called from
a list context. A client application should only call this method for
contexts matching one of
the contexts in the set returned by the InteractivePlugin.getGuiContexts()
method. For GuiContext.Type.ITEM
contexts an item
of the correct type should be passed as a parameter.
The plug-in can response with a null value indicating success, a warning-level message or throw an exception to indicate an error-level message. Client application should normally only show error-level messages to users, unless the user has requested to see warning messages.
NOTE! Before BASE 2.4 all messages were treated as error-level messages.
isInContext
in interface InteractivePlugin
context
- The current context of the client application,
it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
item
- The currently active item, it's type should match the
GuiContext.getItem()
type, or null if the context is a list
context
Null
if the plugin can use that item, or
a warning-level message explaining why the plugin can't be usedpublic boolean requiresConfiguration()
AbstractPlugin
requiresConfiguration
in interface Plugin
requiresConfiguration
in class AbstractPlugin
protected void begin(DbControl dc)
AbstractExporterPlugin
begin
in class AbstractExporterPlugin
dc
- The DbControl that is used to write to the database.
A subclass may use this read from the database as wellAbstractExporterPlugin.end(boolean)
protected void performExport(ExportOutputStream out, ProgressReporter progress) throws IOException
AbstractExporterPlugin
ImmediateDownloadExporter.doExport(ExportOutputStream, ProgressReporter)
method.
performExport
in class AbstractExporterPlugin
out
- Output stream to write the exported data toprogress
- An optional progress reporter
IOException
protected void end(boolean success)
AbstractExporterPlugin
AbstractExporterPlugin.begin(DbControl)
method here.
end
in class AbstractExporterPlugin
success
- TRUE if the file was parsed successfully, FALSE otherwiseAbstractExporterPlugin.begin(DbControl)
protected String getSuccessMessage()
AbstractExporterPlugin
178 reporters exported successfully
.
The default implementation always return null.
getSuccessMessage
in class AbstractExporterPlugin
public boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations
in interface Plugin
supportsConfigurations
in class AbstractPlugin
|
2.8.3: 2008-10-15 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |