In [ ]:

In linux:

sudo apt-get install python-virtualenv

sudo bash Anaconda3-2019.03-Linux-x86_64.sh

ubuntu@eta190812:~/tools$ sudo sudo bash Anaconda3-2019.07-Linux-x86_64.sh

%then reopen the terminal

(base) ubuntu@eta190812:~$ sudo pip3 install louvain (base) ubuntu@eta190812:~$ sudo pip3 install umap-learn

pip install louvain

pip install umap-learn

sudo apt-get install libudunits2-dev

sudo apt install libgdal-dev

sudo apt-get install mesa-common-dev

sudo apt-get install xorg

sudo apt-get install libcgal-dev libglu1-mesa-dev libglu1-mesa-dev

sudo apt-get install libx11-dev

sudo apt-get install libglu1-mesa-dev

conda install -c r r-rgl

In sudo R:

devtools::dev_mode(path='~/tools/Seurat3/')

devtools::dev_mode(path='~/tools/Monocle3/')

source("http://bioconductor.org/biocLite.R")

biocLite()

biocLite("monocle")

install.packages("reticulate")

library(reticulate)

devtools::install_github("cole-trapnell-lab/DDRTree", ref="simple-ppt-like")

devtools::install_github("cole-trapnell-lab/L1-graph")

devtools::install_github("cole-trapnell-lab/monocle-release", ref="monocle3_alpha")

py_install('umap-learn', pip = T, pip_ignore_installed = T) #It doesn't work

py_install("louvain") #It doesn't work

In [4]:
devtools::dev_mode(path='~/tools/Seurat3/')
Dev mode: OFF
In [5]:
library(Seurat)
library(dplyr)
library(monocle)
Loading required package: ggplot2
Loading required package: cowplot

Attaching package: ‘cowplot’

The following object is masked from ‘package:ggplot2’:

    ggsave

Loading required package: Matrix

Attaching package: ‘dplyr’

The following objects are masked from ‘package:stats’:

    filter, lag

The following objects are masked from ‘package:base’:

    intersect, setdiff, setequal, union

Loading required package: DelayedArray
Loading required package: stats4
Loading required package: matrixStats

Attaching package: ‘matrixStats’

The following object is masked from ‘package:dplyr’:

    count

Loading required package: BiocGenerics
Loading required package: parallel

Attaching package: ‘BiocGenerics’

The following objects are masked from ‘package:parallel’:

    clusterApply, clusterApplyLB, clusterCall, clusterEvalQ,
    clusterExport, clusterMap, parApply, parCapply, parLapply,
    parLapplyLB, parRapply, parSapply, parSapplyLB

The following objects are masked from ‘package:dplyr’:

    combine, intersect, setdiff, union

The following objects are masked from ‘package:Matrix’:

    colMeans, colSums, rowMeans, rowSums, which

The following objects are masked from ‘package:stats’:

    IQR, mad, sd, var, xtabs

The following objects are masked from ‘package:base’:

    anyDuplicated, append, as.data.frame, basename, cbind, colMeans,
    colnames, colSums, dirname, do.call, duplicated, eval, evalq,
    Filter, Find, get, grep, grepl, intersect, is.unsorted, lapply,
    lengths, Map, mapply, match, mget, order, paste, pmax, pmax.int,
    pmin, pmin.int, Position, rank, rbind, Reduce, rowMeans, rownames,
    rowSums, sapply, setdiff, sort, table, tapply, union, unique,
    unsplit, which, which.max, which.min

Loading required package: S4Vectors

Attaching package: ‘S4Vectors’

The following objects are masked from ‘package:dplyr’:

    first, rename

The following object is masked from ‘package:Matrix’:

    expand

The following object is masked from ‘package:base’:

    expand.grid

Loading required package: IRanges

Attaching package: ‘IRanges’

The following objects are masked from ‘package:dplyr’:

    collapse, desc, slice

Loading required package: BiocParallel

Attaching package: ‘DelayedArray’

The following objects are masked from ‘package:matrixStats’:

    colMaxs, colMins, colRanges, rowMaxs, rowMins, rowRanges

The following objects are masked from ‘package:base’:

    aperm, apply

Loading required package: Biobase
Welcome to Bioconductor

    Vignettes contain introductory material; view with
    'browseVignettes()'. To cite Bioconductor, see
    'citation("Biobase")', and for packages 'citation("pkgname")'.


Attaching package: ‘Biobase’

The following objects are masked from ‘package:matrixStats’:

    anyMissing, rowMedians

Loading required package: igraph

Attaching package: ‘igraph’

The following objects are masked from ‘package:DelayedArray’:

    path, simplify

The following object is masked from ‘package:IRanges’:

    union

The following object is masked from ‘package:S4Vectors’:

    union

The following objects are masked from ‘package:BiocGenerics’:

    normalize, path, union

The following objects are masked from ‘package:dplyr’:

    as_data_frame, groups, union

The following objects are masked from ‘package:stats’:

    decompose, spectrum

The following object is masked from ‘package:base’:

    union

Loading required package: DDRTree
Loading required package: irlba
Loading required package: L1Graph
Loading required package: lpSolveAPI

Attaching package: ‘L1Graph’

The following object is masked from ‘package:DDRTree’:

    sqdist_R

Warning message in rgl.init(initValue, onlyNULL):
“RGL: unable to open X11 display”Warning message:
“'rgl_init' failed, running with rgl.useNULL = TRUE”
In [6]:
sessionInfo()
R version 3.5.3 (2019-03-11)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.2 LTS

Matrix products: default
BLAS: /usr/lib/x86_64-linux-gnu/blas/libblas.so.3.7.1
LAPACK: /usr/lib/x86_64-linux-gnu/lapack/liblapack.so.3.7.1

locale:
 [1] LC_CTYPE=C.UTF-8       LC_NUMERIC=C           LC_TIME=C.UTF-8       
 [4] LC_COLLATE=C.UTF-8     LC_MONETARY=C.UTF-8    LC_MESSAGES=C.UTF-8   
 [7] LC_PAPER=C.UTF-8       LC_NAME=C              LC_ADDRESS=C          
[10] LC_TELEPHONE=C         LC_MEASUREMENT=C.UTF-8 LC_IDENTIFICATION=C   

attached base packages:
[1] parallel  stats4    stats     graphics  grDevices utils     datasets 
[8] methods   base     

other attached packages:
 [1] monocle_2.99.3          L1Graph_0.1.1           lpSolveAPI_5.5.2.0-17.1
 [4] DDRTree_0.1.5           irlba_2.3.3             igraph_1.2.4.1         
 [7] Biobase_2.42.0          DelayedArray_0.8.0      BiocParallel_1.16.6    
[10] IRanges_2.16.0          S4Vectors_0.20.1        BiocGenerics_0.28.0    
[13] matrixStats_0.54.0      dplyr_0.8.1             Seurat_2.3.4           
[16] Matrix_1.2-17           cowplot_0.9.4           ggplot2_3.1.1          

loaded via a namespace (and not attached):
  [1] reticulate_1.11.1       R.utils_2.8.0           tidyselect_0.2.5       
  [4] htmlwidgets_1.3         grid_3.5.3              trimcluster_0.1-2.1    
  [7] docopt_0.6.1            Rtsne_0.15              devtools_2.0.1         
 [10] munsell_0.5.0           units_0.6-3             codetools_0.2-16       
 [13] ica_1.0-2               pbdZMQ_0.3-3            miniUI_0.1.1.1         
 [16] withr_2.1.2             colorspace_1.4-1        fastICA_1.2-1          
 [19] knitr_1.23              uuid_0.1-2              rstudioapi_0.10        
 [22] ROCR_1.0-7              robustbase_0.93-4       dtw_1.20-1             
 [25] pbmcapply_1.4.1         gbRd_0.4-11             Rdpack_0.10-1          
 [28] lars_1.2                slam_0.1-45             repr_0.19.2            
 [31] bit64_0.9-7             pheatmap_1.0.12         rprojroot_1.3-2        
 [34] LearnBayes_2.15.1       coda_0.19-2             xfun_0.7               
 [37] diptest_0.75-7          R6_2.4.0                doParallel_1.0.14      
 [40] VGAM_1.1-1              hdf5r_1.1.1             manipulateWidget_0.10.0
 [43] flexmix_2.3-15          bitops_1.0-6            assertthat_0.2.1       
 [46] promises_1.0.1          SDMTools_1.1-221        scales_1.0.0           
 [49] nnet_7.3-12             gtable_0.3.0            npsurv_0.4-0           
 [52] processx_3.3.1          rlang_0.3.4             splines_3.5.3          
 [55] lazyeval_0.2.2          acepack_1.4.1           checkmate_1.9.1        
 [58] rgl_0.100.19            reshape2_1.4.3          crosstalk_1.0.0        
 [61] backports_1.1.4         httpuv_1.5.1            Hmisc_4.2-0            
 [64] tools_3.5.3             usethis_1.5.0           spData_0.3.0           
 [67] gplots_3.0.1.1          RColorBrewer_1.1-2      proxy_0.4-23           
 [70] sessioninfo_1.1.1       ggridges_0.5.1          Rcpp_1.0.1             
 [73] plyr_1.8.4              base64enc_0.1-3         classInt_0.3-3         
 [76] purrr_0.3.2             densityClust_0.3        ps_1.3.0               
 [79] prettyunits_1.0.2       deldir_0.1-16           rpart_4.1-13           
 [82] viridis_0.5.1           pbapply_1.4-0           zoo_1.8-5              
 [85] ggrepel_0.8.1           cluster_2.0.7-1         fs_1.2.7               
 [88] magrittr_1.5            data.table_1.12.2       gmodels_2.18.1         
 [91] lmtest_0.9-36           RANN_2.6.1              mvtnorm_1.0-10         
 [94] fitdistrplus_1.0-14     pkgload_1.0.2           lsei_1.2-0             
 [97] mime_0.6                evaluate_0.14           xtable_1.8-4           
[100] mclust_5.4.3            sparsesvd_0.1-4         gridExtra_2.3          
[103] HSMMSingleCell_1.2.0    compiler_3.5.3          tibble_2.1.3           
[106] KernSmooth_2.23-15      crayon_1.3.4            R.oo_1.22.0            
[109] htmltools_0.3.6         spdep_1.1-2             segmented_0.5-3.0      
[112] later_0.8.0             Formula_1.2-3           snow_0.4-3             
[115] tidyr_0.8.3             expm_0.999-4            DBI_1.0.0              
[118] MASS_7.3-51.1           fpc_2.1-11.1            boot_1.3-20            
[121] sf_0.7-4                cli_1.1.0               R.methodsS3_1.7.1      
[124] gdata_2.18.0            metap_1.1               pkgconfig_2.0.2        
[127] sp_1.3-1                foreign_0.8-70          IRdisplay_0.7.0        
[130] plotly_4.9.0            foreach_1.4.4           webshot_0.5.1          
[133] bibtex_0.4.2            stringr_1.4.0           callr_3.2.0            
[136] digest_0.6.19           tsne_0.1-3              htmlTable_1.13.1       
[139] kernlab_0.9-27          shiny_1.3.2             gtools_3.8.1           
[142] modeltools_0.2-22       nlme_3.1-137            jsonlite_1.6           
[145] desc_1.2.0              viridisLite_0.3.0       limma_3.38.3           
[148] pillar_1.4.1            lattice_0.20-38         httr_1.4.0             
[151] DEoptimR_1.0-8          pkgbuild_1.0.3          survival_2.43-3        
[154] glue_1.3.1              remotes_2.0.2           qlcMatrix_0.9.7        
[157] FNN_1.1.3               png_0.1-7               prabclus_2.2-7         
[160] iterators_1.0.10        glmnet_2.0-18           bit_1.1-14             
[163] class_7.3-15            stringi_1.4.3           mixtools_1.1.0         
[166] doSNOW_1.0.16           latticeExtra_0.6-28     caTools_1.17.1.2       
[169] memoise_1.1.0           IRkernel_0.8.15.9000    e1071_1.7-2            
[172] ape_5.3                
In [7]:
R.utils::sourceDirectory('~/tools/Rcodes/Monocle3-alpha-plus/',modifiedOnly=FALSE,verbose=TRUE)
In [8]:
DeepGenes <- read.table("190220DeepTree4000genes.txt",sep="_")
DeepGenes2=as.vector(unlist(DeepGenes[,2]))
In [9]:
load("190627MouseLimb10X_Monocle3.Robj")
In [10]:
MouseFull <- ReadH5AD(file = "../190714MouseLimb10Xraw.h5ad")
Error in ReadH5AD(file = "../190714MouseLimb10Xraw.h5ad"): could not find function "ReadH5AD"
Traceback:
In [ ]:
pData(updated_MouseLimb10X_Monocle)$bh.pval.more.than.0.1 <- !MouseFull@meta.data$bh.pval.less.than.0.1
In [10]:
head(pData(updated_MouseLimb10X_Monocle))
nGenenUMIorig.identpercent.mitores.0.6res.0.7res.1res.0.9res.0.8res.0.5res.0.3res.1.5res.0.1batchstageSize_FactorTotal_mRNAsnum_genes_expressedlouvain_componentbh.pval.more.than.0.1
limb12_13_0AAACCTGAGATCGATA_13404 11426 3 0.016366183 3 2 3 2 4 3 3 0 limb12 13.0 1.5223071 11426 3404 1 FALSE
limb12_13_0AAACCTGAGATGAGAG_12322 6474 2 0.013283900 1 10 1 0 3 2 6 0 limb12 13.0 0.8625430 6474 2322 1 TRUE
limb12_13_0AAACCTGAGCAGATCG_12162 8269 5 0.0116096312 11 12 11 11 8 5 16 3 limb12 13.0 1.1016942 8269 2162 5 TRUE
limb12_13_0AAACCTGAGCGATCCC_13771 14966 6 0.0110918111 10 11 10 10 9 6 10 0 limb12 13.0 1.9939479 14966 3771 1 TRUE
limb12_13_0AAACCTGAGTGTACCT_12517 7649 1 0.0180415711 0 1 0 0 0 1 20 0 limb12 13.0 1.0190904 7649 2517 1 TRUE
limb12_13_0AAACCTGAGTTGTAGA_11871 4317 1 0.022006021 0 1 0 0 0 1 20 0 limb12 13.0 0.5751619 4317 1871 1 TRUE
In [13]:
cell_type_color <- c('0'='#000000',
           '1'='#0118FA',
           '2'='#C0C0C0',
           '3'='#00FFFF',
           '4'='#FF8380',
           '5'='#8B8A1D',
           '6'='#CAC379',
           '7'='#00FF00',
           '8'='#FFFA2C',
           '9'='#C39CFB',
           '10'='#7762F0',
           '11'='#717E8D',
           '12'='#A71206',
           '13'='#35B5E2',
           '14'='#9834E7',
           '15'='#995432',
           '16'='#483F84',
           '17'='#ff0000',
           '18'='#216407',
           '19'='#ff42ef',
           '20'='#FBC83C',
           '21'='#FF9A21',
           '22'='#B4246E',
           '23'='#09658A',
           '24'='#016edb')
In [ ]:
DelayedArray:::set_verbose_block_processing(TRUE)
In [11]:
#updated_MouseLimb10X_Monocle <- updated_MouseLimb10X_Monocle[,
#                        pData(updated_MouseLimb10X_Monocle)$bh.pval.more.than.0.1]
In [ ]:
options(DelayedArray.block.size=1000e6)
In [ ]:
options(future.globals.maxSize= 8096 * 1024^2)
library(future)
plan(strategy = "multicore", workers = 30)
In [15]:
updated_MouseLimb10X_Monocle <- estimateSizeFactors(updated_MouseLimb10X_Monocle)
updated_MouseLimb10X_Monocle <- estimateDispersions(updated_MouseLimb10X_Monocle)
Processing block 1/128 ... OK
Processing block 2/128 ... OK
Processing block 3/128 ... OK
Processing block 4/128 ... OK
Processing block 5/128 ... OK
Processing block 6/128 ... OK
Processing block 7/128 ... OK
Processing block 8/128 ... OK
Processing block 9/128 ... OK
Processing block 10/128 ... OK
Processing block 11/128 ... OK
Processing block 12/128 ... OK
Processing block 13/128 ... OK
Processing block 14/128 ... OK
Processing block 15/128 ... OK
Processing block 16/128 ... OK
Processing block 17/128 ... OK
Processing block 18/128 ... OK
Processing block 19/128 ... OK
Processing block 20/128 ... OK
Processing block 21/128 ... OK
Processing block 22/128 ... OK
Processing block 23/128 ... OK
Processing block 24/128 ... OK
Processing block 25/128 ... OK
Processing block 26/128 ... OK
Processing block 27/128 ... OK
Processing block 28/128 ... OK
Processing block 29/128 ... OK
Processing block 30/128 ... OK
Processing block 31/128 ... OK
Processing block 32/128 ... OK
Processing block 33/128 ... OK
Processing block 34/128 ... OK
Processing block 35/128 ... OK
Processing block 36/128 ... OK
Processing block 37/128 ... OK
Processing block 38/128 ... OK
Processing block 39/128 ... OK
Processing block 40/128 ... OK
Processing block 41/128 ... OK
Processing block 42/128 ... OK
Processing block 43/128 ... OK
Processing block 44/128 ... OK
Processing block 45/128 ... OK
Processing block 46/128 ... OK
Processing block 47/128 ... OK
Processing block 48/128 ... OK
Processing block 49/128 ... OK
Processing block 50/128 ... OK
Processing block 51/128 ... OK
Processing block 52/128 ... OK
Processing block 53/128 ... OK
Processing block 54/128 ... OK
Processing block 55/128 ... OK
Processing block 56/128 ... OK
Processing block 57/128 ... OK
Processing block 58/128 ... OK
Processing block 59/128 ... OK
Processing block 60/128 ... OK
Processing block 61/128 ... OK
Processing block 62/128 ... OK
Processing block 63/128 ... OK
Processing block 64/128 ... OK
Processing block 65/128 ... OK
Processing block 66/128 ... OK
Processing block 67/128 ... OK
Processing block 68/128 ... OK
Processing block 69/128 ... OK
Processing block 70/128 ... OK
Processing block 71/128 ... OK
Processing block 72/128 ... OK
Processing block 73/128 ... OK
Processing block 74/128 ... OK
Processing block 75/128 ... OK
Processing block 76/128 ... OK
Processing block 77/128 ... OK
Processing block 78/128 ... OK
Processing block 79/128 ... OK
Processing block 80/128 ... OK
Processing block 81/128 ... OK
Processing block 82/128 ... OK
Processing block 83/128 ... OK
Processing block 84/128 ... OK
Processing block 85/128 ... OK
Processing block 86/128 ... OK
Processing block 87/128 ... OK
Processing block 88/128 ... OK
Processing block 89/128 ... OK
Processing block 90/128 ... OK
Processing block 91/128 ... OK
Processing block 92/128 ... OK
Processing block 93/128 ... OK
Processing block 94/128 ... OK
Processing block 95/128 ... OK
Processing block 96/128 ... OK
Processing block 97/128 ... OK
Processing block 98/128 ... OK
Processing block 99/128 ... OK
Processing block 100/128 ... OK
Processing block 101/128 ... OK
Processing block 102/128 ... OK
Processing block 103/128 ... OK
Processing block 104/128 ... OK
Processing block 105/128 ... OK
Processing block 106/128 ... OK
Processing block 107/128 ... OK
Processing block 108/128 ... OK
Processing block 109/128 ... OK
Processing block 110/128 ... OK
Processing block 111/128 ... OK
Processing block 112/128 ... OK
Processing block 113/128 ... OK
Processing block 114/128 ... OK
Processing block 115/128 ... OK
Processing block 116/128 ... OK
Processing block 117/128 ... OK
Processing block 118/128 ... OK
Processing block 119/128 ... OK
Processing block 120/128 ... OK
Processing block 121/128 ... OK
Processing block 122/128 ... OK
Processing block 123/128 ... OK
Processing block 124/128 ... OK
Processing block 125/128 ... OK
Processing block 126/128 ... OK
Processing block 127/128 ... OK
Processing block 128/128 ... OK
Removing 38 outliers
In [16]:
plot_pc_variance_explained(updated_MouseLimb10X_Monocle)
Processing block 1/6 ... OK
Processing block 2/6 ... OK
Processing block 3/6 ... OK
Processing block 4/6 ... OK
Processing block 5/6 ... OK
Processing block 6/6 ... OK
In [ ]:

In [21]:
updated_MouseLimb10X_Monocle <- preprocessCDS(updated_MouseLimb10X_Monocle, num_dim = 50)
updated_MouseLimb10X_Monocle <- reduceDimension(updated_MouseLimb10X_Monocle, reduction_method = 'UMAP')
updated_MouseLimb10X_Monocle <- partitionCells(updated_MouseLimb10X_Monocle)
updated_MouseLimb10X_Monocle <- learnGraph(updated_MouseLimb10X_Monocle,  RGE_method = 'SimplePPT')
plot_cell_trajectory(updated_MouseLimb10X_Monocle,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/6 ... OK
Processing block 2/6 ... OK
Processing block 3/6 ... OK
Processing block 4/6 ... OK
Processing block 5/6 ... OK
Processing block 6/6 ... OK
In [22]:
updated_MouseLimb10X_Monocle <- preprocessCDS(updated_MouseLimb10X_Monocle, num_dim = 12)
updated_MouseLimb10X_Monocle <- reduceDimension(updated_MouseLimb10X_Monocle, reduction_method = 'UMAP')
updated_MouseLimb10X_Monocle <- partitionCells(updated_MouseLimb10X_Monocle)
updated_MouseLimb10X_Monocle <- learnGraph(updated_MouseLimb10X_Monocle,  RGE_method = 'SimplePPT')
plot_cell_trajectory(updated_MouseLimb10X_Monocle,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/6 ... OK
Processing block 2/6 ... OK
Processing block 3/6 ... OK
Processing block 4/6 ... OK
Processing block 5/6 ... OK
Processing block 6/6 ... OK
Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”
In [17]:
pData(updated_MouseLimb10X_Monocle)$bh.pval <- MouseFull@meta.data[row.names(pData(updated_MouseLimb10X_Monocle)),
                                                                   'bh.pval']
In [18]:
pData(updated_MouseLimb10X_Monocle)$doublet.scores <- MouseFull@meta.data[row.names(pData(updated_MouseLimb10X_Monocle)),
                                                                   'doublet.scores']
In [27]:
pData(updated_MouseLimb10X_Monocle)$doublet.scores <- MouseFull@meta.data[row.names(pData(updated_MouseLimb10X_Monocle)),
                                                                         'doublet.scores']

Muscle cells

In [ ]:
R.utils::sourceDirectory('~/tools/Rcodes/Monocle3-alpha-plus/',modifiedOnly=FALSE,verbose=TRUE)
In [ ]:
cds = ClusterSubsetPCA_3alpha(updated_MouseLimb10X_Monocle,idents=c("4","7","12","17","22"),genes = DeepGenes2)
In [ ]:
plot_pc_variance_explained(cds)
In [219]:
options(DelayedArray.block.size=1000e6)
cds <- preprocessCDS(cds,num_dim = 20)
cds <- UMAPLearnGraphFixPartition_3alpha(cds)
stage = 10.5
cell_ids <- which(pData(cds)[, "stage"] == stage)
root_pr_nodes <- Cells2Nodes_3alpha(cds,cell_ids)
cds = orderCells(cds, root_pr_nodes = root_pr_nodes)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/1 ... OK
Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”
In [220]:
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "Pseudotime") + viridis::scale_color_viridis(option="plasma")
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [221]:
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "stage") + viridis::scale_color_viridis(option="plasma",discrete=TRUE)
In [222]:
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Osr1","Lum","Pdgfra","Myod1","Myog","Pax3","Pax7","Msc","Col6a3","Col1a1",
                       "Tnnt1","Tnnc1","Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [172]:
cell_ids = 'limb7_10_5AAATGCCAGCGAGAAA_1'
In [111]:
WhichCells(object = MouseFull, expression = Pax3 > 20)
  1. 'limb7_10_5AAATGCCAGCGAGAAA_1'
  2. 'limb7_10_5ACATGGTTCCGCTGTT_1'
  3. 'limb7_10_5CCGTTCACATTACGAC_1'
  4. 'limb7_10_5CTCGGGATCCTCATTA_1'
  5. 'limb7_10_5TCGCGAGTCCGCGCAA_1'
In [223]:
options(DelayedArray.block.size=1000e6)
cds <- preprocessCDS(cds,num_dim = 9)
cds <- UMAPLearnGraphFixPartition_3alpha(cds)
stage = 10.5
cell_ids <- which(pData(cds)[, "stage"] == stage)
root_pr_nodes <- Cells2Nodes_3alpha(cds,cell_ids)
cds = orderCells(cds, root_pr_nodes = root_pr_nodes)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "Pseudotime") + viridis::scale_color_viridis(option="plasma")
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "stage") + viridis::scale_color_viridis(option="plasma",discrete=TRUE)
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Osr1","Lum","Pdgfra","Myod1","Myog","Pax3","Pax7","Msc","Col6a3","Col1a1",
                       "Tnnt1","Tnnc1","Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2") 
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/1 ... OK
Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [224]:
options(DelayedArray.block.size=1000e6)
cds <- preprocessCDS(cds,num_dim = 7)
cds <- UMAPLearnGraphFixPartition_3alpha(cds)
stage = 10.5
cell_ids <- which(pData(cds)[, "stage"] == stage)
root_pr_nodes <- Cells2Nodes_3alpha(cds,cell_ids)
cds = orderCells(cds, root_pr_nodes = root_pr_nodes)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "Pseudotime") + viridis::scale_color_viridis(option="plasma")
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "stage") + viridis::scale_color_viridis(option="plasma",discrete=TRUE)
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Osr1","Lum","Pdgfra","Myod1","Myog","Pax3","Pax7","Msc","Col6a3","Col1a1",
                       "Tnnt1","Tnnc1","Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2") 
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/1 ... OK
Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [28]:
plot_cell_trajectory(updated_MouseLimb10X_Monocle_muscle,cell_size=0.1,
                     color_by = "bh.pval") + scale_color_distiller(palette = "RdYlGn")
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.

Clean Muscle

In [11]:
cds = ClusterSubsetPCA_3alpha(updated_MouseLimb10X_Monocle,idents=c("4","7","12","17"),genes = DeepGenes2)
plot_pc_variance_explained(cds)
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”
In [14]:
options(DelayedArray.block.size=1000e6)
cds <- preprocessCDS(cds,num_dim = 20)
cds <- UMAPLearnGraphFixPartition_3alpha(cds)
stage = 10.5
cell_ids <- which(pData(cds)[, "stage"] == stage)
root_pr_nodes <- Cells2Nodes_3alpha(cds,cell_ids)
cds = orderCells(cds, root_pr_nodes = root_pr_nodes)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "Pseudotime") + viridis::scale_color_viridis(option="plasma")
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "stage") + viridis::scale_color_viridis(option="plasma",discrete=TRUE)
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Osr1","Lum","Pdgfra","Myod1","Myog","Pax3","Pax7","Msc","Col6a3","Col1a1",
                       "Tnnt1","Tnnc1","Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2") 
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [216]:
options(DelayedArray.block.size=1000e6)
cds <- preprocessCDS(cds,num_dim = 9)
cds <- UMAPLearnGraphFixPartition_3alpha(cds)
stage = 10.5
cell_ids <- which(pData(cds)[, "stage"] == stage)
root_pr_nodes <- Cells2Nodes_3alpha(cds,cell_ids)
cds = orderCells(cds, root_pr_nodes = root_pr_nodes)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "Pseudotime") + viridis::scale_color_viridis(option="plasma")
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "stage") + viridis::scale_color_viridis(option="plasma",discrete=TRUE)
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Osr1","Lum","Pdgfra","Myod1","Myog","Pax3","Pax7","Msc","Col6a3","Col1a1",
                       "Tnnt1","Tnnc1","Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2") 
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/1 ... OK
Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [213]:
options(DelayedArray.block.size=1000e6)
cds <- preprocessCDS(cds,num_dim = 7)
cds <- UMAPLearnGraphFixPartition_3alpha(cds)
stage = 10.5
cell_ids <- which(pData(cds)[, "stage"] == stage)
root_pr_nodes <- Cells2Nodes_3alpha(cds,cell_ids)
cds = orderCells(cds, root_pr_nodes = root_pr_nodes)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "orig.ident") +
                     scale_color_manual(values = cell_type_color)
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "Pseudotime") + viridis::scale_color_viridis(option="plasma")
plot_cell_trajectory(cds,cell_size=0.1,
                     color_by = "stage") + viridis::scale_color_viridis(option="plasma",discrete=TRUE)
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Osr1","Lum","Pdgfra","Myod1","Myog","Pax3","Pax7","Msc","Col6a3","Col1a1",
                       "Tnnt1","Tnnc1","Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Warning message in if (method == "PCA") {:
“the condition has length > 1 and only the first element will be used”Processing block 1/1 ... OK
Warning message:
“Deprecated, use tibble::rownames_to_column() instead.”Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [215]:
plot_cell_trajectory(cds,use_color_gradient = TRUE,cell_size=0.1,
                     markers=c("Birc5", "Cenpa", "Top2a", "Mki67")) + scale_color_gradient(low="snow2", high="red", 
                na.value = "snow2")
Scale for 'colour' is already present. Adding another scale for 'colour',
which will replace the existing scale.
In [ ]: