# #——回声= FALSE,结果=“隐藏”,消息= FALSE ------------------------------- 需要(knitr)美元opts_chunk组(错误= FALSE,消息= FALSE,警告= FALSE)图书馆(BiocStyle ) ## ----------------------------------------------------------------------------- # 模拟一个y形的轨迹。centers <- rbind(c(0,0), c(0, -1), c(1,1), c(- 1,1)) rownames(centers) <- seq_len(nrow(centers)) clusters <- sample(nrow(centers), 1000, replace=TRUE) cells <- centers[clusters,] cells <- cells + rnorm(length(cells), sd=0.5) #创建MST:库(TrajectoryUtils) mst < - createClusterMST(细胞,集群)情节(mst) ) ## ----------------------------------------------------------------------------- guessMSTRoots (mst,方法=“maxstep”)guessMSTRoots (mst,方法= " minstep ") ## ----------------------------------------------------------------------------- defineMSTPaths (mst,根= c (" 1 ")) defineMSTPaths (mst,根= c(“2 ")) ## ----------------------------------------------------------------------------- defineMSTPaths (mst,乘以= c (1 = 4,' 2 ' = 0,“3”= 1,“4”= 0 )) ## ----------------------------------------------------------------------------- splitByBranches (mst ) ## ----------------------------------------------------------------------------- # 的一个矩阵拟时间排序。ncells <- 200 npaths <- 5 orderings <- matrix(rnorm(1000), ncells, npaths) #默认构造函数:(美国专利商标局< PseudotimeOrdering(排序 )) ## ----------------------------------------------------------------------------- 美国专利商标局集群< -样本(字母[1:5]、ncell取代= TRUE) cellData(美国专利商标局 ) ## ----------------------------------------------------------------------------- pathData美元(美国专利商标局)描述< - sprintf(“路径——%我”,seq_len (npaths)) pathData(美国专利商标局 ) ## ----------------------------------------------------------------------------- pathStat(美国专利商标局,“信心”)< -矩阵(runif (1000), ncell,npaths) pathStatNames(美国专利商标局 ) ## ----------------------------------------------------------------------------- 总结(averagePseudotime(美国专利商标局 )) ## ----------------------------------------------------------------------------- sessionInfo ()