生信软件

Monocle2: 从 plot_cell_trajectory

2023-05-19  本文已影响0人  LET149

1. 从trajectory图中提取数据

p2$layers[[1]]$data

> p2 <- plot_cell_trajectory(object_used_monocle2.cds, cell_size = 1, color_by = "seurat_clusters", show_tree=T)
> p2   '#示例一

> head(p2$layers[[1]]$data)
  source target source_prin_graph_dim_1 source_prin_graph_dim_2 target_prin_graph_dim_1 target_prin_graph_dim_2
1    Y_1   Y_26             -0.04066514               -3.064960              -0.3774018               -3.053268
2    Y_1   Y_68             -0.04066514               -3.064960               0.2960487               -3.076719
3    Y_2   Y_20             -0.71411352               -3.041656              -1.0508650               -3.029955
4    Y_2   Y_26             -0.71411352               -3.041656              -0.3774018               -3.053268
5    Y_3   Y_44              4.33050220               -3.194443               4.6652171               -3.198665
6    Y_3   Y_54              4.33050220               -3.194443               3.9953192               -3.188372

> kk <- p2$layers[[1]]$data[,c(3,4)]
> head(kk)
  source_prin_graph_dim_1 source_prin_graph_dim_2
1             -0.04066514               -3.064960
2             -0.04066514               -3.064960
3             -0.71411352               -3.041656
4             -0.71411352               -3.041656
5              4.33050220               -3.194443
6              4.33050220               -3.194443

> kk <- arrange(kk,source_prin_graph_dim_1)
> plot(kk[,1], kk[,2], type="l")   #示例二
示例一
示例二
上一篇下一篇

猜你喜欢

热点阅读