Class DataCube

All Implemented Interfaces:
AccessControlled, Identifiable

public class DataCube extends ChildItem
A data cube is the main unit for an experiment to store analysed data. A location in the cube can be described by three coordinates: 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. Datacube

Version:
2.0
Author:
Nicklas
See Also:
Last modified
$Date: 2017-05-22 14:35:27 +0200 (må, 22 maj 2017) $
  • Field Details

  • Constructor Details

    • DataCube

      DataCube(DataCubeData data)
      Creates a new data cube item from the given data.
      Parameters:
      data - the data
  • Method Details

    • getNew

      static DataCube getNew(DbControl dc, VirtualDb virtualDb) throws BaseException
      Create a new DataCube item.
      Parameters:
      dc - The DbControl 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 a VirtualDb item when you know the id.
      Parameters:
      dc - The DbControl 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 found
      PermissionDeniedException - If the logged in user doesn't have Permission.READ permission to the item
      BaseException - If there is another error
    • getData

      DataCubeData getData()
      Description copied from class: BasicItem
      Get the BasicData object that holds all data for this item.
      Specified by:
      getData in class BasicItem
    • getType

      public 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 the Item enumeration.
      Returns:
      A value indicating the type of item
    • onBeforeCommit

      void onBeforeCommit(Transactional.Action action) throws BaseException
      Delete data and update disk usage information on the experiment if action == Action.DELETE
      Overrides:
      onBeforeCommit in class BasicItem
      Throws:
      BaseException - If there is an error
      See Also:
    • getSharedParent

      SharedData getSharedParent()
      Get the experiment.
      Specified by:
      getSharedParent in class ChildItem
      Returns:
      The parent item
    • getPermissionForWriteDeleteAndCreate

      Permission getPermissionForWriteDeleteAndCreate()
      USE permission is enough to be able to manage data cubes.
      Overrides:
      getPermissionForWriteDeleteAndCreate in class ChildItem
    • getRawDataType

      public RawDataType getRawDataType()
      Get the raw data type this experiment uses for the raw data.
      Returns:
      A RawDataType object
    • getExperiment

      public Experiment getExperiment() throws PermissionDeniedException, BaseException
      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 experiment
      BaseException - 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 item
      BaseException - 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.
      Throws:
      PermissionDeniedException
      InvalidDataException
    • 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

      short getNextFilterNo() throws BaseException
      Generate the next available filter number. This method will open a second transaction and update the DataCubeData.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

      short getNextExtraValueNo() throws BaseException
      Generate the next available extra value number. This method will open a second transaction and update the DataCubeData.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

      short getNextLayerNo() throws BaseException
      Generate the next available layer number. This method will open a second transaction and update the DataCubeData.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

      short getNextColumnNo() throws BaseException
      Generate the next available column number. This method will open a second transaction and update the DataCubeData.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 the AbstractBatcher.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

      DataCubeExtraValue newExtraValue(Type valueType, ExtraValue.CoordinateType coordinateType)
      Create a new extra vlaue in this data cube.
    • getPositionBatcher

      PositionBatcher getPositionBatcher() throws BaseException
      Throws:
      BaseException
    • getMappingBatcher

      MappingBatcher getMappingBatcher() throws BaseException
      Throws:
      BaseException
    • countSpotMappings

      int countSpotMappings()
      Count the number of raw data mappings for the spot with the most mappings.
      Since:
      2.2