|
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.core.plugin.AbstractPlugin net.sf.basedb.plugins.AbstractFlatFileImporter net.sf.basedb.plugins.IlluminaRawDataImporter
public class IlluminaRawDataImporter
An importer plug-in for Illumina raw data. The plug-in will create one or more raw bioassays from the data in the file. Optionally, it will add the raw bioassays to an experiment.
Since the data files doesn't have any coordinate information the importer will use one of the following methods.
FeatureIdentificationMethod.COORDINATES
method for identifying features:
The plug-in create fake coordinates like this: block=1, column=1, row=linenumber in file.
The linenmbers start with 1 at the first data line, ie. header lines are not counted.
FeatureIdentificationMethod.POSITION
method for identiyfing features: The plug-in sets the position=line number in file.
The linenmbers start with 1 at the first data line, ie. header lines are not counted.
FeatureIdentificationMethod.FEATURE_ID
method for identifying features. The plug-in assumes that the feature ID is the
same as the reporter ID.
NOTE! Since the methods are not conflicting with each other, there will not be an actual check which method to use by this plug-in. We will simple set all values as specified above and let the BASE core handle the identification.
Nested Class Summary | |
---|---|
private static class |
IlluminaRawDataImporter.BatchAndMapHolder
Holds a RawBioAssay and the RawDataBatcher to use for import and the Mapper for all it's data columns. |
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin |
---|
Plugin.MainType |
Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc |
Constructor Summary | |
---|---|
IlluminaRawDataImporter()
|
Method Summary | ||
---|---|---|
protected void |
begin(FlatFileParser ffp)
Called just before parsing of the file begins. |
|
protected void |
beginData()
Check column headers and map them to raw bioassays. |
|
void |
configure(GuiContext context,
Request request,
Response response)
Configure the plugin. |
|
protected void |
end(boolean success)
If successful: Close batchers Associate with experiment if there is one Commit If not successful: Delete raw bioassays that has been created Rollback |
|
private List<RawBioAssay> |
extractAndCreateRawBioAssays(DbControl dc,
List<String> headers,
boolean verifyColumns,
File rawDataFile)
Extract array names and raw data property names from the column headers. |
|
About |
getAbout()
Get information about the plugin, such as name, version, authors, etc. |
|
private static String |
getColumnName(RawDataProperty rdp,
RawBioAssay rba)
Convert a raw data property to a column name. |
|
private RequestInformation |
getConfigureJobParameters(GuiContext context)
|
|
protected String |
getDecimalSeparator()
Get the decimal separator used by numbers in the file. |
|
Set<GuiContext> |
getGuiContexts()
Get a set containing all items that the plugin handles. |
|
protected FlatFileParser |
getInitializedFlatFileParser()
Create a FlatFileParser that can parse Illumina data files: Data splitter: (,|\t) Header regexp: (.+)=(.*?) |
|
private
|
getItems(DbControl dc,
ItemQuery<T> query,
Restriction... restrictions)
Sort the items by name and add USE permission filter to the query. |
|
RequestInformation |
getRequestInformation(GuiContext context,
String command)
This method will return the RequestInformation for a given command, i.e. |
|
protected String |
getSuccessMessage(int skippedLines)
Called if the parsing was successful to let the subclass generate a simple message that is sent back to the core and user interface. |
|
protected void |
handleData(FlatFileParser.Data data)
Called by the parser for every line in the file that is a data line. |
|
protected void |
handleHeader(FlatFileParser.Line line)
Copy headers so that we can set them on the raw bioassays in beginData() |
|
protected boolean |
isImportable(FlatFileParser ffp)
Check that the first line contains the text "Illumina" |
|
String |
isInContext(GuiContext context,
Object item)
If used from an experiment context, verify that the experiment is an 'illumina' experiment and that the logged in user has permission to write. |
|
boolean |
requiresConfiguration()
Return TRUE, since the implementation requires it for finding the regular expressions used by the FlatFileParser . |
|
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.plugins.AbstractFlatFileImporter |
---|
addErrorHandler, checkColumnMapping, checkColumnMapping, continueWithNextFileAfterError, doImport, finish, getCharset, getCharset, getCharsetParameter, getDecimalSeparatorParameter, getErrorHandler, getErrorOption, getFileIterator, getMainType, getMapper, getNumberFormat, getNumBytes, getPrimaryLocationFilter, getProgress, getSignalHandler, getTotalFileSize, handleSection, isImportable, log, log, log, log, run, setUpErrorHandling, start, wrapInputStream |
Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
---|
checkInterrupted, cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, getPermissions, 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, getMainType, getPermissions, init, run |
Field Detail |
---|
private static final About about
private static final Set<GuiContext> guiContexts
private static final PluginParameter<String> featureIdentificationParameter
private static final PluginParameter<String> invalidColumnsErrorParameter
private static final PluginParameter<String> missingReporterErrorParameter
private static final PluginParameter<String> featureMismatchErrorParameter
private static final PluginParameter<String> associationsSection
private RequestInformation configureJob
private RawDataType illumina
private FlatFileParser ffp
private DbControl dc
private Experiment experiment
private ArrayDesign design
private Scan scan
private Software software
private Protocol protocol
private FeatureIdentificationMethod fiMethod
private List<RawBioAssay> rawBioAssays
private List<IlluminaRawDataImporter.BatchAndMapHolder> holders
private List<FlatFileParser.Line> headerLines
private Mapper reporterMapper
private int numInserted
private int numRawBioAssays
private NumberFormat numberFormat
private boolean nullIfException
private boolean verifyColumns
private boolean nullIfMissingReporter
private boolean useSmartFeatureMismatchHandling
private static final Pattern splitHeader
Constructor Detail |
---|
public IlluminaRawDataImporter()
Method Detail |
---|
public About getAbout()
Plugin
getAbout
in interface Plugin
About
objectpublic boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations
in interface Plugin
supportsConfigurations
in class AbstractPlugin
public boolean requiresConfiguration()
AbstractFlatFileImporter
FlatFileParser
. If this
method is overridden and returns FALSE, the subclass must also override
the AbstractFlatFileImporter.getInitializedFlatFileParser()
method and provide a
parser with all regular expressions and other options set.
requiresConfiguration
in interface Plugin
requiresConfiguration
in class AbstractFlatFileImporter
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 String isInContext(GuiContext context, Object item)
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 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 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
throughprotected FlatFileParser getInitializedFlatFileParser() throws BaseException
isImportable(FlatFileParser)
) when we know which one is actually
used, we change this in the parser. We need to do this since numbers may
use comma as decimal separator.
getInitializedFlatFileParser
in class AbstractFlatFileImporter
BaseException
protected String getDecimalSeparator()
AbstractFlatFileImporter
getDecimalSeparator
in class AbstractFlatFileImporter
protected boolean isImportable(FlatFileParser ffp)
isImportable
in class AbstractFlatFileImporter
ffp
- The FlatFileParser object used to parse the file
protected void begin(FlatFileParser ffp) throws BaseException
AbstractFlatFileImporter
AbstractFlatFileImporter.getFileIterator()
.
begin
in class AbstractFlatFileImporter
BaseException
AbstractFlatFileImporter.end(boolean)
protected void handleHeader(FlatFileParser.Line line) throws BaseException
handleHeader
in class AbstractFlatFileImporter
BaseException
protected void beginData()
Mapper
:s.
beginData
in class AbstractFlatFileImporter
protected void handleData(FlatFileParser.Data data) throws BaseException
AbstractFlatFileImporter
handleData
in class AbstractFlatFileImporter
BaseException
protected void end(boolean success) throws BaseException
end
in class AbstractFlatFileImporter
success
- TRUE if the file was parsed successfully, FALSE otherwise
BaseException
AbstractFlatFileImporter.begin(FlatFileParser)
protected String getSuccessMessage(int skippedLines)
AbstractFlatFileImporter
178 reporters imported successfully
.
The default implementation always return null. Note that this method is called
once for every file returned by AbstractFlatFileImporter.getFileIterator()
.
getSuccessMessage
in class AbstractFlatFileImporter
skippedLines
- The number of data lines that were skipped due to errorsprivate List<RawBioAssay> extractAndCreateRawBioAssays(DbControl dc, List<String> headers, boolean verifyColumns, File rawDataFile)
private RequestInformation getConfigureJobParameters(GuiContext context)
private static String getColumnName(RawDataProperty rdp, RawBioAssay rba)
private <T extends BasicItem> List<T> getItems(DbControl dc, ItemQuery<T> query, Restriction... restrictions)
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |