Package net.sf.basedb.plugins.gtf
Class GtfReporterMapImporter
- java.lang.Object
-
- net.sf.basedb.core.plugin.AbstractPlugin
-
- net.sf.basedb.plugins.AbstractFlatFileImporter
-
- net.sf.basedb.plugins.ReporterMapFlatFileImporter
-
- 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 (to, 29 sep 2011) $
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
-
-
Field Summary
Fields Modifier and Type Field Description 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, excelSheetParameter, 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
Constructors Constructor Description GtfReporterMapImporter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(GuiContext context, Request request, Response response)
Store configuration settings forRequest.COMMAND_CONFIGURE_PLUGIN
andRequest.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)
TheRequest.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 aArrayDesign
that doesn't already have any features and is using a supported platform/variant.InputStream
wrapInputStream(InputStream in)
Wrap the input stream with aGtfInputStream
.-
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, getDateFormatter, getDecimalSeparator, getErrorHandler, getErrorOption, getFileIterator, getInitializedFlatFileParser, getMainType, getMapper, getMapper, getNumberFormat, getPattern, getProgress, getSignalHandler, getTimestampFormatter, 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
-
-
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 theAbstractPlugin.sc
,AbstractPlugin.configuration
andAbstractPlugin.job
variables. If a subclass overrides this method it is recommended that it also callssuper.init(sc, configuration, job)
.- Specified by:
init
in interfacePlugin
- Overrides:
init
in classAbstractPlugin
- Parameters:
sc
- ASessionControl
object that the plugin can use to communicate with the core.configuration
- The configuration parameters for the pluginjob
- 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 aArrayDesign
that doesn't already have any features and is using a supported platform/variant.- Specified by:
isInContext
in interfaceInteractivePlugin
- Overrides:
isInContext
in classReporterMapFlatFileImporter
- Parameters:
context
- The current context of the client application, it is one of the values found in set returned byInteractivePlugin.getGuiContexts()
item
- The currently active item, it's type should match theGuiContext.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
TheRequest.COMMAND_CONFIGURE_PLUGIN
command will ask for parser regular expressions and column mappings. TheRequest.COMMAND_CONFIGURE_JOB
command will ask for a file and the array design that features should be added to.- Specified by:
getRequestInformation
in interfaceInteractivePlugin
- Overrides:
getRequestInformation
in classReporterMapFlatFileImporter
- Parameters:
context
- The current context of the client application, it is one of the values found in set returned byInteractivePlugin.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 forRequest.COMMAND_CONFIGURE_PLUGIN
andRequest.COMMAND_CONFIGURE_JOB
.- Specified by:
configure
in interfaceInteractivePlugin
- Overrides:
configure
in classReporterMapFlatFileImporter
- Parameters:
context
- The current context of the client application, it is one of the values found in set returned byInteractivePlugin.getGuiContexts()
request
- Request object with the command and parametersresponse
- Response object in for the plugin to response through
-
wrapInputStream
public InputStream wrapInputStream(InputStream in) throws IOException
Wrap the input stream with aGtfInputStream
.- Specified by:
wrapInputStream
in interfaceWrappedConfigureByExample
- Overrides:
wrapInputStream
in classAbstractFlatFileImporter
- 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 classAbstractFlatFileImporter
- 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)
-
-