SingleCellExperiment

SingleCellExperiment

A SingleCellExperiment is a RangedSummarizedExperiment subclass that contains additional fields for storing reduced dimensions and alternative experiments. It supports the same set of generics as the SummarizedExperiment.

Each reduced dimension instance should have number of rows equal to the number of columns of the SingleCellExperiment. Each instance is expected to provide methods for the following generics:

Each alternative experiment should be a SummarizedExperiment with number of columns equal to that of the SingleCellExperiment.

Constructors of RangedSummarizedExperiment subclasses should be callable with no arguments, possibly creating an empty object with no properties. This will be used by the _bioconductor_CLONE, _bioconductor_COMBINE_ROWS, _bioconductor_COMBINE_COLUMNS and _bioconductor_SLICE_2D methods to return an instance of the subclass.

Constructor

new SingleCellExperiment(assays, optionsopt)

Source:
Parameters:
Name Type Attributes Default Description
assays Object

Object where keys are the assay names and values are multi-dimensional arrays of experimental data.

options Object <optional>
{}

Optional parameters, including those used in the RangedSummarizedExperiment constructor.

Properties
Name Type Attributes Default Description
rowRanges GRanges | GroupedGRanges <optional>
<nullable>
null

Genomic ranges corresponding to each row, see the RangedSummarizedExperiment constructor.

reducedDimensions Object | Map <optional>
{}

Object containing named reduced dimensions. Each value should be a 2-dimensional object with number of rows equal to the number of columns of the assays.

reducedDimensionOrder Array <optional>
<nullable>
null

Array containing the order of the reduced dimensions. This should have the same values as the keys of reducedDimensions, and defaults to those keys if null.

alternativeExperiments Object | Map <optional>
{}

Object containing named alternative experiments. Each value should be a 2-dimensional object with number of columns equal to that of the assays.

alternativeExperimentOrder Array <optional>
<nullable>
null

Array containing the order of the alternative experiments. This should have the same values as the keys of alternativeExperiments, and defaults to those keys if null.

mainExperimentName string <optional>
<nullable>
null

Main experiment name, possibly null if the main experiment is unnamed.

Extends

Classes

SingleCellExperiment

Methods

alternativeExperiment(i) → {SummarizedExperiment}

Source:
Parameters:
Name Type Description
i string | number

Alternative experiment to retrieve, either by name or index.

Returns:

The specified alternative experiment i.

Type
SummarizedExperiment

alternativeExperimentNames() → {Array}

Source:
Returns:

Array of strings containing the (ordered) names of the alternative experiments.

Type
Array

alternativeExperiments() → {Map}

Source:
Returns:

Map where keys are the names and values are the alternative experiments.

Type
Map

assay(i) → {*}

Source:
Overrides:
Parameters:
Name Type Description
i string | number

Assay to retrieve, either by name or index.

Returns:

The contents of assay i as an multi-dimensional array-like object.

Type
*

assayNames() → {Array}

Source:
Overrides:
Returns:

Array of assay names.

Type
Array

assays() → {Map}

Source:
Overrides:
Returns:

Map where keys are the assay names and values are the assays.

Type
Map

columnData() → {DataFrame}

Source:
Overrides:
Returns:

Data frame of column data, with one row per column in this SummarizedExperiment.

Type
DataFrame

columnNames() → (nullable) {Array}

Source:
Overrides:
Returns:

Array of strings containing column names, or null if no column names are available.

Type
Array

mainExperimentName() → (nullable) {string}

Source:
Returns:

The name of the main experiment, possibly null if this is unnamed.

Type
string

metadata() → {List}

Source:
Overrides:
Returns:

List of arbitrary metadata.

Type
List

numberOfAssays() → {number}

Source:
Overrides:
Returns:

Number of assays.

Type
number

numberOfColumns() → {number}

Source:
Overrides:
Returns:

Number of columns in this SummarizedExperiment.

Type
number

numberOfRows() → {number}

Source:
Overrides:
Returns:

Number of rows in this SummarizedExperiment.

Type
number

reducedDimension(i) → {*}

Source:
Parameters:
Name Type Description
i string | number

Reduced dimension to retrieve, either by name or index.

Returns:

The contents of reduced dimension i as an multi-dimensional array-like object.

Type
*

reducedDimensionNames() → {Array}

Source:
Returns:

Array of strings containing the (ordered) names of the reduced dimensions.

Type
Array

reducedDimensions() → {Map}

Source:
Returns:

Map where keys are the names and values are the reduced dimensions.

Type
Map

removeAlternativeExperiment(i, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
i string | number

Identity of the reduced dimension to remove, either by name or index.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment after removing the specified assay. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

removeAssay(i, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
i string | number

Identity of the assay to add, either by name or index.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment after removing the specified assay. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

removeReducedDimension(i, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
i string | number

Identity of the reduced dimension to remove, either by name or index.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment after removing the specified assay. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

rowData() → {DataFrame}

Source:
Overrides:
Returns:

Data frame of row data, with one row per row in this SummarizedExperiment.

Type
DataFrame

rowNames() → (nullable) {Array}

Source:
Overrides:
Returns:

Array of strings containing row names, or null if no row names are available.

Type
Array

rowRanges() → {GRanges}

Source:
Overrides:
Returns:

Genomic ranges corresponding to each row.

Type
GRanges

setAlternativeExperiment(i, value, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
i string | number

Identity of the alternative experiment to add, either by name or index.

  • If i is a number, the alternative experiment at the specified index is replaced. i should be non-negative and less than the number of alternative experiments.
  • If i is a string, any alternative experiment with the same name is replaced. If no such alternative experiment exists, a new alternative experiment is appended to the list of alternative experiments.
value SummarizedExperiment

A SummarizedExperiment to set/add as the alternative experiment.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment with modified alternative experiments. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

setAlternativeExperimentNames(names, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
names Array

Array of strings containing the alternative experiment names. This should be of the same length as the number of alternative experiments and contain unique values.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment with modified alternative experiment names. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

setAlternativeExperiments(value, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
value Object | Map

Object containing zero, one or more SummarizedExperiment objects in the values. Each value should have the same number of columns as this SingleCellExperiment. Keys are alternative experiment names, each of which should be present in order.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

newOrder Array | boolean <optional>
false

Whether to replace the order of alternative experiments with the order of keys in value. If false, the existing order in alternativeExperimentNames is used. If an array is provided, this is used as the order. If null, this has the same effect as true.

Returns:

A SingleCellExperiment with the new alternative experiments. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

setAssay(i, value, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
i string | number

Identity of the assay to add, either by name or index.

  • If i is a number, the assay at the specified index is replaced. i should be non-negative and less than the number of assays.
  • If i is a string, any assay with the same name is replaced. If no such assay exists, a new assay is appended to the list of assays.
value *

Multi-dimensional array-like object to set/add as the assay.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

A SummarizedExperiment with modified assays. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setAssayNames(names, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
names Array

Array of strings containing the assay names. This should be of the same length as the number of assays and contain unique values.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment with modified assay names. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setAssays(value, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
value Object | Map

Object containing zero, one or more multi-dimensional array-like objects in the values. All arrays should have the same number of rows and columns. Keys are assay names, each of which should be present in order.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

newOrder Array | boolean <optional>
false

Whether to replace the order of assays with the order of keys in value. If false, the existing order in assayNames is used. If an array is provided, this is used as the order. If null, this has the same effect as true.

Returns:

A SummarizedExperiment with modified assays. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setColumnData(value, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
value DataFrame

Data frame containing the column annotations. This should have one row for each columns of this SummarizedExperiment.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment with modified column data. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setColumnNames(names, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
names Array

Array of strings of length equal to the number of columns in this SummarizedExperiment, containing column names. Alternatively null, to remove all column names.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment with modified column names. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setMainExperimentName(optionsopt) → (nullable) {string|SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:
  • name - The name of the main experiment, possibly null if this is unnamed.

    Type
    string
  • A SingleCellExperiment with a new main experiment name. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

    Type
    SingleCellExperiment

setMetadata(value, optionsopt) → {Annotated}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
value Object | Map | Array | List

Object containing the metadata.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this Annotated instance in place. If false, a new instance is returned.

Returns:

The Annotated object after replacing the metadata. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
Annotated

setReducedDimension(i, value, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
i string | number

Identity of the reduced dimension to add, either by name or index.

  • If i is a number, the reduced dimension at the specified index is replaced. i should be non-negative and less than the number of reduced dimensions.
  • If i is a string, any reduced dimension with the same name is replaced. If no such reduced dimension exists, a new reduced dimension is appended to the list of reduced dimensions.
value *

Multi-dimensional array-like object to set/add as the reduced dimension.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment with modified reduced dimensions. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

setReducedDimensionNames(names, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
names Array

Array of strings containing the reduced dimension names. This should be of the same length as the number of reduced dimensions and contain unique values.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment with modified reduced dimension names. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

setReducedDimensions(value, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
value Object | Map

Object containing zero, one or more multi-dimensional array-like objects in the values. Each value should be a 2-dimensional object with number of rows equal to the number of columns in this SingleCellExperiment. Keys are reduced dimension names, each of which should be present in order.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

newOrder Array | boolean <optional>
false

Whether to replace the order of reduced dimensions with the order of keys in value. If false, the existing order in reducedDimensionNames is used. If an array is provided, this is used as the order. If null, this has the same effect as true.

Returns:

A SingleCellExperiment with the new reduced dimensions. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

setRowData(value, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
value DataFrame

Data frame containing the row annotations. This should have one row for each row of this SummarizedExperiment.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment with modified row data. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setRowNames(names, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
names Array

Array of strings of length equal to the number of rows in this SummarizedExperiment, containing row names. Alternatively null, to remove all row names.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment with modified row names. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

setRowRanges(value, optionsopt) → {RangedSummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
value GRanges

Genomic ranges corresponding to each row. This should have length equal to the number of rows in this RangedSummarizedExperiment.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this Annotated instance in place. If false, a new instance is returned.

Returns:

The RangedSummarizedExperiment after modifying its rowRanges. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
RangedSummarizedExperiment

sliceAlternativeExperiments(i, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
i Array

Array of strings or indices specifying the alternative experiments to retain in the slice. This should refer to unique alternative experiment names.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment with sliced alternative experiments. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment

sliceAssays(i, optionsopt) → {SummarizedExperiment}

Source:
Overrides:
Parameters:
Name Type Attributes Default Description
i Array

Array of strings or indices specifying the assays to retain in the slice. This should refer to unique assay names.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SummarizedExperiment instance in place. If false, a new instance is returned.

Returns:

The SummarizedExperiment with sliced assays. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SummarizedExperiment

sliceReducedDimensions(i, optionsopt) → {SingleCellExperiment}

Source:
Parameters:
Name Type Attributes Default Description
i Array

Array of strings or indices specifying the reduced dimensions to retain in the slice. This should refer to unique reduced dimension names.

options Object <optional>
{}

Optional parameters.

Properties
Name Type Attributes Default Description
inPlace boolean <optional>
false

Whether to mutate this SingleCellExperiment instance in place. If false, a new instance is returned.

Returns:

The SingleCellExperiment with sliced reduced dimensions. If inPlace = true, this is a reference to the current instance, otherwise a new instance is created and returned.

Type
SingleCellExperiment