美文网首页生信软件
Monocle2: 从 plot_cell_trajectory

Monocle2: 从 plot_cell_trajectory

作者: LET149 | 来源:发表于2023-05-19 11:22 被阅读0次

    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")   #示例二
    
    示例一
    示例二

    相关文章

      网友评论

        本文标题:Monocle2: 从 plot_cell_trajectory

        本文链接:https://www.haomeiwen.com/subject/uatfzltx.html