public class BioAssay extends ChildItem implements Nameable, Annotatable
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.
Modifier and Type | Field and Description |
---|---|
static Item |
TYPE
The type of item represented by this class.
|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
Constructor and Description |
---|
BioAssay(BioAssayData data)
Creates a new bioassay item from the given data.
|
Modifier and Type | Method and 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 a
BioAssay item when you know the id. |
(package private) BioAssayData |
getData()
Get the
BasicData object that holds all data for this item. |
(package private) DataCubeColumn |
getDataCubeColumn()
Get the
DataCubeColumn 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 new
BioAssay 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 each
Transactional item and on
all items if the action is Transactional.Action.CREATE
or Transactional.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.
|
getPermissionForUse, getPluginPermissions
addAnnotatableParents, addUsingItems, addUsingItems, checkPermission, equals, getBasicData, getDbControl, getId, getPermissions, getSessionControl, getUsingItems, getVersion, hashCode, hasPermission, isDetached, isInDatabase, isUsed, onAfterCommit, onAfterInsert, onRollback, setDbControl, setProjectDefaults, toString, validate
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getId, getVersion
checkPermission, getPermissions, hasPermission
public static final Item TYPE
Item.BIOASSAY
,
getType()
BioAssay(BioAssayData data)
data
- the datastatic BioAssay getNew(DbControl dc, BioAssaySet bioAssaySet, DataCubeColumn column) throws PermissionDeniedException, InvalidDataException, BaseException
BioAssay
item.dc
- The DbControl
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 bioassaysetBioAssay
itemPermissionDeniedException
- If the logged in user
doesn't have write permission for the experimentInvalidDataException
- If the bioassayset is nullBaseException
- If there is an errorpublic static BioAssay getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException
BioAssay
item when you know the id.dc
- The DbControl
which will be used for
permission checking and database access.id
- The id of the item to loadBioAssay
itemItemNotFoundException
- If an item with the specified id
is not foundPermissionDeniedException
- If the logged in user doesn't have
Permission.READ
permission to the itemBaseException
- If there is another errorpublic static ItemQuery<BioAssay> getQuery(BioAssaySet bioAssaySet) throws InvalidDataException
bioAssaySet
- The bioassayset to retreive bioassays for, null
is not allowedItemQuery
objectInvalidDataException
- If the parameter is null.BioAssayData getData()
BasicItem
BasicData
object that holds all data for this item.public Item getType()
Identifiable
Item
enumeration.getType
in interface Identifiable
public String getName()
Nameable
public void setName(String name) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_NAME_LENGTH
constant.setName
in interface Nameable
name
- The new name for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH
constantpublic String getDescription()
Nameable
getDescription
in interface Nameable
String
with a description of the itempublic void setDescription(String description) throws PermissionDeniedException, InvalidDataException
Nameable
Nameable.MAX_DESCRIPTION_LENGTH
constant.setDescription
in interface Nameable
description
- The new description for the itemPermissionDeniedException
- If the logged in user doesn't
have write permissionInvalidDataException
- If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH
constantpublic AnnotationSet getAnnotationSet() throws PermissionDeniedException, BaseException
Annotatable
DbControl.commit()
is
called. To check if an item has annotations without creating a new
annotation set use the Annotatable.isAnnotated()
method.getAnnotationSet
in interface Annotatable
AnnotationSet
PermissionDeniedException
- If the logged in user doesn't have
enough permissionsBaseException
- If there is another errorpublic boolean isAnnotated()
Annotatable
isAnnotated
in interface Annotatable
public void removeAnnotations() throws PermissionDeniedException, BaseException
Annotatable
removeAnnotations
in interface Annotatable
PermissionDeniedException
- If the logged in user doesn't have
write permissionBaseException
- If there is another errorpublic Protocol getProtocol()
getProtocol
in interface Annotatable
public Set<Annotatable> getAnnotatableParents() throws BaseException
getAnnotatableParents
in interface Annotatable
BaseException
- If there is an errorvoid onBeforeCommit(Transactional.Action action) throws BaseException
BasicItem
Transactional
item and on
all items if the action is Transactional.Action.CREATE
or Transactional.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)
.onBeforeCommit
in class BasicItem
BaseException
- If there is an errorTransactional
,
Developer documentation: Transactions,
Developer documentation: Coding rules and guidelines for item classesvoid initPermissions(int granted, int denied) throws BaseException
initPermissions
in class ChildItem
granted
- Permissions that have been granted by the subclassdenied
- Permissions that have been denied by the subclassBaseException
- If the permissions couldn't be initialisedSharedData getSharedParent()
getSharedParent
in class ChildItem
Permission getPermissionForWriteDeleteAndCreate()
getPermissionForWriteDeleteAndCreate
in class ChildItem
public Experiment getExperiment() throws PermissionDeniedException, BaseException
Experiment
objectPermissionDeniedException
- If the logged in user doesn't have
read permission to the experimentBaseException
- If there is another errorpublic BioAssaySet getBioAssaySet() throws PermissionDeniedException, BaseException
BioAssaySet
objectPermissionDeniedException
- If the logged in user doesn't have
read permission to the bioassaysetBaseException
- If there is another errorprivate void setBioAssaySet(BioAssaySet bioAssaySet) throws PermissionDeniedException, InvalidDataException
public RawDataType getRawDataType()
RawDataType
objectpublic int getNumSpots()
public int getNumFileSpots()
public void setNumFileSpots(int numSpots)
numSpots
- The number of spotspublic short getDataCubeNo()
getDataCubeLayerNo()
,
getDataCubeColumnNo()
public short getDataCubeLayerNo()
getDataCubeNo()
,
getDataCubeColumnNo()
public short getDataCubeColumnNo()
getDataCubeNo()
,
getDataCubeLayerNo()
DataCubeColumn getDataCubeColumn() throws PermissionDeniedException, BaseException
DataCubeColumn
object where this bioassay
store it's data.private void setDataCubeColumn(DataCubeColumn column)
public DynamicSpotQuery getSpotData()
BioAssaySet.getSpotData()
method and adds a restriction
to the returned query.DynamicSpotQuery
objectBioAssaySet.getSpotData()
public ItemQuery<BioAssay> getParents()
public ItemQuery<RawBioAssay> getRawBioAssays()
public ItemQuery<RootRawBioAssay> getRootRawBioAssays()