createSubset: Subset creation method for ExperimentSubset objects

Description Usage Arguments Value Examples

Description

Create a subset from an already available assay in the input ExperimentSubset object by specifying the rows and columns to include in the subset.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)

## S4 method for signature 'SubsetRangedSummarizedExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)

## S4 method for signature 'SubsetSingleCellExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)

## S4 method for signature 'SubsetSummarizedExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)

## S4 method for signature 'SubsetSpatialExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)

## S4 method for signature 'SubsetTreeSummarizedExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)

Arguments

x

ExperimentSubset Specify the object from which a subset should be created. Input can also be any object inherited from SummarizedExperiment for immediate conversion and subset formation. A list of slots can also be passed to directly construct an ES object from matrices similar to SE and SCE constructors.

subsetName

character(1) Specify the name of the subset to create.

rows

vector("numeric") Specify the rows to include in this subset. If missing or NULL, all rows are included in the subset. Values can be numeric or character. Default NULL.

cols

vector("numeric") Specify the columns to include in this subset. If missing or NULL, all columns are included in the subset. Values can be numeric or character. Default NULL.

parentAssay

character(1) Specify the parent assay of the subset. This parent assay must already be available in the ExperimentSubset object. If NULL, the first available main assay will be marked as parent. Default NULL.

Value

An ExperimentSubset object that now contains the newly created subset.

Examples

1
2
3
4
5
6
7
8
data(sce_chcl, package = "scds")
es <- ExperimentSubset(sce_chcl)
es <- createSubset(es,
"subset1",
rows = c(10,11,50,56,98,99,102,105,109, 200),
cols = c(20,21,40,45,90,99,100,123,166,299),
parentAssay = "counts")
es

campbio/ExperimentSubset documentation built on Sept. 10, 2021, 3:09 p.m.