Subset creation method for ExperimentSubset objects
Source:R/allGenerics.R, R/SubsetRangedSummarizedExperiment.R, R/SubsetSingleCellExperiment.R, and 3 more
createSubset.RdCreate a subset from an already available assay in the
input ExperimentSubset object by specifying the rows and columns to
include in the subset.
Usage
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)
# S4 method for class 'SubsetRangedSummarizedExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)
# S4 method for class 'SubsetSingleCellExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)
# S4 method for class 'SubsetSummarizedExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)
# S4 method for class 'SubsetSpatialExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)
# S4 method for class 'SubsetTreeSummarizedExperiment'
createSubset(x, subsetName, rows = NULL, cols = NULL, parentAssay = NULL)Arguments
- x
ExperimentSubsetSpecify the object from which a subset should be created. UseExperimentSubset()first to convert another experiment object.- subsetName
character(1)Specify the name of the subset to create.- rows
numericorcharactervector. Specify the rows to include in this subset. IfmissingorNULL, all rows are included in the subset. DefaultNULL.- cols
numericorcharactervector. Specify the columns to include in this subset. IfmissingorNULL, all columns are included in the subset. DefaultNULL.- parentAssay
character(1)Specify the parentassayof the subset: the name of a mainassay, of a subset, or of an assay seen in a subset written as"subset/assay". IfNULL, the first available mainassaywill be marked as parent. DefaultNULL.
Examples
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
#> class: SubsetSingleCellExperiment
#> dim: 2000 2000
#> metadata(0):
#> assays(2): counts logcounts
#> rownames(2000): C12orf73 RNU6-1256P ... FOXF1 PRR3
#> rowData names(1): gene
#> colnames(2000): CTGCTGTCAGGGTATG CAGTCCTTCGGTTAAC ... GATGCTATCAGCAACT
#> ATTTCTGGTGATGATA
#> colData names(11): nGene nUMI ... ident doublet_true_labels
#> reducedDimNames(0):
#> mainExpName: NULL
#> altExpNames(0):
#> subsets(1): subset1
#> subsetAssays(1): subset1