Package net.sf.basedb.core
Class BioAssay
java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.ChildItem
net.sf.basedb.core.BioAssay
- All Implemented Interfaces:
AccessControlled
,Annotatable
,Identifiable
,Nameable
public class BioAssay extends ChildItem implements Nameable, Annotatable
Represents the current intensities of raw data after some transformation
has been applied to it. Usually a single bioassay represents the data
from a single
RawBioAssay
but it is also possible that
a transformation has merged several bioassays into a single one.
Bioassays are created by one of the BioAssaySet.newRootBioAssay(Collection)
,
BioAssaySet.newBioAssay(BioAssay)
or
BioAssaySet.newBioAssay(Collection)
. Which one to use depends on the
relationship to it's parents. Bioassays can only be created if the bioassayset
hasn't been committed to the database.
- Version:
- 2.0
- Author:
- Nicklas
- Last modified
- $Date: 2005-10-19 15:57:12 +0200 (on, 19 okt 2005) $
-
Field Summary
Fields Modifier and Type Field Description static Item
TYPE
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
Constructors Constructor Description BioAssay(BioAssayData data)
Creates a new bioassay item from the given data. -
Method Summary
Modifier and Type Method Description Set<Annotatable>
getAnnotatableParents()
Get the parent bioassay set, all parent bioassays and all parent root raw bioassays.AnnotationSet
getAnnotationSet()
Get the annotation set containing the annotations for this item.BioAssaySet
getBioAssaySet()
Get the bioassayset this bioassay belongs to.static BioAssay
getById(DbControl dc, int id)
Get aBioAssay
item when you know the id.(package private) BioAssayData
getData()
Get theBasicData
object that holds all data for this item.(package private) DataCubeColumn
getDataCubeColumn()
Get theDataCubeColumn
object where this bioassay store it's data.short
getDataCubeColumnNo()
Get the column coordinate in the data cube that this bioassay stores it's data in.short
getDataCubeLayerNo()
Get the layer coordinate in the data cube that this bioassay stores it's data in.short
getDataCubeNo()
Get the number of the data cube this bioassay stores it's data in.String
getDescription()
Get the description for the item.Experiment
getExperiment()
Get the experiment this bioassay belongs to.String
getName()
Get the name of the item.(package private) static BioAssay
getNew(DbControl dc, BioAssaySet bioAssaySet, DataCubeColumn column)
Create a newBioAssay
item.int
getNumFileSpots()
Get the number of spots that are stored in files.int
getNumSpots()
Get the number of spots in this bioassay.ItemQuery<BioAssay>
getParents()
Get a query for loading the parents bioassays to this bioassay.(package private) Permission
getPermissionForWriteDeleteAndCreate()
USE permission is enough to be able to manage bioassays.Protocol
getProtocol()
Default implementation returns null.static ItemQuery<BioAssay>
getQuery(BioAssaySet bioAssaySet)
Get a query configured to retrieve bioassays in a given bioassayset.ItemQuery<RawBioAssay>
getRawBioAssays()
RawDataType
getRawDataType()
Get the raw data type the experiment uses for the raw data.ItemQuery<RootRawBioAssay>
getRootRawBioAssays()
(package private) SharedData
getSharedParent()
Get the experiment.DynamicSpotQuery
getSpotData()
Get a query that returns spot data for this bioassay.Item
getType()
Get the type of item represented by the object.(package private) void
initPermissions(int granted, int denied)
Deny DELETE permission.boolean
isAnnotated()
Check if this item has an annotation set.(package private) void
onBeforeCommit(Transactional.Action action)
This method is called on eachTransactional
item and on all items if the action isTransactional.Action.CREATE
orTransactional.Action.DELETE
before a commit is issued to the database.void
removeAnnotations()
Remove all annotations from this item, by deleting the annotation set.private void
setBioAssaySet(BioAssaySet bioAssaySet)
Set the experiment.private void
setDataCubeColumn(DataCubeColumn column)
void
setDescription(String description)
Set the description for the item.void
setName(String name)
Set the name of the item.void
setNumFileSpots(int numSpots)
Set the number of spots that are stored in files.Methods inherited from class net.sf.basedb.core.ChildItem
getPermissionForUse, getPluginPermissions
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:
Item.BIOASSAY
,getType()
-
-
Constructor Details
-
BioAssay
BioAssay(BioAssayData data)Creates a new bioassay item from the given data.- Parameters:
data
- the data
-
-
Method Details
-
getNew
static BioAssay getNew(DbControl dc, BioAssaySet bioAssaySet, DataCubeColumn column) throws PermissionDeniedException, InvalidDataException, BaseExceptionCreate a newBioAssay
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.bioAssaySet
- The bioassayset the bioassay belongs tocolumn
- The data cube column where the bioassay should store it's data; must be unique among bioassays in a bioassayset- Returns:
- The new
BioAssay
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission for the experimentInvalidDataException
- If the bioassayset is nullBaseException
- If there is an error
-
getById
public static BioAssay getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseExceptionGet aBioAssay
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
BioAssay
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 bioassays in a given bioassayset.- Parameters:
bioAssaySet
- The bioassayset to retreive bioassays for, null is not allowed- Returns:
- An
ItemQuery
object - Throws:
InvalidDataException
- If the parameter is null.
-
getData
BioAssayData 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, InvalidDataExceptionDescription 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
-
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, all parent bioassays and all parent root raw bioassays.- Specified by:
getAnnotatableParents
in interfaceAnnotatable
- Returns:
- A set containing annotatable items, or null
- Throws:
BaseException
- If there is an error- Since:
- 2.2
-
onBeforeCommit
Description copied from class:BasicItem
This method is called on eachTransactional
item and on all items if the action isTransactional.Action.CREATE
orTransactional.Action.DELETE
before a commit is issued to the database. If the subclass overrides this method it must also propagate the call to the superclass, ie.super.onBeforeCommit(action)
.- Overrides:
onBeforeCommit
in classBasicItem
- Throws:
BaseException
- If there is an error- See Also:
Transactional
, Developer documentation: Transactions, Developer documentation: Coding rules and guidelines for item classes
-
initPermissions
Deny DELETE permission. BioAssays are automatically deleted when it's parent bioassayset is deleted.- Overrides:
initPermissions
in classChildItem
- Parameters:
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclass- Throws:
BaseException
- If the permissions couldn't be initialised
-
getPermissionForWriteDeleteAndCreate
Permission getPermissionForWriteDeleteAndCreate()USE permission is enough to be able to manage bioassays.- Overrides:
getPermissionForWriteDeleteAndCreate
in classChildItem
-
getExperiment
Get the experiment this bioassay 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
-
getBioAssaySet
Get the bioassayset this bioassay belongs to.- Returns:
- A
BioAssaySet
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the bioassaysetBaseException
- If there is another error
-
setBioAssaySet
private void setBioAssaySet(BioAssaySet bioAssaySet) throws PermissionDeniedException, InvalidDataExceptionSet the experiment. This cannot be changed after the bioassayset has been created. -
getRawDataType
Get the raw data type the experiment uses for the raw data.- Returns:
- A
RawDataType
object
-
getNumSpots
public int getNumSpots()Get the number of spots in this bioassay. -
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
-
getDataCubeNo
public short getDataCubeNo()Get the number of the data cube this bioassay stores it's data in.- See Also:
getDataCubeLayerNo()
,getDataCubeColumnNo()
-
getDataCubeLayerNo
public short getDataCubeLayerNo()Get the layer coordinate in the data cube that this bioassay stores it's data in.- See Also:
getDataCubeNo()
,getDataCubeColumnNo()
-
getDataCubeColumnNo
public short getDataCubeColumnNo()Get the column coordinate in the data cube that this bioassay stores it's data in.- See Also:
getDataCubeNo()
,getDataCubeLayerNo()
-
getDataCubeColumn
Get theDataCubeColumn
object where this bioassay store it's data. -
setDataCubeColumn
-
getSpotData
Get a query that returns spot data for this bioassay. The query will select column, position and spot intensities by default. This method uses theBioAssaySet.getSpotData()
method and adds a restriction to the returned query.- Returns:
- A
DynamicSpotQuery
object - See Also:
BioAssaySet.getSpotData()
-
getParents
Get a query for loading the parents bioassays to this bioassay. If this bioassay belong to a root bioassayset, null is returned.- Returns:
- A query returning the parent bioassays of this bioassay, or null
-
getRawBioAssays
- Returns:
- A query returning the raw bioassays this bioassay is created from
-
getRootRawBioAssays
- Returns:
- A query returning the root raw bioassays this bioassay is created from
- Since:
- 3.6
-