Class SingleCellDimension

java.lang.Object
ubic.gemma.model.common.AbstractIdentifiable
ubic.gemma.model.expression.bioAssayData.SingleCellDimension
All Implemented Interfaces:
Identifiable

public class SingleCellDimension extends AbstractIdentifiable implements Identifiable
Represents a single-cell dimension, holding shared information for a set of SingleCellExpressionDataVector.
Author:
poirigui
See Also:
  • Constructor Details

    • SingleCellDimension

      public SingleCellDimension()
  • Method Details

    • getBioAssay

      public BioAssay getBioAssay(int cellIndex) throws IndexOutOfBoundsException
      Obtain the BioAssay for a given cell position.
      Parameters:
      cellIndex - the cell position in cellIds
      Throws:
      IllegalArgumentException - if the sparse range array is invalid as per SparseListUtils.getSparseRangeArrayElement(List, int[], int, int)
      IndexOutOfBoundsException - if the index is out of bounds
    • getCellIdsBySample

      public List<String> getCellIdsBySample(int sampleIndex)
      Obtain a list of cell IDs for the given sample.
      Parameters:
      sampleIndex - the sample position in bioAssays
    • getNumberOfCellIdsBySample

      public int getNumberOfCellIdsBySample(int sampleIndex)
      Obtain the number for cells for the given sample.

      This is more efficient than looking up the size of getCellIdsBySample(int).

      Parameters:
      sampleIndex - the sample position in bioAssays
    • hashCode

      public int hashCode()
      Description copied from class: AbstractIdentifiable
      Important note: Never use the ID in the hashCode() implementation since it can be assigned when the object is persisted.
      Specified by:
      hashCode in class AbstractIdentifiable
    • equals

      public boolean equals(Object obj)
      Description copied from class: AbstractIdentifiable
      Important note: Two objects with the same class and non-null ID must be considered equal. If one or both IDs are nulls, the rest of the state can be used to determine equality.
      Specified by:
      equals in class AbstractIdentifiable
    • toString

      public String toString()
      Overrides:
      toString in class AbstractIdentifiable
    • getId

      public Long getId()
      Specified by:
      getId in interface Identifiable
      Overrides:
      getId in class AbstractIdentifiable
    • getCellIds

      public List<String> getCellIds()
      Cell identifiers.

      Those are user-supplied cell identifiers. Each cell from a given BioAssay must be assigned a unique id.

      This is stored as a compressed, gzipped blob in the database. See CompressedStringListType for more details.

    • getNumberOfCellIds

      public int getNumberOfCellIds()
      Number of cell IDs.

      This is *not* the number of cells

      This must always be equal to the size of cellIds.

    • getBioAssays

      public List<BioAssay> getBioAssays()
      List of BioAssays applicable to the cells.

      The BioAssay in bioAssays[sampleIndex] applies to all the cells in the interval [bioAssaysOffset[sampleIndex], bioAssaysOffset[sampleIndex+1][ except for the last sample which owns the remaining cells.

      To find the BioAssay of a given cell, use getBioAssay(int).

    • getBioAssaysOffset

      public int[] getBioAssaysOffset()
      Offsets of the BioAssay in cellIds.

      This must always contain bioAssays.size() elements.

      This is stored in the database using ByteArrayType.

      This may be set to null to keep the model lightweight.

    • getCellTypeAssignments

      public Set<CellTypeAssignment> getCellTypeAssignments()
      Set of cell types assignment to individual cells.

      This is empty if no cell types have been assigned and should always contain a preferred assignment as per CellTypeAssignment.isPreferred() if non-empty.

    • getCellLevelCharacteristics

      public Set<CellLevelCharacteristics> getCellLevelCharacteristics()
      Set of cell-level characteristics.

      Cell types have a special treatment and should be added to cellTypeAssignments.

    • setId

      public void setId(Long id)
      Overrides:
      setId in class AbstractIdentifiable
    • setCellIds

      public void setCellIds(List<String> cellIds)
      Cell identifiers.

      Those are user-supplied cell identifiers. Each cell from a given BioAssay must be assigned a unique id.

      This is stored as a compressed, gzipped blob in the database. See CompressedStringListType for more details.

    • setNumberOfCellIds

      public void setNumberOfCellIds(int numberOfCellIds)
      Number of cell IDs.

      This is *not* the number of cells

      This must always be equal to the size of cellIds.

    • setBioAssays

      public void setBioAssays(List<BioAssay> bioAssays)
      List of BioAssays applicable to the cells.

      The BioAssay in bioAssays[sampleIndex] applies to all the cells in the interval [bioAssaysOffset[sampleIndex], bioAssaysOffset[sampleIndex+1][ except for the last sample which owns the remaining cells.

      To find the BioAssay of a given cell, use getBioAssay(int).

    • setBioAssaysOffset

      public void setBioAssaysOffset(int[] bioAssaysOffset)
      Offsets of the BioAssay in cellIds.

      This must always contain bioAssays.size() elements.

      This is stored in the database using ByteArrayType.

      This may be set to null to keep the model lightweight.

    • setCellTypeAssignments

      public void setCellTypeAssignments(Set<CellTypeAssignment> cellTypeAssignments)
      Set of cell types assignment to individual cells.

      This is empty if no cell types have been assigned and should always contain a preferred assignment as per CellTypeAssignment.isPreferred() if non-empty.

    • setCellLevelCharacteristics

      public void setCellLevelCharacteristics(Set<CellLevelCharacteristics> cellLevelCharacteristics)
      Set of cell-level characteristics.

      Cell types have a special treatment and should be added to cellTypeAssignments.