Package net.sf.basedb.core.plugin
Class AbstractAnalysisPlugin
java.lang.Object
net.sf.basedb.core.plugin.AbstractPlugin
net.sf.basedb.core.plugin.AbstractAnalysisPlugin
- All Implemented Interfaces:
Plugin
- Direct Known Subclasses:
Base1PluginExecuter
,ExternalProgramExecutor
,FormulaFilter
,JepExtraValueCalculator
,JepIntensityTransformer
,LowessNormalization
,ManualDerivedBioAssayCreator
,ManualTransformCreator
,MedianRatioNormalization
This is a base class that is useful for all analysis type plugins.
It has helper methods for generating some common parameter types
needed by many plugins, such as the source bioassay set and child
bioassay set name and description, etc.
- Version:
- 2.0
- Author:
- nicklas
- Last modified
- $Date: 2019-02-26 11:10:15 +0100 (tis, 26 feb. 2019) $
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.sf.basedb.core.plugin.Plugin
Plugin.MainType
-
Field Summary
Modifier and TypeFieldDescriptionprotected static final String
The name of the parameter that asks for the description of the child bioassay set.protected static final String
The name of the parameter that asks for the name of the child bioassay set.protected static final GuiContext
GuiContext = [Item.BIOASSAY, GuiContext.Type.LIST]protected static final GuiContext
GuiContext = [Item.BIOASSAYSET, GuiContext.Type.ITEM]protected static final GuiContext
GuiContext = [Item.DERIVEDBIOASSAY, GuiContext.Type.ITEM]protected static final Set<GuiContext>
The default gui contexts where it makes sense to use an analysis plugin.private static final StringParameterType
A parameter type for description parameters.protected static final StringParameterType
A parameter type for name parameters which are required and must have a value.protected static final StringParameterType
A parameter type for name parameters which are optional.protected static final String
protected static final String
protected static final String
private PluginParameter<BioAssaySet>
The source parameter for bioassay set.private static final ItemParameterType<BioAssaySet>
The parameter type for the source bioassay set.private PluginParameter<DerivedBioAssay>
The source parameter for derived bioassay.private static final ItemParameterType<DerivedBioAssay>
The parameter type for the source derived bioassay.private PluginParameter<BioAssay>
The bioAssays subset parameter.protected static final String
The name of the parameter that asks for the name of the transformation.Fields inherited from class net.sf.basedb.core.plugin.AbstractPlugin
annotationSection, configuration, COPY_ANNOTATIONS, job, OVERWRITE_ANNOTATIONS, sc
-
Constructor Summary
ModifierConstructorDescriptionprotected
Create a newAbstractAnalysisPlugin
. -
Method Summary
Modifier and TypeMethodDescriptionprotected PluginParameter<String>
getChildDescriptionParameter
(String label, String description, String defaultValue) Create a plugin parameter that asks for the description of the child bioassay set.protected PluginParameter<String>
getChildNameParameter
(String label, String description, String defaultValue) Create a plugin parameter that asks for the name of the child bioassay set.protected BioAssaySet
Get the current source bioassay set.protected DerivedBioAssay
Get the current source derived bioassay.protected Experiment
Get the current experiment from information in the current context:SessionControl.getCurrentContext(Item.EXPERIMENT)
.Get the type of the plugin.Gets a list of bioassays that were selected from the current bioassay set, to use for the analysis.protected BioAssaySet
Get the bioassay set that is used as the source for the plugin.protected PluginParameter<BioAssaySet>
getSourceBioAssaySetParameter
(String label, String description) Get a plugin parameter that asks for a bioassay set to use as data source for the plugin.protected PluginParameter<BioAssay>
getSourceBioAssaysParameter
(String label, String description) Gets a plugin parameter that asks for a subset of bioassays to use as data source for the plugin.protected DerivedBioAssay
Get the derived bioassay that is used as the source for the plugin.protected PluginParameter<DerivedBioAssay>
getSourceDerivedBioAssayParameter
(String label, String description) Get a plugin parameter that asks for a derived bioassay to use as data source for the plugin.protected String
Generate a name for the transformation based on the plugin and it's configuration.protected PluginParameter<String>
getTransformationNameParameter
(String label, String description, String defaultValue) Create a plugin parameter that asks for the name of the transformation.isInContext
(GuiContext context, Object item) Check that the item is a bioassayset/derived bioassay and that the logged in user has permission to use the current item.protected DynamicSpotQuery
restrictSource
(DynamicSpotQuery query, List<BioAssay> bioAssays) Restricts a query to only include values from listed bioassaysMethods inherited from class net.sf.basedb.core.plugin.AbstractPlugin
cloneParameterWithDefaultValue, closeLogFile, createLogFile, done, getCopyAnnotationsParmeter, getCurrentConfiguration, getCurrentJob, getJobOrConfigurationValue, getOverwriteAnnotationsParameters, getPermissions, init, isLogging, log, log, requiresConfiguration, storeValue, storeValue, storeValues, supportsConfigurations, validateRequestParameters
-
Field Details
-
CONTEXT_BIOASSAYSET
GuiContext = [Item.BIOASSAYSET, GuiContext.Type.ITEM]- Since:
- 2.4
-
CONTEXT_BIOASSAYS
GuiContext = [Item.BIOASSAY, GuiContext.Type.LIST]- Since:
- 2.4
-
CONTEXT_DERIVEDBIOASSAY
GuiContext = [Item.DERIVEDBIOASSAY, GuiContext.Type.ITEM]- Since:
- 3.0
-
defaultGuiContexts
The default gui contexts where it makes sense to use an analysis plugin. Override for theInteractivePlugin.getGuiContexts()
method to specify other contexts. This set can't be modified. This set only includes theCONTEXT_BIOASSAYSET
. -
nameType
A parameter type for name parameters which are required and must have a value. -
optionalNameType
A parameter type for name parameters which are optional. -
descriptionType
A parameter type for description parameters. -
sourceBioAssaySetType
The parameter type for the source bioassay set. -
sourceBioAssaySetParameter
The source parameter for bioassay set. -
sourceDerivedBioAssayType
The parameter type for the source derived bioassay.- Since:
- 3.0
-
sourceDerivedBioAssayParameter
The source parameter for derived bioassay.- Since:
- 3.0
- See Also:
-
sourceSubSetParameter
The bioAssays subset parameter. To use when working on subset of bioassays in a bioAssaySet -
SOURCE_BIOASSAYSET
- See Also:
-
SOURCE_DERIVEDBIOASSAY
- See Also:
-
SOURCE_BIOASSAYS
- See Also:
-
CHILD_NAME
The name of the parameter that asks for the name of the child bioassay set. -
CHILD_DESCRIPTION
The name of the parameter that asks for the description of the child bioassay set. -
TRANSFORMATION_NAME
The name of the parameter that asks for the name of the transformation.
-
-
Constructor Details
-
AbstractAnalysisPlugin
protected AbstractAnalysisPlugin()Create a newAbstractAnalysisPlugin
.
-
-
Method Details
-
getMainType
Description copied from interface:Plugin
Get the type of the plugin. This method must always return the same value.- Returns:
Plugin.MainType.ANALYZE
-
getGuiContexts
-
isInContext
Check that the item is a bioassayset/derived bioassay and that the logged in user has permission to use the current item.- Parameters:
context
- Current guicontextitem
- The item to check.- Returns:
- null if the item is a valid item, an error message otherwise
- Throws:
PermissionDeniedException
- If the logged in user dosen't have permission to use the Experiment
-
getSourceBioAssaySetParameter
protected PluginParameter<BioAssaySet> getSourceBioAssaySetParameter(String label, String description) Get a plugin parameter that asks for a bioassay set to use as data source for the plugin. Calling this method multiple times return the same plugin parameter object. The label and description for the first call is always used.- Parameters:
label
- The parameter label, or null to use the default (Source bioasay set)description
- The parameter description, or null to use the default (The bioassay set that is used as the data source for this job.)
-
getSourceDerivedBioAssayParameter
protected PluginParameter<DerivedBioAssay> getSourceDerivedBioAssayParameter(String label, String description) Get a plugin parameter that asks for a derived bioassay to use as data source for the plugin. Calling this method multiple times return the same plugin parameter object. The label and description for the first call is always used.- Parameters:
label
- The parameter label, or null to use the default (Source bioassay)description
- The parameter description, or null to use the default (The derived bioassay that is used as the data source for this job.)
-
getSourceBioAssaysParameter
Gets a plugin parameter that asks for a subset of bioassays to use as data source for the plugin.- Parameters:
label
- The parameter's label. Uses a default value if null.description
- Description of the parameter. Uses a default value if null.- Returns:
- A plugin parameter
- Since:
- 2.4
-
getChildNameParameter
protected PluginParameter<String> getChildNameParameter(String label, String description, String defaultValue) Create a plugin parameter that asks for the name of the child bioassay set.- Parameters:
label
- The label to use for the parameter or null to use the default label (Child name)description
- The description to use for the parameter or null to use the default description (The name of the child bioassay set)defaultValue
- The default value for the child name or null to use the default value (New bioassay set)- Returns:
- A plugin parameter
-
getChildDescriptionParameter
protected PluginParameter<String> getChildDescriptionParameter(String label, String description, String defaultValue) Create a plugin parameter that asks for the description of the child bioassay set.- Parameters:
label
- The label to use for the parameter or null to use the default label (Child description)description
- The description to use for the parameter or null to use the default description (An optional description of the child bioassay set)defaultValue
- The default value for the child name or null to not use any default value- Returns:
- A plugin parameter
-
getTransformationNameParameter
protected PluginParameter<String> getTransformationNameParameter(String label, String description, String defaultValue) Create a plugin parameter that asks for the name of the transformation.- Parameters:
label
- The label to use for the parameter or null to use the default label (Transformation name)description
- The description to use for the parameter or null to use the default description (The name of the transformation)defaultValue
- The default value for the transformation name or null to not use any default- Returns:
- A plugin parameter
-
getCurrentExperiment
Get the current experiment from information in the current context:SessionControl.getCurrentContext(Item.EXPERIMENT)
. Note that this information is normally only available during the configuration phase of a plugin, not during the execution phase.- Parameters:
dc
- The DbControl to use for database access- Returns:
- The current experiment or null
-
getCurrentBioAssaySet
Get the current source bioassay set. We first check the job's parameter values with thegetSourceBioAssaySet(DbControl)
method. If this returns null we check the information in the current context:SessionControl.getCurrentContext(Item.BIOASSAYSET)
. Note that this information is normally only available during the configuration phase of a plugin, not during the execution phase.- Parameters:
dc
- The DbControl to use for database access- Returns:
- The current bioassay set or null
- See Also:
-
getSourceBioAssaySet
Get the bioassay set that is used as the source for the plugin. The source bioassay set is only available in the execution phase if the plugin has saved it as a job parameter during the configuration of a job.- Returns:
- The source bioassay set or null
- See Also:
-
getSourceBioAssays
Gets a list of bioassays that were selected from the current bioassay set, to use for the analysis.- Parameters:
dc
- The DbControl to access the database with- Returns:
- A list with bioassays or null.
- Since:
- 2.4
-
getCurrentDerivedBioAssay
Get the current source derived bioassay. We first check the job's parameter values with thegetSourceDerivedBioAssay(DbControl)
method. If this returns null we check the information in the current context:SessionControl.getCurrentContext(Item.DERIVEDBIOASSAY)
. Note that this information is normally only available during the configuration phase of a plugin, not during the execution phase.- Parameters:
dc
- The DbControl to use for database access- Returns:
- The current derived bioassay or null
- Since:
- 3.0
- See Also:
-
getSourceDerivedBioAssay
Get the derived bioassay that is used as the source for the plugin. The source bioassay is only available in the execution phase if the plugin has saved it as a job parameter during the configuration of a job.- Returns:
- The source derived bioassay or null
- Since:
- 3.0
- See Also:
-
getTransformationName
Generate a name for the transformation based on the plugin and it's configuration. The name is created by taking the name of the plugin from theAbout.getName()
method and combine it with the configuration used. If no configuration is used only the plugin name is used.- Parameters:
dc
- The DbControl to use for database access- Returns:
- A name for the transformation
-
restrictSource
Restricts a query to only include values from listed bioassays- Parameters:
query
- The query to set restriction onbioAssays
- A list with bioassays the restriction should include- Returns:
- A DynamicSpotQuery object. The query parameter is restricted if bioAssays holds item(s), otherwise it will it will be the same
- Since:
- 2.4
-