Package net.sf.basedb.core
Class ExtraValue
java.lang.Object
net.sf.basedb.core.BasicItem
net.sf.basedb.core.ChildItem
net.sf.basedb.core.ExtraValue
- All Implemented Interfaces:
AccessControlled
,FileStoreEnabled
,Identifiable
Represents extra values attached to a
BioAssaySet
.
The type of extra values are defined by the ExtraValueType
.
The insertion of extra values is done using batchers, created by calling either BioAssaySet.getSpotExtraValueBatcher(Class, ExtraValueType, Job)
or BioAssaySet.getPositionExtraValueBatcher(Class, ExtraValueType, Job)
.
Only one set of extra values of the same ExtraValueType
are
allowed in a bioassayset.- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2015-04-21 09:59:42 +0200 (ti, 21 apr 2015) $
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
Defines which coordinates in the data cube the extra values are attached to. -
Field Summary
-
Constructor Summary
ConstructorDescriptionExtraValue
(ExtraValueData data) Creates a new extra value item from the given data. -
Method Summary
Modifier and TypeMethodDescriptionGet the bioassayset this extra value belongs to.static ExtraValue
Get anExtraValue
item when you know the id.Get information about which coordinates in the data cube the extra values are attached to.(package private) ExtraValueData
getData()
Get theBasicData
object that holds all data for this item.(package private) DataCube
(package private) DataCubeExtraValue
short
Get the number of the data cube the extra values are stored in.Get the experiment this extra value belongs to.short
Get the number in the data cube of the extra values.Get the type of the extra values.Get the file set that collects all files that holds data for this item.getJob()
Get the job that created the extra values.(package private) String
The alias used when joining this extra value into a query.(package private) static ExtraValue
getNew
(DbControl dc, BioAssaySet bioAssaySet, ExtraValueType extraValueType, DataCubeExtraValue dcev, Job job) Create a newExtraValue
item.int
Get the number of values that are stored in files.int
Get the number of extra values inserted.Get the file set from the parent bioassay set if it exists.(package private) Permission
USE permission is enough to be able to manage extra values.Get the platform the item is related to.static ItemQuery<ExtraValue>
getQuery
(BioAssaySet bioAssaySet) Get a query configured to retrieve extra values in a given bioassayset.Get the raw data type the experiment uses for the raw data.(package private) SharedData
Get the experiment.getType()
Get the type of item represented by the object.Get a query returning the extra values.Get the type of values.Get the platform variant the item is related to.Get the virtual column object that represents the column where the extra values are stored.(package private) VirtualDb
(package private) VirtualTable
boolean
Check if this item has a file set.private void
setBioAssaySet
(BioAssaySet bioAssaySet) Set the bioassayset.private void
private void
setExtraValueType
(ExtraValueType extraValueType) Set the extra value type.private void
Set the job that created the extra values.void
setNumFileValues
(int numValues) Set the number of extra values that are stored in files.(package private) void
setNumValues
(int numValues) Called from batcher when it is closed.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, onBeforeCommit, 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:
-
-
Constructor Details
-
ExtraValue
ExtraValue(ExtraValueData data) Creates a new extra value item from the given data.- Parameters:
data
- the data
-
-
Method Details
-
getNew
static ExtraValue getNew(DbControl dc, BioAssaySet bioAssaySet, ExtraValueType extraValueType, DataCubeExtraValue dcev, Job job) throws PermissionDeniedException, InvalidDataException, BaseException Create a newExtraValue
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.bioAssaySet
- The bioassayset the extra value belongs toextraValueType
- The type of the extra valuedcev
- The data cube extra value used to store the extra valuesjob
- The job that calculated the extra values or null- Returns:
- The new
ExtraValue
item - Throws:
PermissionDeniedException
- If the logged in user doesn't have write permission for the experimentInvalidDataException
- If the bioassayset or extra value type is nullBaseException
- If there is an error
-
getById
public static ExtraValue getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get anExtraValue
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
ExtraValue
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 extra values in a given bioassayset.- Parameters:
bioAssaySet
- The bioassayset to retreive bioassays for, null is not allowed- Returns:
- An
ItemQuery
object - Throws:
InvalidDataException
- If the argument is null.- See Also:
-
getData
ExtraValueData 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
-
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
-
getPermissionForWriteDeleteAndCreate
Permission getPermissionForWriteDeleteAndCreate()USE permission is enough to be able to manage extra values.- Overrides:
getPermissionForWriteDeleteAndCreate
in classChildItem
-
getExperiment
Get the experiment this extra value 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 extra value 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, InvalidDataException Set the bioassayset. This cannot be changed after the extra value has been created. -
getExtraValueType
Get the type of the extra values.- Returns:
- An
ExtraValueType
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the extra value typeBaseException
- If there is another error
-
setExtraValueType
private void setExtraValueType(ExtraValueType extraValueType) throws PermissionDeniedException, InvalidDataException Set the extra value type. This cannot be changed after the extra value has been created. -
getJob
Get the job that created the extra values.- Returns:
- A
Job
object, ot null if the extra values wasn't created by a job - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the experimentBaseException
- If there is another error
-
setJob
Set the job that created the extra values. Once set it can't be changed. -
getRawDataType
Get the raw data type the experiment uses for the raw data.- Returns:
- A
RawDataType
object
-
getNumValues
public int getNumValues()Get the number of extra values inserted. -
setNumValues
void setNumValues(int numValues) Called from batcher when it is closed. -
getNumFileValues
public int getNumFileValues()Get the number of values that are stored in files.- Since:
- 2.8
-
setNumFileValues
public void setNumFileValues(int numValues) Set the number of extra values that are stored in files.- Parameters:
numValues
- The number of spots- Since:
- 2.8
-
getDataCubeNo
public short getDataCubeNo()Get the number of the data cube the extra values are stored in. -
getExtraNo
public short getExtraNo()Get the number in the data cube of the extra values. -
getCoordinateType
Get information about which coordinates in the data cube the extra values are attached to.- Returns:
- A
CoordinateType
object - See Also:
-
getValueType
Get the type of values. Shortcut forgetExtraValueType().getValueType()
.- Returns:
- A
Type
object
-
getValues
Get a query returning the extra values. The query will select column, position and the extra value by default, if the extra values attached to both column and position. Otherwise only the coordinate the extra values are attached to are selected.// Example of default query for extra integer values attached to spots SELECT ex.column, ex.position, ex.value FROM Dynamic#SpotExtraInt AS ex WHERE ex.cube = <cube_no> AND ex.extra = <extra_no>
- Returns:
- A
DynamicExtraValueQuery
object
-
getDataCubeExtraValue
-
setDataCubeExtraValue
-
getVirtualDb
VirtualDb getVirtualDb() -
getDataCube
DataCube getDataCube() -
getVirtualTable
VirtualTable getVirtualTable() -
getVirtualColumn
Get the virtual column object that represents the column where the extra values are stored. The column depends on the value type of the extra value.- Returns:
- A
VirtualColumn
object - See Also:
-
getJoinAlias
String getJoinAlias()The alias used when joining this extra value into a query. We can't use theVirtualTable.getAlias()
value, which we normally do, since the alias must be unique if we join several extra values. We simply return a value based on the id of this item. TheExtraValueJoin
andExtraValueExpression
both uses this method to create their SQL.- Returns:
- The alias to use in joins
- See Also:
-