Package net.sf.basedb.plugins.gtf
Class GtfReporterImporter
java.lang.Object
net.sf.basedb.core.plugin.AbstractPlugin
net.sf.basedb.plugins.AbstractFlatFileImporter
net.sf.basedb.plugins.ReporterFlatFileImporter
net.sf.basedb.plugins.gtf.GtfReporterImporter
- All Implemented Interfaces:
AutoDetectingImporter
,InteractivePlugin
,Plugin
,SignalTarget
,ConfigureByExample
,WrappedConfigureByExample
public class GtfReporterImporter
extends ReporterFlatFileImporter
implements WrappedConfigureByExample
Reporter importer implementation that create reporters from information
in GTF files. The implementation builds on the regular
ReporterFlatFileImporter
but uses a GtfInputStream
as a wrapper to generate a pure column-based output which can be used
by the regular tools for file parsing. The importer will also skip
lines with a non-unique transcript_id+seqname.
The default configuration is to use the transcript_id+seqname as the reporter id and name. gene_id is stored as "gene symbol" and seqname as "chromosome". The default configuration can be changed by user configurations depending on what additional attributes that are present in the GTF file.
- Since:
- 3.0
- Author:
- Nicklas
- Last modified
- $Date: 2011-09-29 13:27:33 +0200 (to, 29 sep 2011) $
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
-
Field Summary
Modifier and TypeFieldDescriptionprivate InputStreamTracker
Needed for progress reporting since reading from the source will produce less bytes when wrapped.Fields inherited from class net.sf.basedb.plugins.ReporterFlatFileImporter
reporterIsUsedErrorParameter
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected long
Get the number of bytes read from the original file.void
init
(SessionControl sc, ParameterValues configuration, ParameterValues job) Store copies of the session control, plugin and job configuration.Wrap the input stream with aGtfInputStream
.Methods inherited from class net.sf.basedb.plugins.ReporterFlatFileImporter
begin, beginData, configure, end, getGuiContexts, getPermissions, getRequestInformation, getSuccessMessage, handleData, isInContext, 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, getInitializedFlatFileParser, getMainType, getMapper, getMapper, getNumberFormat, getPattern, 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, isLogging, 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, getMainType, getPermissions, requiresConfiguration, run, supportsConfigurations
-
Field Details
-
tracker
Needed for progress reporting since reading from the source will produce less bytes when wrapped.
-
-
Constructor Details
-
GtfReporterImporter
public GtfReporterImporter()
-
-
Method Details
-
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.
-
wrapInputStream
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:
-
getNumBytes
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:
-