-
Notifications
You must be signed in to change notification settings - Fork 5
Description
Hi,
Thanks a lot for developing the powerful dynverse series software. But I come across an issue in plotting, could you please help me to fix it.
This is the code that I used and the error message that I receive:
library(tidyverse)
library(dyno)
get trajectory
data(example_bifurcating)
trajectory <- example_bifurcating %>% add_root()
gather some prior information
grouping <- trajectory$prior_information$groups_id
groups <- tibble(
group_id = trajectory$milestone_ids,
color = dynplot:::milestone_palette_list$auto(length(group_id))
)
features_oi <- apply(as.matrix(trajectory$counts), 2, sd) %>% sort() %>% names() %>% tail(10)
feature_oi <- features_oi[[10]]
patchwork::wrap_plots(
plot_dimred(trajectory) + labs(title = "Topology"),
plot_dimred(trajectory, "milestone") + labs(title = "Ordering"),
plot_dimred(trajectory, grouping=grouping, groups=groups) + labs(title = "Grouping/clustering"),
plot_dimred(trajectory, feature_oi=feature_oi) + labs(title = "Expression of\na single gene"),
plot_dimred(trajectory, "pseudotime") + labs(title = "Pseudotime"),
byrow = TRUE,
ncol = 3
) & theme(legend.position = "none")
Coloring by milestone
Using milestone_percentages from trajectory
Using milestone_percentages from trajectory
Coloring by grouping
Coloring by expression
Pseudotime not provided, will calculate pseudotime from root milestone
Error in ggforce::geom_link2():
! Problem while converting geom to grob.
ℹ Error occurred in the 7th layer.
Caused by error in [.data.frame:
! undefined columns selected
Run rlang::last_error() to see where the error occurred.
rlang::last_error()
<error/rlang_error>
Error in ggforce::geom_link2():
! Problem while converting geom to grob.
ℹ Error occurred in the 7th layer.
Caused by error in [.data.frame:
! undefined columns selected
Backtrace:
- base (local)
<fn>(x) - patchwork:::print.patchwork(x)
- patchwork:::build_patchwork(plot, plot$layout$guides %||% "auto")
- base::lapply(x$plots, plot_table, guides = guides)
- patchwork:::plot_table.ggplot(X[[i]], ...)
- ggplot2::ggplotGrob(x)
- ggplot2:::ggplot_gtable.ggplot_built(ggplot_build(x))
- ggplot2:::by_layer(...)
- ggplot2 (local) f(l = layers[[i]], d = data[[i]])
- l$draw_geom(d, layout)
- ggplot2 (local) draw_geom(..., self = self)
- self$geom$draw_layer(...)
- ggplot2 (local) draw_layer(..., self = self)
- base::lapply(...)
- ggplot2 (local) FUN(X[[i]], ...)
- self$draw_panel(...)
- ggforce (local) draw_panel(...)
- ggforce:::dapply(...)
- base::lapply(...)
- ggforce (local) FUN(X[[i]], ...)
- ggforce (local) fun(cur_data, ...)
- base::
[.data.frame(df, , c("alpha", "colour", "size", "linetype")) - base::stop("undefined columns selected")
Runrlang::last_trace()to see the full context.