3.0.2: 2012-01-25

net.sf.basedb.plugins.gtf
Class GtfReporterMapImporter

java.lang.Object
  extended by net.sf.basedb.core.plugin.AbstractPlugin
      extended by net.sf.basedb.plugins.AbstractFlatFileImporter
          extended by net.sf.basedb.plugins.ReporterMapFlatFileImporter
              extended by net.sf.basedb.plugins.gtf.GtfReporterMapImporter
All Implemented Interfaces:
AutoDetectingImporter, InteractivePlugin, Plugin, SignalTarget, ConfigureByExample, WrappedConfigureByExample

public class GtfReporterMapImporter
extends ReporterMapFlatFileImporter
implements InteractivePlugin, WrappedConfigureByExample

Import features to an array design from a GTF file. The default settings use transcript_id+seqname as the feature id and reporter id. This can be changed by user configuration, but it is recommended that transcript_id+seqname is used as feature id since other combinations of values may not be unique in raw data files.

Since:
3.0
Author:
Nicklas
Last modified
$Date: 2011-09-29 13:48:47 +0200 (Thu, 29 Sep 2011) $

Nested Class Summary
 
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
 
Field Summary
private  List<PluginParameter<String>> allColumnMappings
           
private  RequestInformation configureJob
           
private  RequestInformation configurePlugin
           
protected static PluginParameter<String> requiredFeatureIdColumnMapping
           
private  InputStreamTracker tracker
          Needed for progress reporting since reading from the source will produce less bytes when wrapped.
 
Fields inherited from class net.sf.basedb.plugins.ReporterMapFlatFileImporter
blockColumnMapping, columnColumnMapping, duplicateFeatureErrorParameter, featureIdColumnMapping, featureIdentificationParameter, metaGridXColumnMapping, metaGridYColumnMapping, missingReporterErrorParameter, positionColumnMapping, reporterIdColumnMapping, rowColumnMapping
 
Fields inherited from class net.sf.basedb.plugins.AbstractFlatFileImporter
complexMappings, dataFooterRegexpParameter, dataHeaderRegexpParameter, dataSplitterRegexpParameter, defaultErrorParameter, errorSection, fileParameter, fileType, headerRegexpParameter, ignoreRegexpParameter, invalidUseOfNullErrorParameter, mappingSection, maxDataColumnsParameter, minDataColumnsParameter, numberFormatErrorParameter, numberOutOfRangeErrorParameter, numDataColumnsType, optionalRegexpType, parserSection, requiredRegexpType, sectionRegexpParameter, stringTooLongErrorParameter, trimQuotesParameter
 
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
 
Constructor Summary
GtfReporterMapImporter()
           
 
Method Summary
 void configure(GuiContext context, Request request, Response response)
          Store configuration settings for Request.COMMAND_CONFIGURE_PLUGIN and Request.COMMAND_CONFIGURE_JOB.
private  List<PluginParameter<String>> getAllColumnMappings()
           
private  RequestInformation getConfigurePluginParameters(GuiContext context)
           
protected  long getNumBytes(FlatFileParser ffp)
          Get the number of bytes read from the original file.
 RequestInformation getRequestInformation(GuiContext context, String command)
          The Request.COMMAND_CONFIGURE_PLUGIN command will ask for parser regular expressions and column mappings.
 void init(SessionControl sc, ParameterValues configuration, ParameterValues job)
          Store copies of the session control, plugin and job configuration.
 String isInContext(GuiContext context, Object item)
          Returns null if the item is a ArrayDesign that doesn't already have any features and is using a supported platform/variant.
 InputStream wrapInputStream(InputStream in)
          Wrap the input stream with a GtfInputStream.
 
Methods inherited from class net.sf.basedb.plugins.ReporterMapFlatFileImporter
begin, beginData, end, getGuiContexts, getPermissions, getSuccessMessage, handleData, requiresConfiguration, supportsConfigurations
 
Methods inherited from class net.sf.basedb.plugins.AbstractFlatFileImporter
addErrorHandler, checkColumnMapping, checkColumnMapping, continueWithNextFileAfterError, doImport, finish, getCharset, getCharset, getDecimalSeparator, getErrorHandler, getErrorOption, getFileIterator, getInitializedFlatFileParser, getMainType, getMapper, getNumberFormat, getProgress, getSignalHandler, getTotalFileSize, handleHeader, handleSection, isImportable, isImportable, log, log, log, log, run, setUpErrorHandling, start
 
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin
cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, 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.InteractivePlugin
getGuiContexts
 
Methods inherited from interface net.sf.basedb.core.plugin.Plugin
done, getMainType, getPermissions, requiresConfiguration, run, supportsConfigurations
 

Field Detail

tracker

private InputStreamTracker tracker
Needed for progress reporting since reading from the source will produce less bytes when wrapped.


configurePlugin

private RequestInformation configurePlugin

configureJob

private RequestInformation configureJob

allColumnMappings

private List<PluginParameter<String>> allColumnMappings

requiredFeatureIdColumnMapping

protected static final PluginParameter<String> requiredFeatureIdColumnMapping
Constructor Detail

GtfReporterMapImporter

public GtfReporterMapImporter()
Method Detail

init

public void init(SessionControl sc,
                 ParameterValues configuration,
                 ParameterValues job)
          throws BaseException
Description copied from class: AbstractPlugin
Store copies of the session control, plugin and job configuration. These are available to subclasses in the AbstractPlugin.sc, AbstractPlugin.configuration and AbstractPlugin.job variables. If a subclass overrides this method it is recommended that it also calls super.init(sc, configuration, job).

Specified by:
init in interface Plugin
Overrides:
init in class AbstractPlugin
Parameters:
sc - A SessionControl object that the plugin can use to communicate with the core.
configuration - The configuration parameters for the plugin
job - The job parameters for the plugin
Throws:
BaseException - if there is an error.

isInContext

public String isInContext(GuiContext context,
                          Object item)
Description copied from class: ReporterMapFlatFileImporter
Returns null if the item is a ArrayDesign that doesn't already have any features and is using a supported platform/variant.

Specified by:
isInContext in interface InteractivePlugin
Overrides:
isInContext in class ReporterMapFlatFileImporter
Parameters:
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
Returns:
Null if the plugin can use that item, or a warning-level message explaining why the plugin can't be used

getRequestInformation

public RequestInformation getRequestInformation(GuiContext context,
                                                String command)
                                         throws BaseException
Description copied from class: ReporterMapFlatFileImporter
The Request.COMMAND_CONFIGURE_PLUGIN command will ask for parser regular expressions and column mappings. The Request.COMMAND_CONFIGURE_JOB command will ask for a file and the array design that features should be added to.

Specified by:
getRequestInformation in interface InteractivePlugin
Overrides:
getRequestInformation in class ReporterMapFlatFileImporter
Parameters:
context - The current context of the client application, it is one of the values found in set returned by InteractivePlugin.getGuiContexts()
command - The command
Returns:
The RequestInformation for the command
Throws:
BaseException - if there is an error

configure

public void configure(GuiContext context,
                      Request request,
                      Response response)
Description copied from class: ReporterMapFlatFileImporter
Store configuration settings for Request.COMMAND_CONFIGURE_PLUGIN and Request.COMMAND_CONFIGURE_JOB.

Specified by:
configure in interface InteractivePlugin
Overrides:
configure in class ReporterMapFlatFileImporter
Parameters:
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 parameters
response - Response object in for the plugin to response through

wrapInputStream

public InputStream wrapInputStream(InputStream in)
                            throws IOException
Wrap the input stream with a GtfInputStream.

Specified by:
wrapInputStream in interface WrappedConfigureByExample
Overrides:
wrapInputStream in class AbstractFlatFileImporter
Parameters:
in - The input stream to wrap
Returns:
The same or a different input stream
Throws:
IOException - If there is an error
See Also:
AbstractFlatFileImporter.getNumBytes(FlatFileParser)

getNumBytes

protected long getNumBytes(FlatFileParser ffp)
Get the number of bytes read from the original file.

Overrides:
getNumBytes in class AbstractFlatFileImporter
Parameters:
ffp - The file parser that is used to parsed the file
Returns:
The number of bytes read from the original file
See Also:
AbstractFlatFileImporter.wrapInputStream(InputStream), AbstractFlatFileImporter.getProgress(FlatFileParser)

getAllColumnMappings

private List<PluginParameter<String>> getAllColumnMappings()

getConfigurePluginParameters

private RequestInformation getConfigurePluginParameters(GuiContext context)

3.0.2: 2012-01-25