reduce_dimension_transform | R Documentation |
Applies a previously calculated reduce_dimension transform model to a new preprocess transformed matrix. For more information read the help information for save_transform_models.
reduce_dimension_transform(
cds,
preprocess_method = NULL,
reduction_method = c("UMAP")
)
cds |
a cell_data_set to be transformed. |
preprocess_method |
the reduced dimension matrix to be transformed using the reduction_method transform model. The default is NULL, which uses the preprocess_method that was used when the reduce_dimension model was built. |
reduction_method |
a previously loaded reduce_dimension transform model that is used to reduce the dimensions of the preprocessed matrix in the cell_data_set. Only "UMAP" is supported. |
a cell_data_set with a transformed reduced count matrix.
## Not run:
cell_metadata <- readRDS(system.file('extdata',
'worm_embryo/worm_embryo_coldata.rds',
package='monocle3'))
gene_metadata <- readRDS(system.file('extdata',
'worm_embryo/worm_embryo_rowdata.rds',
package='monocle3'))
expression_matrix <- readRDS(system.file('extdata',
'worm_embryo/worm_embryo_expression_matrix.rds',
package='monocle3'))
cds <- new_cell_data_set(expression_data=expression_matrix,
cell_metadata=cell_metadata,
gene_metadata=gene_metadata)
ncell <- nrow(colData(cds))
cell_sample <- sample(seq(ncell), 2 * ncell / 3)
cell_set <- seq(ncell) %in% cell_sample
cds1 <- cds[,cell_set]
cds1 <- preprocess_cds(cds1)
cds1 <- reduce_dimension(cds1)
save_transform_models(cds1, 'tm')
cds2 <- cds[,!cell_set]
cds2 <- load_transform_models(cds2, 'tm')
cds2 <- preprocess_transform(cds2, 'PCA')
cds2 <- reduce_dimension_transform(cds2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.