This function subsets a liger object with
character feature index and any valid cell index. For datasets based on HDF5,
the filenames of subset H5 files could only be automatically generated for
now. Feature subsetting is based on the intersection of available features
from datasets involved by cellIdx
, while featureIdx = NULL
does
not take the intersection (i.e. nothing done on the feature axis).
a ligerDataset object is also allowed for now and meanwhile,
setting filename
is supported.
subsetLiger(
object,
featureIdx = NULL,
cellIdx = NULL,
useSlot = NULL,
chunkSize = 1000,
verbose = getOption("ligerVerbose", TRUE),
newH5 = TRUE,
returnObject = TRUE,
...
)
Subset object
A liger or ligerDataset object.
Character vector. Missing or NULL
for all
features.
Character, logical or numeric index that can subscribe cells.
Missing or NULL
for all cells.
The slot(s) to only consider. Choose one or more from
"rawData"
, "normData"
and "scaleData"
. Default
NULL
subsets the whole object including analysis result matrices.
Integer. Number of maximum number of cells in each chunk,
Default 1000
.
Logical. Whether to show information of the progress. Default
getOption("ligerVerbose")
or TRUE
if users have not set.
Whether to create new H5 files on disk for the subset datasets
if involved datasets in the object
is HDF5 based. TRUE
writes a
new ones, FALSE
returns in memory data.
Logical, whether to return a liger object
for result. Default TRUE
. FALSE
returns a list containing
requested values.
Arguments passed to subsetLigerDataset
subsetLigerDataset
pbmc.small <- subsetLiger(pbmc, cellIdx = pbmc$nUMI > 200)
pbmc.small <- pbmc[, pbmc$nGene > 50]
Run the code above in your browser using DataLab