## ----选项,结果=“隐藏”,包括= false,cache = false,结果='hide',message = false ---- knitr :: opts_chunk $ set(fig.align =“center”,cache = false,错误= false,#make它停止错误fidth = 7,fig.height = 7,autodep = true,out.width =“600px”,out.height =“600px”,结果=“marpup“,echo = true,eval = true)#kntr :: opts_knit $ set(stop_on_error = 2l)#really使它停止#knitr :: dep_auto()选项(getClass.msg = false)#get摆脱了关于缓存的恼人消息直到内部固定在R set.seed(98883)##为再现性库(BioC2016SingleCell)库(Slingshot)库(Clustexperiment)库(GAM)## ---- Datain ----------------------------------------------------------------------------数据('full_pca')##检查维数减少#plot3d(pcax,aseque ='iso')对(pcax [,1:3],asp = 1)## ---- Line_Unsup ----------------------------------------------------------------------l1 < - get_lineages(pcax,clus)#plot_tree(pcax,clus,l1,threed = true)plot_tree(pcax,clus,l1,dim = 3)## ----线_sup_s酸 - - - - - - - - - - - - - - - - - - - - - - - - ----- l2 < - get_linegeges(pcax,clus,start.clus ='m10')#plot_tree(pcax,clus,l2,threed = true)plot_tree(pcax,clus,l2,dim = 3)## ---lines_sup_end --------------------------------------- --------- l3 < - get_lineage(pcax,clus,start.clus ='m10',end.clus ='m17')#plot_tree(pcax,clus,l3,threed = true)plot_tree(pcax,clus,l3,dim = 3)## ----曲线-------------------------------------------------------- crv <- get_curves(pcaX, clus, l2) # plot_curves(pcaX, clus, c, threeD = TRUE) plot_curves(pcaX, clus, crv, dim = 3) ## ----genedata------------------------------------------------------------ data('var_genes') ## ----fitgam-------------------------------------------------------------- gam.pval <- vector("list",length(crv)) for(l in 1:length(crv)){ t <- crv[[l]]$pseudotime y <- vargenes[,! is.na(t)] t <- t[! is.na(t)] gam.pval[[l]] <- apply(y,1,function(z){ d <- data.frame(z=z, t=t) tmp <- gam(z ~ lo(t), data=d) p <- summary(tmp)[4][[1]][1,5] p }) } ## ----heatmaps------------------------------------------------------------ topgenes1 <- names(sort(gam.pval[[1]], decreasing = FALSE))[1:100] heatdata1 <- vargenes[rownames(vargenes) %in% topgenes1, order(crv[[1]]$pseudotime, na.last = NA)] heatclus1 <- clus[order(crv[[1]]$pseudotime, na.last = NA)] ce1 <- clusterExperiment(heatdata1, heatclus1, transformation=identity) plotHeatmap(ce1, clusterSamplesData="orderSamplesValue") topgenes2 <- names(sort(gam.pval[[2]], decreasing = FALSE))[1:100] heatdata2 <- vargenes[rownames(vargenes) %in% topgenes2, order(crv[[2]]$pseudotime, na.last = NA)] heatclus2 <- clus[order(crv[[2]]$pseudotime, na.last = NA)] ce2 <- clusterExperiment(heatdata2, heatclus2, transformation=identity) plotHeatmap(ce2, clusterSamplesData="orderSamplesValue") ## ----session------------------------------------------------------------- sessionInfo()