Support custom dimension reduction method #143
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Why this PR
I noticed Monocle2 did reserve room for users to choose a custom dimension reduction (DR) method. See here:
monocle-release/R/order_cells.R
Lines 1387 to 1389 in fed0c16
However, the downstream analysis (
orderCells
andplot_cell_trajectory
) did not fully support it. So thsi PR is to help validate and support the feature.What happened after this PR
reduceDimension
internally writes the projected coordinates toreducedDimS(monocle_object)
.orderCells
will order cells with the same strategy used by the ICA method.plot_cell_trajectory
will visualize the pseudotime track with the same strategy used by the ICA method.Demo
Here I provide a gist to demonstrate the technical side of this PR is working without problems. The pseudotime tracks generated based on ICA and randomized PCA are visualized as:
How to properly define a custom function