This can also perform dimensionality reduction of
The projected expression state with RNA velocity, only if dimred
is a function and pair_with_velocity=TRUE
The trajectory, by projecting the milestones and some "waypoints" to the reduced space, only if dataset
contains a trajectory
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
)
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 in project_trajectory()
.
A dataset created by wrap_data()
or wrap_expression()
Can be
A function which will perform the dimensionality reduction, see dyndimred::list_dimred_methods()
A matrix with the dimensionality reduction, with cells in rows and dimensions (comp_1, comp_2, ...) in columns
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 project_trajectory = TRUE
An optional set of points along the trajectory with their dimensionality reduction. dimred_segment_progressions
is a dataframe containing the from and to milestones, and their progression. dimred_segment_points
is a matrix with points (the same number as in dimred_segment_progressions
) in rows and components (comp_1, comp_2, ...) in columns. Both objects have the same number of rows.
These will be automatically calculated if project_trajectory = TRUE
Whether to also project the trajectory. Only relevant if dataset contains a trajectory, and dimred_segment_progressions and dimred_segment_points are not provided
Whether to connect segments between edges
Can perform dimensionality reduction if dimred
is a function.
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
Whether or not to return also the milestone dimreds and the segment dimreds, if available.
dyndimred::list_dimred_methods()
, project_trajectory()
if (requireNamespace("dyndimred", quietly = TRUE)) {
dataset <- example_dataset
dataset <- add_dimred(
dataset,
dyndimred::dimred_landmark_mds
)
head(dataset$dimred)
}
Run the code above in your browser using DataLab