add_dimred {dynwrap} | R Documentation |
Add or create a dimensionality reduction
Description
This can also perform dimensionality reduction of
The projected expression state with RNA velocity, only if
dimred
is a function andpair_with_velocity=TRUE
The trajectory, by projecting the milestones and some "waypoints" to the reduced space, only if
dataset
contains a trajectory
Usage
add_dimred(
dataset,
dimred,
dimred_milestones = NULL,
dimred_segment_progressions = NULL,
dimred_segment_points = NULL,
project_trajectory = TRUE,
connect_segments = FALSE,
pair_with_velocity = !is.null(dataset$expression_future),
expression_source = "expression",
...
)
is_wrapper_with_dimred(dataset)
get_dimred(
dataset,
dimred = NULL,
expression_source = "expression",
return_other_dimreds = FALSE
)
Arguments
dataset |
A dataset created by |
dimred |
Can be
|
dimred_milestones |
An optional dimensionality reduction of the milestones. A matrix with milestones in rows and components (comp_1, comp_2, ...) in columns This will be automatically calculated if |
dimred_segment_progressions , dimred_segment_points |
An optional set of points along the trajectory with their dimensionality reduction. These will be automatically calculated if |
project_trajectory |
Whether to also project the trajectory. Only relevant if dataset contains a trajectory, and dimred_segment_progressions and dimred_segment_points are not provided |
connect_segments |
Whether to connect segments between edges |
pair_with_velocity |
Can perform dimensionality reduction if |
expression_source |
The source of expression, can be "counts", "expression", an expression matrix, or another dataset which contains expression |
... |
extra information to be stored in the wrapper |
return_other_dimreds |
Whether or not to return also the milestone dimreds and the segment dimreds, if available. |
Value
A dataset object with dimred, which is a numeric matrix with cells in rows and the different components in columns.
If the dataset contained a trajectory, and
project_trajectory=TRUE
(default), dimred_milestones, dimred_segment_progressions and dimred_segment_points will also be present. These are described inproject_trajectory()
.
See Also
dyndimred::list_dimred_methods()
, project_trajectory()
Examples
if (requireNamespace("dyndimred", quietly = TRUE)) {
dataset <- example_dataset
dataset <- add_dimred(
dataset,
dyndimred::dimred_landmark_mds
)
head(dataset$dimred)
}