Class BioAssaySet
- All Implemented Interfaces:
AccessControlled
,Annotatable
,FileStoreEnabled
,Identifiable
,Nameable
,Removable
Transformation
has been applied to it. The first
transformation is called a root transformation. A bioassayset created
by a root transformation is called a root bioassayset.
A bioassayset is created by the Transformation.newProduct(String, String, boolean)
method. Bioassaysets can only be created if the transformation hasn't been
committed to the database.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
Field Summary
Modifier and TypeFieldDescriptionStores the result ofgetSpotCount(int)
.private FilterBatcher
The one and only filter batcher for this bioassayset.private Query<BioAssaySetData>
Query to retrieve children for a bioassayset.private Map<ExtraValueType,
PositionExtraValueBatcher<?>> Cache of already created position extra value batchers.private SpotBatcher
The one and only spot batcher for this bioassayset.private Map<ExtraValueType,
SpotExtraValueBatcher<?>> Cache of already created spot extra value batchers.static final Item
The type of item represented by this class.Fields inherited from interface net.sf.basedb.core.Nameable
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
-
Constructor Summary
ConstructorDescriptionBioAssaySet
(BioAssaySetData data) Creates a new experiment item from the given data. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
addChildBioAssaySets
(BioAssaySetData parent, Set<BioAssaySetData> all) Find all bioassaysets that are children to the specified parent (ie.private void
private void
private void
Count the number of unique reporters and spots in all bioassays in this bioassayset.private void
Called when a bioassayset is about to be deleted.Get the parent bioassay set (if any) and the experiment.Get the annotation set containing the annotations for this item.Get a query returning the bioassays that are part of this bioassayset.static BioAssaySet
Get aBioAssaySet
item when you know the id.(package private) BioAssaySetData
getData()
Get theBasicData
object that holds all data for this item.(package private) DataCube
Get the data cube this biossayset stores it's data in.(package private) DataCubeFilter
Get the data cube filter this biossayset uses to filter spot data.short
Get the number of the filter that this bioassayset is using, or 0 if no filter is used.(package private) DataCubeLayer
Get the data cube layer this biossayset stores it's data in.short
Get the layer coordinate in the data cube that this bioassayset stores it's data in.short
Get the number of the data cube this bioassayset stores it's data in.Get the description for the item.Get the experiment this bioassayset belongs to.getExtraValue
(ExtraValueType extraValueType) Get the extra value of the specified type in this bioassayset.Get a query returning the extra values that are part of this bioassayset.Get a query returning all extra values types that are used in this bioassay set.Get the file set that collects all files that holds data for this item.Get a batcher used to insert the position/column coordinates that remain after some filter has been applied to the spot data of a bioassayset.Get information about in what way the spot intensities has been transformed before they were stored in the database.Get a batcher used to insert mappings to raw data.int
Get the number of mappings to raw data spots for the spot with the most number of mappings.getName()
Get the name of the item.(package private) static BioAssaySet
getNew
(DbControl dc, Transformation transformation, DataCubeLayer layer) Create a newBioAssaySet
item.int
Get the number of unique reporters for data that is stored in files.int
Get the number of spots that are stored in files.int
Get the number of unique reporters among all bioassays in this bioassayset.int
Get the number of spots in all bioassays in this bioassayset.Get the file set from the parent bioassay set if it exists.(package private) Permission
USE permission is enough to be able to manage bioassay sets.Get the platform the item is related to.Get a batcher that links position coordinates to reporters for the data cube this bioassayset uses.Get a query that returns position data for the data cube where this bioassayset is located.<I> PositionExtraValueBatcher<I>
getPositionExtraValueBatcher
(Class<I> clazz, ExtraValueType extraValueType, Job job) Get a batcher that is used to insert extra values per position of the specified type.Default implementation returns null.static ItemQuery<BioAssaySet>
getQuery
(Experiment experiment) Get a query configured to retrieve bioassaysets for a given experiment.static ItemQuery<BioAssaySet>
getQuery
(Transformation transformation) Get a query configured to retrieve bioassaysets created by a given transformation.Get the raw data type this experiment uses for the raw data.Get the user that flagged this item for removal.(package private) SharedData
Get the experiment.Get a batcher used to insert spot data for this bioassayset.(package private) int
getSpotCount
(int column) Get the number of spots in a single bioassay.Get a query that returns spot data for this bioassayset.<I> SpotExtraValueBatcher<I>
getSpotExtraValueBatcher
(Class<I> clazz, ExtraValueType extraValueType, Job job) Get a batcher that is used to insert extra values per spot of the specified type.Get the transformation that created this bioassayset.Get a query that return all transformations using this bioassayset as a source.getType()
Get the type of item represented by the object.Get the platform variant the item is related to.(package private) VirtualDb
Get the virtual database this bioassayset stores it's data in.boolean
Check if this item has a file set.boolean
Check if this item has an annotation set.boolean
Check if the removed flag is set for this item.newBioAssay
(Collection<BioAssay> parents) Create a newBioAssay
with links to multiple parent bioassays.newBioAssay
(BioAssay parent) Create a newBioAssay
in this bioassayset using a single parent.private BioAssay
newBioAssay
(DataCubeColumn column, Collection<BioAssay> parents) Create a new bioassay and link to the parents.newRootBioAssay
(Collection<RawBioAssay> rawParents) Create a newBioAssay
with links to raw bioassays.newTransformation
(Job job) Create a new transformation using this bioassayset as it's source bioassayset.(package private) void
onBeforeCommit
(Transactional.Action action) On creation, count the number of spots and reporters in the bioassays attached to this bioassayset.void
Remove all annotations from this item, by deleting the annotation set.private void
setDataCubeFilter
(DataCubeFilter filter) private void
setDataCubeLayer
(DataCubeLayer layer) void
setDescription
(String description) Set the description for the item.private void
setExperiment
(Experiment experiment) Set the experiment.void
setIntensityTransform
(IntensityTransform transform) Sets the transform used on the spot intensities before they were stored in the database.void
Set the name of the item.void
setNumFileReporters
(int numReporters) Set the number of unique reporters for data that is stored in files.void
setNumFileSpots
(int numSpots) Set the number of spots that are stored in files.void
setRemoved
(boolean removed) Set the removed flag for this item.private void
setTransformation
(Transformation transformation) Set the transformation that created this bioassayset.Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, getPluginPermissions, initPermissions
Methods inherited from class net.sf.basedb.core.BasicItem
addAnnotatableParents, addUsingItems, addUsingItems, breakCircularReferences, checkBatchAnnotatableUsage, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.sf.basedb.core.AccessControlled
checkPermission, getPermissions, hasPermission
Methods inherited from interface net.sf.basedb.core.Identifiable
getId, getVersion
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
spotBatcher
The one and only spot batcher for this bioassayset.- See Also:
-
filterBatcher
The one and only filter batcher for this bioassayset.- See Also:
-
spotExtraValueBatchers
Cache of already created spot extra value batchers. -
positionExtraValueBatchers
Cache of already created position extra value batchers. -
bioAssaySpots
Stores the result ofgetSpotCount(int)
. -
findChildren
Query to retrieve children for a bioassayset.
-
-
Constructor Details
-
BioAssaySet
BioAssaySet(BioAssaySetData data) Creates a new experiment item from the given data.- Parameters:
data
- the data
-
-
Method Details
-
getNew
static BioAssaySet getNew(DbControl dc, Transformation transformation, DataCubeLayer layer) throws PermissionDeniedException, InvalidDataException, BaseException Create a newBioAssaySet
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.transformation
- The transformation that created the bioassaysetlayer
- The data cube layer where the bioassayset should store it's data- Returns:
- The new
BioAssaySet
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission for the experiment the transformation belongs toInvalidDataException
- If the transformation is nullBaseException
- If there is an error- See Also:
-
getById
public static BioAssaySet getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aBioAssaySet
item when you know the id.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.id
- The id of the item to load- Returns:
- The
BioAssaySet
item - Throws:
ItemNotFoundException
- If an item with the specified id is not foundPermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission to the itemBaseException
- If there is another error
-
getQuery
Get a query configured to retrieve bioassaysets for a given experiment.- Parameters:
experiment
- The experiment to retreive bioassaysets for, null is not allowed- Returns:
- An
ItemQuery
object - Throws:
InvalidDataException
- If the parameter is null.
-
getQuery
public static ItemQuery<BioAssaySet> getQuery(Transformation transformation) throws InvalidDataException Get a query configured to retrieve bioassaysets created by a given transformation.- Parameters:
transformation
- The transformation to retreive bioassaysets for, null is not allowed- Returns:
- An
ItemQuery
object - Throws:
InvalidDataException
- If the transformation parameter is null.
-
getData
BioAssaySetData getData()Description copied from class:BasicItem
Get theBasicData
object that holds all data for this item. -
getType
Description copied from interface:Identifiable
Get the type of item represented by the object. The returned value is one of the values defined in theItem
enumeration.- Specified by:
getType
in interfaceIdentifiable
- Returns:
- A value indicating the type of item
-
getName
Description copied from interface:Nameable
Get the name of the item. -
setName
Description copied from interface:Nameable
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by theNameable.MAX_NAME_LENGTH
constant.- Specified by:
setName
in interfaceNameable
- Parameters:
name
- The new name for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the name is null or longer than specified by theNameable.MAX_NAME_LENGTH
constant
-
getDescription
Description copied from interface:Nameable
Get the description for the item.- Specified by:
getDescription
in interfaceNameable
- Returns:
- A
String
with a description of the item
-
setDescription
public void setDescription(String description) throws PermissionDeniedException, InvalidDataException Description copied from interface:Nameable
Set the description for the item. The description can be null but mustn't be longer than the value specified by theNameable.MAX_DESCRIPTION_LENGTH
constant.- Specified by:
setDescription
in interfaceNameable
- Parameters:
description
- The new description for the item- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionInvalidDataException
- If the description longer than specified by theNameable.MAX_DESCRIPTION_LENGTH
constant
-
isRemoved
public boolean isRemoved()Description copied from interface:Removable
Check if the removed flag is set for this item. -
setRemoved
Description copied from interface:Removable
Set the removed flag for this item.- Specified by:
setRemoved
in interfaceRemovable
- Parameters:
removed
- TRUE if the item should be flagged as removed, FALSE otherwise- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.DELETE
permission for setting the flag to TRUE orPermission.WRITE
permission for setting the flag to FALSE
-
getRemovedBy
Description copied from interface:Removable
Get the user that flagged this item for removal.- Specified by:
getRemovedBy
in interfaceRemovable
- Returns:
- A User object, or null if this item has not been flagged
- Throws:
PermissionDeniedException
- If the logged in user doesn't havePermission.READ
permission for the userItemNotFoundException
- If the user that removed this item can't be found
-
getAnnotationSet
Description copied from interface:Annotatable
Get the annotation set containing the annotations for this item. If the item doesn't have any annotations a new annotation set is created and automatically saved to the database whenDbControl.commit()
is called. To check if an item has annotations without creating a new annotation set use theAnnotatable.isAnnotated()
method.- Specified by:
getAnnotationSet
in interfaceAnnotatable
- Returns:
- An
AnnotationSet
- Throws:
PermissionDeniedException
- If the logged in user doesn't have enough permissionsBaseException
- If there is another error- Since:
- 2.2
-
isAnnotated
public boolean isAnnotated()Description copied from interface:Annotatable
Check if this item has an annotation set. The annotation set may be empty.- Specified by:
isAnnotated
in interfaceAnnotatable
- Returns:
- TRUE if an annotation set exists, FALSE otherwise
- Since:
- 2.2
-
removeAnnotations
Description copied from interface:Annotatable
Remove all annotations from this item, by deleting the annotation set.- Specified by:
removeAnnotations
in interfaceAnnotatable
- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permissionBaseException
- If there is another error- Since:
- 2.2
-
getProtocol
Default implementation returns null. Should be overriden by subclasses that has protocols.- Specified by:
getProtocol
in interfaceAnnotatable
- Returns:
- Always null
- Since:
- 2.2
-
getAnnotatableParents
Get the parent bioassay set (if any) and the experiment.- Specified by:
getAnnotatableParents
in interfaceAnnotatable
- Returns:
- A set containing annotatable items, or null
- Throws:
BaseException
- If there is an error- Since:
- 2.2
-
getFileSet
Description copied from interface:FileStoreEnabled
Get the file set that collects all files that holds data for this item. If no file set exists a new one is created and automatically saved to the database whenDbControl.commit()
is called. To check if an item has files without creating a new file set use theFileStoreEnabled.hasFileSet()
method.- Specified by:
getFileSet
in interfaceFileStoreEnabled
- Returns:
- A file set
- Since:
- 2.8
-
hasFileSet
public boolean hasFileSet()Description copied from interface:FileStoreEnabled
Check if this item has a file set. Always call this method beforeFileStoreEnabled.getFileSet()
to avoid creating a new file set when there is no need for it.- Specified by:
hasFileSet
in interfaceFileStoreEnabled
- Returns:
- TRUE if a file set exists, FALSE if not
- Since:
- 2.8
-
getPlatform
Description copied from interface:FileStoreEnabled
Get the platform the item is related to. The platform is used to limit theDataFileType
:s that can be added to the file set.- Specified by:
getPlatform
in interfaceFileStoreEnabled
- Returns:
- Always null
- Since:
- 2.8
-
getVariant
Description copied from interface:FileStoreEnabled
Get the platform variant the item is related to. The platform is used to limit theDataFileType
:s that can be added to the file set.- Specified by:
getVariant
in interfaceFileStoreEnabled
- Returns:
- Always null
- Since:
- 2.8
-
getParentFileSets
Get the file set from the parent bioassay set if it exists.- Specified by:
getParentFileSets
in interfaceFileStoreEnabled
- Returns:
- A collection of
FileSet
or null - Since:
- 2.8
-
onBeforeCommit
On creation, count the number of spots and reporters in the bioassays attached to this bioassayset. On deletion, delete all analysed data in this bioassayset and all child bioassaysets.- Overrides:
onBeforeCommit
in classBasicItem
- Throws:
BaseException
- If there is an error- See Also:
-
getPermissionForWriteDeleteAndCreate
Permission getPermissionForWriteDeleteAndCreate()USE permission is enough to be able to manage bioassay sets.- Overrides:
getPermissionForWriteDeleteAndCreate
in classChildItem
-
getExperiment
Get the experiment this bioassayset belongs to.- Returns:
- An
Experiment
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the experimentBaseException
- If there is another error
-
setExperiment
private void setExperiment(Experiment experiment) throws PermissionDeniedException, InvalidDataException Set the experiment. This cannot be changed after the bioassayset has been created. -
getTransformation
Get the transformation that created this bioassayset.- Returns:
- A
Transformation
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the experimentBaseException
- If there is another error
-
setTransformation
private void setTransformation(Transformation transformation) throws PermissionDeniedException, InvalidDataException Set the transformation that created this bioassayset. This cannot be changed after the bioassayset has been created. -
getRawDataType
Get the raw data type this experiment uses for the raw data. The raw data type cannot be changed once the experiment has been created.- Returns:
- A
RawDataType
object
-
getNumReporters
public int getNumReporters()Get the number of unique reporters among all bioassays in this bioassayset. -
getNumSpots
public int getNumSpots()Get the number of spots in all bioassays in this bioassayset. -
getNumFileReporters
public int getNumFileReporters()Get the number of unique reporters for data that is stored in files.- Since:
- 2.8
-
setNumFileReporters
public void setNumFileReporters(int numReporters) Set the number of unique reporters for data that is stored in files.- Parameters:
numReporters
- The number of reporters- Since:
- 2.8
-
getNumFileSpots
public int getNumFileSpots()Get the number of spots that are stored in files.- Since:
- 2.8
-
setNumFileSpots
public void setNumFileSpots(int numSpots) Set the number of spots that are stored in files.- Parameters:
numSpots
- The number of spots- Since:
- 2.8
-
getMaxRawMappingsForSpot
public int getMaxRawMappingsForSpot()Get the number of mappings to raw data spots for the spot with the most number of mappings. For most bioassay sets this value is probably 1. After a merge, the count can be higher which may require some plugins to behave differently when using values from the raw data table.- Since:
- 2.2
-
getIntensityTransform
Get information about in what way the spot intensities has been transformed before they were stored in the database.- Since:
- 2.12
-
setIntensityTransform
Sets the transform used on the spot intensities before they were stored in the database. NOTE! Calling this method doesn't change the data in the database!- Parameters:
transform
- The transform that was used to store the data- Since:
- 2.12
-
getDataCubeNo
public short getDataCubeNo()Get the number of the data cube this bioassayset stores it's data in.- See Also:
-
getDataCubeLayerNo
public short getDataCubeLayerNo()Get the layer coordinate in the data cube that this bioassayset stores it's data in.- See Also:
-
getDataCubeFilterNo
public short getDataCubeFilterNo()Get the number of the filter that this bioassayset is using, or 0 if no filter is used.- Returns:
- The number of the filter or 0 if no filter is used
- See Also:
-
getVirtualDb
VirtualDb getVirtualDb()Get the virtual database this bioassayset stores it's data in. -
getDataCube
Get the data cube this biossayset stores it's data in. -
getDataCubeLayer
DataCubeLayer getDataCubeLayer()Get the data cube layer this biossayset stores it's data in. -
setDataCubeLayer
-
getDataCubeFilter
DataCubeFilter getDataCubeFilter()Get the data cube filter this biossayset uses to filter spot data. -
setDataCubeFilter
-
newTransformation
Create a new transformation using this bioassayset as it's source bioassayset.- Parameters:
job
- The job that executed the transformation- Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission for the experiment this bioassayset belongs toBaseException
- If there is another error
-
getTransformations
Get a query that return all transformations using this bioassayset as a source.- Returns:
- An
ItemQuery
object - See Also:
-
newRootBioAssay
public BioAssay newRootBioAssay(Collection<RawBioAssay> rawParents) throws PermissionDeniedException, InvalidDataException, BaseException Create a newBioAssay
with links to raw bioassays. This type of bioassay can only be created if the transformation that created it is a root transformation. New bioassays can only be created if the bioassayset hasn't been committed to the database.The raw bioassay collection should contain only those raw bioassays whose spots have been used to calculate the intensities stored in this bioassay.
- Parameters:
rawParents
- A collection containing the raw bioassays that are the parents of this bioassay- Returns:
- The new
BioAssay
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission for the experiment of if the bioassayset has been committed to the databaseInvalidDataException
- If this bioassayset is not a product of a root transformation or if any of the raw bioassay parents isn't a member of the transformationBaseException
- If something else goes wrong.- See Also:
-
newBioAssay
Create a newBioAssay
in this bioassayset using a single parent. The data cube column coordinate of the new bioassay is set to the same as that of the parent. The bioassayset of the parent bioassay must match the bioassayset set of the source of the transformation and this bioassayset must use the same data cube as the source bioassayset. The new bioassay is automatically linked to the same raw bioassays as the parent bioassay.New bioassays can only be created if the bioassayset hasn't been committed to the database.
- Parameters:
parent
- The parent bioassay- Returns:
- The new bioassay
- Throws:
InvalidDataException
- If the parent is null or it's bioassayset is not the same as the source bioassayset of the transformation or if the data cube of the source is not the same as the data cube for this bioassaysetPermissionDeniedException
- If the bioassayset has already been committed to the database- See Also:
-
newBioAssay
Create a newBioAssay
with links to multiple parent bioassays. This type of bioassay can only be created if the transformation that created it isn't a root transformation, since a root transformation can't have a parent bioassayset. This type of bioassay must be created if this bioassayset uses a different data cube than the bioassayset that is the source of the transformation. The new bioassay is automatically linked to the same raw bioassays as the parent bioassay.New bioassays can only be created if the bioassayset hasn't been committed to the database.
- Parameters:
parents
- A collection containing the bioassays that are the parents of this bioassay- Returns:
- The new
BioAssay
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission for the experiment of if the bioassayset has been committed to the databaseInvalidDataException
- If this bioassayset is the product of a root transformation or if any of the bioassay parents isn't a member source bioassayset of the transformation- See Also:
-
newBioAssay
Create a new bioassay and link to the parents. Assume that all neccessary checks has been made by calling code. If the collections contains only a single parent, the name will be copied to the child. -
getBioAssays
Get a query returning the bioassays that are part of this bioassayset.- Returns:
- An
ItemQuery
object
-
getExtraValues
Get a query returning the extra values that are part of this bioassayset. To add extra values use one of the methods that returns a batcher.- Returns:
- An
ItemQuery
object - See Also:
-
getExtraValueTypes
Get a query returning all extra values types that are used in this bioassay set.- Returns:
- An
ItemQuery
object - Since:
- 2.15
- See Also:
-
getExtraValue
Get the extra value of the specified type in this bioassayset. To add extra values use one of the methods that returns a batcher.- Parameters:
extraValueType
- For which extra value should be returned.- Returns:
- An
ExtraValue
item, or null if no extra value of the specified type has been created for this bioassayset - Throws:
BaseException
- If something fails when getting the extra value.- See Also:
-
getPositionBatcher
Get a batcher that links position coordinates to reporters for the data cube this bioassayset uses. The links must be created before the data cube is committed to the database. This means that only the first bioassayset in a data cube can create the links to reporters. To insert extra values (which can be done at any time) based on the position use thegetPositionExtraValueBatcher(Class, ExtraValueType, Job)
method to get a batcher for that.- Returns:
- A
PositionBatcher
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission or if the data cube has already been committed to the database- See Also:
-
getMappingBatcher
Get a batcher used to insert mappings to raw data. The links must be created before the data cube is committed to the database. This means that only the first bioassayset in a data cube can create the links to raw data.- Returns:
- A
MappingBatcher
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission or if the data cube has already been committed to the database
-
getSpotBatcher
Get a batcher used to insert spot data for this bioassayset. If this bioassayset uses the same layer as another bioassayset or if this bioassayset has already been committed to the database no more intensities can be inserted. To insert extra values (which can be done at any time) based on the position use thegetSpotExtraValueBatcher(Class, ExtraValueType, Job)
method to get a batcher for that.- Returns:
- A
SpotBatcher
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission or if the data cube layer has already been committed to the database- See Also:
-
getFilterBatcher
Get a batcher used to insert the position/column coordinates that remain after some filter has been applied to the spot data of a bioassayset. Filter information cannot be inserted after the bioassayset has been committed to the database. Calling this method and not inserting any position/column coordinates will result in a bioassayset with no data.- Returns:
- A
FilterBatcher
object - Throws:
PermissionDeniedException
- If the bioassayset has already been committed to the database or if the logged in user doesn't have write permission- See Also:
-
getSpotExtraValueBatcher
public <I> SpotExtraValueBatcher<I> getSpotExtraValueBatcher(Class<I> clazz, ExtraValueType extraValueType, Job job) throws PermissionDeniedException, InvalidDataException Get a batcher that is used to insert extra values per spot of the specified type. A bioassay set can only have one set of extra values for each type. If this method is called more than once in the same transaction with the same extra value type parameter, the same batcher is returned.- Parameters:
clazz
- The class object for the values, ie.Integer.class
,Float.class
orString.class
extraValueType
- The definition of the extra value typejob
- The job that is doing the extra value calculations or null- Returns:
- A
SpotExtraValueBatcher
object - Throws:
PermissionDeniedException
- If the loggged in user doesn't have write permission for the bioassay setInvalidDataException
- If the extra value type is null or has a value type that doesn't match the specified class- See Also:
-
getPositionExtraValueBatcher
public <I> PositionExtraValueBatcher<I> getPositionExtraValueBatcher(Class<I> clazz, ExtraValueType extraValueType, Job job) throws PermissionDeniedException, InvalidDataException Get a batcher that is used to insert extra values per position of the specified type. A bioassay set can only have one set of extra values for each type. If this method is called more than once in the same transaction with the same extra value type parameter, the same batcher is returned.- Parameters:
clazz
- The class object for the values, ie.Integer.class
,Float.class
orString.class
extraValueType
- The definition of the extra value typejob
- The job that is doing the extra value calculations or null- Returns:
- A
PositionExtraValueBatcher
object - Throws:
PermissionDeniedException
- If the loggged in user doesn't have write permission for the bioassay setInvalidDataException
- If the extra value type is null or has a value type that doesn't match the specified class
-
getSpotData
Get a query that returns spot data for this bioassayset. The query will select column, position and spot intensities by default. Ie.// Default query -- filter is only joined if the bioassayset is filtered SELECT spt.column, spt.position, spt.ch1, spt.ch2, ... FROM Dynamic#PerSpot spt [ JOIN Dynamic#Filter flt ON flt.cube = spt.cube AND flt.column = spt.column AND flt.position = spt.position ] WHERE spt.cube = <cube_no> AND spt.layer = <layer_no> [ AND flt.filter = <filter_no> ]
Note! If the bioassay set contains transformed intensities, the default selection will un-transform the values.
- Returns:
- A
DynamicSpotQuery
object
-
getPositionData
Get a query that returns position data for the data cube where this bioassayset is located. The query will only select the position by default. The returned result doesn't depend on what spots are located in this bioassayset. Ie. the query will return the same result for all bioassaysets in the same data cube. If you need position data that depends on the spots in the bioassayset, use thegetSpotData()
method and then join reporters using theDynamicSpotQuery.joinReporters(JoinType)
method.// Default query SELECT pos.position FROM Dynamic#PerPosition AS pos WHERE pos.cube = <cube_no>
- Returns:
- A
DynamicPositionQuery
object
-
countSpotsAndReporters
private void countSpotsAndReporters()Count the number of unique reporters and spots in all bioassays in this bioassayset. This method in called by theonBeforeCommit
method to calculate the numbers (which cannot be changed later) before the bioassayset is committed to the database. -
getSpotCount
int getSpotCount(int column) Get the number of spots in a single bioassay. This method in called by theBioAssay.onBeforeCommit
method to calculate the numbers (which cannot be changed later) before the bioassay is saved to the database. The reason it is located here is that a single query can calculate the spots for all bioassays in a one go. -
countBioAssaySpots
private void countBioAssaySpots()- See Also:
-
checkAndCreateTables
private void checkAndCreateTables() -
deleteAnalysedData
Called when a bioassayset is about to be deleted. Finds which data cubes, layers, filters and extra values that are exclusively used by this bioassayset or one of the child bioassaysets (which are deleted by Hibernate cascade). Then, it deletes all those items. A bug in this method may cause stale data to be left in the database (bad) or data used by other bioassaysets to be deleted (even worse). For each type of item it is a three-step process:- Find the items used by at least one of the bioassaysets that are going to be deleted
- Among the items found, find out if any of them are also used by other bioassaysets that are not going to be deleted
- Delete only those items that are left
- Throws:
BaseException
-
addChildBioAssaySets
Find all bioassaysets that are children to the specified parent (ie. the product of a transformation using the parent as a source) and add those theall
set. The method is then called recursively to add the grandchildren and so on.
-