|
3.1.1: 2012-03-29 | ||||||||
| 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.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. |
|
private DerivedBioAssay |
findBioAssay(List<DerivedBioAssay> bioAssays,
String name)
|
|
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, getErrorHandler, getErrorOption, getFileIterator, getMainType, getMapper, getMapper, getNumberFormat, getNumBytes, getProgress, getSignalHandler, getTotalFileSize, handleSection, isImportable, log, log, log, log, run, setUpErrorHandling, start, wrapInputStream |
| Methods inherited from class net.sf.basedb.core.plugin.AbstractPlugin |
|---|
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 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 List<DerivedBioAssay> bioAssays
private ArrayDesign design
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 boolean supportsConfigurations()
AbstractPlugin
supportsConfigurations in interface PluginsupportsConfigurations in class AbstractPluginpublic boolean requiresConfiguration()
AbstractFlatFileImporterFlatFileParser. 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 PluginrequiresConfiguration in class AbstractFlatFileImporterpublic Set<GuiContext> getGuiContexts()
InteractivePluginItem.REPORTER.
This information is used by client applications to put the plugin
in the proper place in the user interface.
getGuiContexts in interface InteractivePluginSet containing Item:s, or null
if the plugin is not concerned about items
public String isInContext(GuiContext context,
Object item)
isInContext in interface InteractivePlugincontext - 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 used
public RequestInformation getRequestInformation(GuiContext context,
String command)
throws BaseException
InteractivePluginRequestInformation for a given command, i.e.
the list of parameters and some nice help text.
getRequestInformation in interface InteractivePlugincontext - 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 error
public void configure(GuiContext context,
Request request,
Response response)
InteractivePluginInteractivePlugin.getRequestInformation(GuiContext, String).
configure in interface InteractivePlugincontext - 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
through
protected 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 AbstractFlatFileImporterBaseExceptionprotected String getDecimalSeparator()
AbstractFlatFileImporter
getDecimalSeparator in class AbstractFlatFileImporterprotected boolean isImportable(FlatFileParser ffp)
isImportable in class AbstractFlatFileImporterffp - The FlatFileParser object used to parse the file
protected void begin(FlatFileParser ffp)
throws BaseException
AbstractFlatFileImporterAbstractFlatFileImporter.getFileIterator().
begin in class AbstractFlatFileImporterBaseExceptionAbstractFlatFileImporter.end(boolean)
protected void handleHeader(FlatFileParser.Line line)
throws BaseException
handleHeader in class AbstractFlatFileImporterBaseExceptionprotected void beginData()
Mapper:s.
beginData in class AbstractFlatFileImporter
protected void handleData(FlatFileParser.Data data)
throws BaseException
AbstractFlatFileImporter
handleData in class AbstractFlatFileImporterBaseException
protected void end(boolean success)
throws BaseException
end in class AbstractFlatFileImportersuccess - TRUE if the file was parsed successfully, FALSE otherwise
BaseExceptionAbstractFlatFileImporter.begin(FlatFileParser)protected String getSuccessMessage(int skippedLines)
AbstractFlatFileImporter178 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 AbstractFlatFileImporterskippedLines - The number of data lines that were skipped due to errors
private List<RawBioAssay> extractAndCreateRawBioAssays(DbControl dc,
List<String> headers,
boolean verifyColumns,
File rawDataFile)
private DerivedBioAssay findBioAssay(List<DerivedBioAssay> bioAssays,
String name)
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)
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||