Class DataCube
- All Implemented Interfaces:
AccessControlled
,Identifiable
position
, column
and layer
.
The position coordinate
The position is similar to the position of raw data in a raw bioassay.
The position coordinate can be linked to a single reporter.
This means that all analysed data with
that position coordinate is related to the specified reporter. Normally,
this means that all raw data spots should have the same reporter, but this
is not checked by the data cube. There may be exceptions, since a merge
operation may merge raw data spots which have different, but still related,
reporters (for example different reporters for the same gene). The position
coordinate can then be linked to a a generic reporter for that gene.
The column coordinate The column corresponds to a single bioassay which can have links to any number of raw bioassays. The combination of position and column coordinate may be linked to any number of raw data spots. This means that all analysed data with that column/position coordinate has been calculated from the specified raw data spots. It is not checked that the specified raw data spots actually are members of the raw bioassays that the bioassay is linked to.
The layer coordinate The layer corresponds more or less to a bioassayset. All analysed data with a given layer is part of the same bioassayset. However, it is possible that more than one bioassayset use the same layer. For example, a filtering bioassayset that doesn't change the data uses the same layer as it's parent bioassayset.
- Version:
- 2.0
- Author:
- Nicklas
- See Also:
- Last modified
- $Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
-
Nested Class Summary
Modifier and TypeClassDescriptionprivate static final class
Select data from Dynamic#RawParents table. -
Field Summary
Modifier and TypeFieldDescriptionprivate long
private MappingBatcher
private PositionBatcher
static final Item
The type of item represented by this class. -
Constructor Summary
ConstructorDescriptionDataCube
(DataCubeData data) Creates a new data cube item from the given data. -
Method Summary
Modifier and TypeMethodDescription(package private) void
addBytes
(long bytes) (package private) int
Count the number of raw data mappings for the spot with the most mappings.static DataCube
Get aVirtualDb
item when you know the id.long
getBytes()
Gets the number of bytes the analysed data in this cube occupies on disk.short
Get the number of this data cube.(package private) DataCubeData
getData()
Get theBasicData
object that holds all data for this item.Get the experiment this data cube belongs to.(package private) MappingBatcher
int
Get the number of mappings to raw data spots for the spot with the most number of mappings.(package private) static DataCube
Create a newDataCube
item.(package private) short
Generate the next available column number.(package private) short
Generate the next available extra value number.(package private) short
Generate the next available filter number.(package private) short
Generate the next available layer number.short
Get the number of columns created in this data cube.short
Get the number of extra values created for this data cube.short
Get the number of filters created for this data cube.short
Get the number of layers created in this data cube.int
Get the number of positions created in this data cube.(package private) Permission
USE permission is enough to be able to manage data cubes.(package private) PositionBatcher
Get the raw data type this experiment uses for the raw data.(package private) SharedData
Get the experiment.getType()
Get the type of item represented by the object.(package private) VirtualDb
Get the virtual database this cube is a part of.(package private) DataCubeColumn
Create a new column in this database.(package private) DataCubeExtraValue
newExtraValue
(Type valueType, ExtraValue.CoordinateType coordinateType) Create a new extra vlaue in this data cube.(package private) DataCubeFilter
Create a new filter in this datacube.(package private) DataCubeLayer
newLayer()
Create a new layer in this datacube.(package private) void
onBeforeCommit
(Transactional.Action action) Delete data and update disk usage information on the experiment if action == Action.DELETEprivate void
setCubeNo
(short cubeNo) (package private) void
setNumPositions
(int positions) Set by theAbstractBatcher.close()
method.private void
setVirtualDb
(VirtualDb virtualDb) Set the experiment.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
-
Field Details
-
TYPE
The type of item represented by this class.- See Also:
-
addedBytes
private long addedBytes -
positionBatcher
-
mappingBatcher
-
-
Constructor Details
-
DataCube
DataCube(DataCubeData data) Creates a new data cube item from the given data.- Parameters:
data
- the data
-
-
Method Details
-
getNew
Create a newDataCube
item.- Parameters:
dc
- TheDbControl
which will be used for permission checking and database access.virtualDb
- The virtual database the cube is located in- Returns:
- The new
DataCube
item - Throws:
BaseException
- If there is an error
-
getById
public static DataCube getById(DbControl dc, int id) throws ItemNotFoundException, PermissionDeniedException, BaseException Get aVirtualDb
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
VirtualDb
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
-
getData
DataCubeData 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.- Returns:
- A value indicating the type of item
-
onBeforeCommit
Delete data and update disk usage information on the experiment if action == Action.DELETE- 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 data cubes.- Overrides:
getPermissionForWriteDeleteAndCreate
in classChildItem
-
getRawDataType
Get the raw data type this experiment uses for the raw data.- Returns:
- A
RawDataType
object
-
getExperiment
Get the experiment this data cube 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
-
getVirtualDb
Get the virtual database this cube is a part of.- Returns:
- A
VirtualDb
object - Throws:
PermissionDeniedException
- If the logged in user doesn't have read permission to the itemBaseException
- If there is another error
-
setVirtualDb
private void setVirtualDb(VirtualDb virtualDb) throws PermissionDeniedException, InvalidDataException Set the experiment. This cannot be changed after the dynamic tables has been created. -
getCubeNo
public short getCubeNo()Get the number of this data cube. -
setCubeNo
private void setCubeNo(short cubeNo) -
getNumFilters
public short getNumFilters()Get the number of filters created for this data cube. -
getNextFilterNo
Generate the next available filter number. This method will open a second transaction and update theDataCubeData.getNumFilters()
property by one, unless this item hasn't been saved to the database yet.- Returns:
- The next filter number
- Throws:
BaseException
-
getNumExtraValues
public short getNumExtraValues()Get the number of extra values created for this data cube. -
getNextExtraValueNo
Generate the next available extra value number. This method will open a second transaction and update theDataCubeData.getNumExtraValues()
property by one, unless this item hasn't been saved to the database yet.- Returns:
- The next extra value number
- Throws:
BaseException
-
getNumLayers
public short getNumLayers()Get the number of layers created in this data cube. -
getNextLayerNo
Generate the next available layer number. This method will open a second transaction and update theDataCubeData.getNumLayers()
property by one, unless this item hasn't been saved to the database yet.- Returns:
- The next layer number
- Throws:
BaseException
-
getNumColumns
public short getNumColumns()Get the number of columns created in this data cube. -
getNextColumnNo
Generate the next available column number. This method will open a second transaction and update theDataCubeData.getNumColumns()
property by one, unless this item hasn't been saved to the database yet.- Returns:
- The next column number
- Throws:
BaseException
-
getNumPositions
public int getNumPositions()Get the number of positions created in this data cube. -
setNumPositions
void setNumPositions(int positions) Set by theAbstractBatcher.close()
method. Cannot be updated after that. -
getMaxRawMappingsForSpot
public int getMaxRawMappingsForSpot()Get the number of mappings to raw data spots for the spot with the most number of mappings. For most data cubes 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
-
getBytes
public long getBytes()Gets the number of bytes the analysed data in this cube occupies on disk. -
addBytes
void addBytes(long bytes) -
newLayer
DataCubeLayer newLayer()Create a new layer in this datacube. -
newColumn
DataCubeColumn newColumn()Create a new column in this database. -
newFilter
DataCubeFilter newFilter()Create a new filter in this datacube. -
newExtraValue
Create a new extra vlaue in this data cube. -
getPositionBatcher
- Throws:
BaseException
-
getMappingBatcher
- Throws:
BaseException
-
countSpotMappings
int countSpotMappings()Count the number of raw data mappings for the spot with the most mappings.- Since:
- 2.2
-