S3 generic that executes the complete tinydenseR analysis pipeline: landmark selection, graph construction, optional cell typing, and mapping.
Usage
RunTDR(x, ...)
# Default S3 method
RunTDR(
x,
.celltype.vec = NULL,
.celltype.vec.overwrite = FALSE,
.verbose = TRUE,
.seed = 123,
...
)
# S3 method for class 'Seurat'
RunTDR(
x,
.sample.var,
.assay = "RNA",
.layer = "counts",
.assay.type = "RNA",
.harmony.var = NULL,
.markers = NULL,
.celltype.vec = NULL,
.min.cells.per.sample = 10,
.verbose = TRUE,
.seed = 123,
.prop.landmarks = 0.1,
.n.threads = if (is.hpc()) {
max(RhpcBLASctl::blas_get_num_procs(),
RhpcBLASctl::omp_get_num_procs(), RhpcBLASctl::omp_get_max_threads(), na.rm = TRUE)
} else {
parallel::detectCores(logical = TRUE)
},
...
)
# S3 method for class 'SingleCellExperiment'
RunTDR(
x,
.sample.var,
.assay = "counts",
.assay.type = "RNA",
.bpcells.dir = NULL,
.harmony.var = NULL,
.markers = NULL,
.celltype.vec = NULL,
.min.cells.per.sample = 10,
.verbose = TRUE,
.seed = 123,
.prop.landmarks = 0.1,
.n.threads = if (is.hpc()) {
max(RhpcBLASctl::blas_get_num_procs(),
RhpcBLASctl::omp_get_num_procs(), RhpcBLASctl::omp_get_max_threads(), na.rm = TRUE)
} else {
parallel::detectCores(logical = TRUE)
},
...
)
# S3 method for class 'HDF5AnnData'
RunTDR(
x,
.sample.var,
.assay.type = "RNA",
.h5ad.group = NULL,
.bpcells.dir = NULL,
.harmony.var = NULL,
.markers = NULL,
.celltype.vec = NULL,
.min.cells.per.sample = 10,
.verbose = TRUE,
.seed = 123,
.prop.landmarks = 0.1,
.n.threads = if (is.hpc()) {
max(RhpcBLASctl::blas_get_num_procs(),
RhpcBLASctl::omp_get_num_procs(), RhpcBLASctl::omp_get_max_threads(), na.rm = TRUE)
} else {
parallel::detectCores(logical = TRUE)
},
...
)
# S3 method for class 'character'
RunTDR(
x,
.sample.var,
.assay.type = "RNA",
.h5ad.group = NULL,
.bpcells.dir = NULL,
.harmony.var = NULL,
.markers = NULL,
.celltype.vec = NULL,
.min.cells.per.sample = 10,
.verbose = TRUE,
.seed = 123,
.prop.landmarks = 0.1,
.n.threads = if (is.hpc()) {
max(RhpcBLASctl::blas_get_num_procs(),
RhpcBLASctl::omp_get_num_procs(), RhpcBLASctl::omp_get_max_threads(), na.rm = TRUE)
} else {
parallel::detectCores(logical = TRUE)
},
...
)
# S3 method for class 'cytoset'
RunTDR(
x,
.sample.var,
.assay.type = "cyto",
.harmony.var = NULL,
.markers = NULL,
.celltype.vec = NULL,
.min.cells.per.sample = 10,
.verbose = TRUE,
.seed = 123,
.prop.landmarks = 0.1,
.n.threads = if (is.hpc()) {
max(RhpcBLASctl::blas_get_num_procs(),
RhpcBLASctl::omp_get_num_procs(), RhpcBLASctl::omp_get_max_threads(), na.rm = TRUE)
} else {
parallel::detectCores(logical = TRUE)
},
...
)
# S3 method for class 'flowSet'
RunTDR(
x,
.sample.var,
.assay.type = "cyto",
.harmony.var = NULL,
.markers = NULL,
.celltype.vec = NULL,
.min.cells.per.sample = 10,
.verbose = TRUE,
.seed = 123,
.prop.landmarks = 0.1,
.n.threads = if (is.hpc()) {
max(RhpcBLASctl::blas_get_num_procs(),
RhpcBLASctl::omp_get_num_procs(), RhpcBLASctl::omp_get_max_threads(), na.rm = TRUE)
} else {
parallel::detectCores(logical = TRUE)
},
...
)
# S3 method for class 'dgCMatrix'
RunTDR(x, .cell.meta, ...)
# S3 method for class 'DelayedMatrix'
RunTDR(x, .cell.meta, .bpcells.dir = NULL, ...)
# S3 method for class 'IterableMatrix'
RunTDR(x, .cell.meta, ...)Arguments
- x
A
DelayedMatrix(features × cells for RNA).- ...
Additional arguments passed to
.run_tdr_matrix(e.g..sample.var,.assay.type,.harmony.var,.markers,.celltype.vec,.min.cells.per.sample,.verbose,.seed,.prop.landmarks,.n.threads).- .celltype.vec
Character(1). Column name in
.cell.metacontaining per-cell type labels, orNULL.- .celltype.vec.overwrite
Logical. If
TRUE, replace an existing.celltype.vecstored in the TDRObj config.- .verbose
Logical. Print progress messages.
- .seed
Integer. Random seed.
- .sample.var
Character(1). Column name in
.cell.metaidentifying sample membership.- .assay
Character(1). Name of the assay in
assayNames(x).- .layer
Character(1). Layer within the assay (e.g.
"counts").- .assay.type
Character.
"RNA"or"cyto".- .harmony.var
Character vector of batch variable column names in sample-level metadata, or
NULL.- .markers
Character vector of marker names (required for cyto).
- .min.cells.per.sample
Integer. Minimum cells for a sample to be included.
- .prop.landmarks
Numeric in (0, 1]. Proportion of cells as landmarks.
- .n.threads
Integer. Number of threads.
- .bpcells.dir
Character(1) or
NULL. Directory path for the BPCells on-disk matrix. IfNULL(default), uses a temporary directory (tempdir()) that is cleaned up on session end. If a path is given and already contains a valid BPCells matrix, the conversion step is skipped (cache hit).- .h5ad.group
Character(1) or
NULL. HDF5 group path containing the count matrix (e.g."/layers/counts"or"/X"). IfNULL(default), auto-detects by probing/layers/countsfirst, then falling back to/X.- .cell.meta
A
data.frameof per-cell metadata. Must have one row per cell with rownames matching cell IDs inx(colnamesfor RNA,rownamesfor cyto).
Value
Depends on the method; see individual method documentation.
The updated TDRObj.
The Seurat object x with the TDRObj stored in
Misc(x, slot = "tdr.obj").
The SingleCellExperiment x with the TDRObj stored
in S4Vectors::metadata(x)$tdr.obj.
A TDRObj.
A TDRObj.
The updated TDRObj.
The updated TDRObj.
A TDRObj.
A TDRObj.
Details
RunTDR is a convenience wrapper around the explicit step-by-step
workflow (get.meta → get.cells → setup.tdr.obj → get.landmarks →
get.graph → get.map → get.embedding).
For equivalent inputs, seed, and arguments the two paths produce
numerically identical results.
Methods (by class)
RunTDR(default): Run the pipeline on an existing TDRObjExecutes
get.landmarks → get.graph → celltyping → get.map → get.embeddingon a pre-builtTDRObj.RunTDR(Seurat): Run the pipeline directly on a Seurat objectBuilds a
TDRObjfrom a Seurat object and executes the full pipeline. The finished TDRObj is stored inSeuratObject::Misc(x, slot = "tdr.obj").All categorical cell-level columns in
x@meta.dataare automatically imported as named celltyping solutions viaimport_cell_annotations. The.celltype.veccolumn (if specified) is set as the active annotation.RunTDR(SingleCellExperiment): Run the pipeline directly on a SingleCellExperimentBuilds a
TDRObjfrom aSingleCellExperimentand executes the full pipeline. The finished TDRObj is stored inS4Vectors::metadata(x)$tdr.obj.If the assay is a
DelayedMatrix(e.g., HDF5-backed), it is converted to a BPCells on-diskIterableMatrixand routed through.run_tdr_matrix()for efficient lazy access. If the assay is an in-memory matrix (e.g.,dgCMatrix), the existing SCE backend path is used.RunTDR(HDF5AnnData): Run the pipeline on an HDF5AnnData objectBuilds a
TDRObjfrom an HDF5-backed AnnData object. The expression matrix is converted to a BPCells on-disk directory for efficient lazy access, then the provenIterableMatrixpipeline is used for all downstream steps.Metadata (obs) is read via
anndataR; the expression matrix is read and converted viaBPCells.RunTDR(character): Run the pipeline directly from an h5ad file pathReads metadata and gene/cell names from the h5ad file using
rhdf5, opens the expression matrix withBPCells, and delegates to the internalIterableMatrixpipeline.This method supports all H5AD format versions, including pre-0.8.0 files generated by older versions of Python anndata that are not supported by the
anndataRpackage.RunTDR(cytoset): Run the pipeline on a flowWorkspace cytosetBuilds a
TDRObjfrom acytosetobject (one FCS sample percytoframe) and executes the full pipeline.RunTDR(flowSet): Run the pipeline on a flowCore flowSetBuilds a
TDRObjfrom aflowSetobject (one FCS sample perflowFrame) and executes the full pipeline. Requires only flowCore (not flowWorkspace).RunTDR(dgCMatrix): Run the pipeline on a sparse matrix (dgCMatrix)Builds a
TDRObjfrom adgCMatrixand per-cell metadata, then executes the full pipeline.RunTDR(DelayedMatrix): Run the pipeline on a DelayedMatrixConverts the
DelayedMatrixto a BPCells on-diskIterableMatrixfor efficient lazy access, then delegates to the provenIterableMatrixpipeline via.run_tdr_matrix().RunTDR(IterableMatrix): Run the pipeline on a BPCells IterableMatrix
