Load packages

library( "singleCellNet" )

Load data

Classifier trained on Tabula Muris subset

class_info <- readRDS( "/home/idies/workspace/c_moor_data/singleCellNet/class_info_TM.rds" )

Query kidney cells from Park 2018

stPark <- utils_loadObject( "/home/idies/workspace/c_moor_data/singleCellNet/sampTab_Park_MouseKidney_062118.rda" )
stPark
expPark <- utils_loadObject( "/home/idies/workspace/c_moor_data/singleCellNet/expMatrix_Park_MouseKidney_Oct_12_2018.rda" )
expPark[ 1:10, 1:3 ]
10 x 3 sparse Matrix of class "dgCMatrix"
              AAACCTGAGATATGCA.1 AAACCTGGTTGTGGCC.1 AAACGGGAGCGTCTAT.1
Rp1                            .                  .                  .
Sox17                          .                  .                  .
Mrpl15                         .                  .                  .
Lypla1                         .                  .                  .
Gm37988                        .                  .                  .
Tcea1                          .                  .                  1
Atp6v1h                        .                  .                  .
Rb1cc1                         1                  1                  .
4732440D04Rik                  .                  .                  .
Pcmtd1                         .                  1                  .

Classify

Apply to Park et al query data

  • 2-3 minutes
nqRand = 50
crParkall<-scn_predict(class_info[['cnProc']], expPark, nrand=nqRand)
Loaded in the cnProc
All Done

Visualization

sgrp = as.vector(stPark$description1)
names(sgrp) = as.vector(stPark$sample_name)
grpRand =rep("rand", nqRand)
names(grpRand) = paste("rand_", 1:nqRand, sep='')
sgrp = append(sgrp, grpRand)

# heatmap classification result
sc_hmClass(crParkall, sgrp, max=5000, isBig=TRUE, cCol=F, font=8)

Classification annotation assignment

stPark <- get_cate(classRes = crParkall, sampTab = stPark, dLevel = "description1", sid = "sample_name", nrand = nqRand)
Error in get_cate(classRes = crParkall, sampTab = stPark, dLevel = "description1",  : 
  could not find function "get_cate"

Classification result violin plot

sc_violinClass(sampTab = stPark, classRes = crParkall, sid = "sample_name", dLevel = "description1", addRand = nqRand)
Error in sc_violinClass(sampTab = stPark, classRes = crParkall, sid = "sample_name",  : 
  unused argument (sid = "sample_name")

Document software

sessionInfo()
R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: CentOS Linux 8

Matrix products: default
BLAS:   /home/idies/R/lib64/R/lib/libRblas.so
LAPACK: /home/idies/R/lib64/R/lib/libRlapack.so

locale:
 [1] LC_CTYPE=en_US.UTF-8       LC_NUMERIC=C              
 [3] LC_TIME=en_US.UTF-8        LC_COLLATE=en_US.UTF-8    
 [5] LC_MONETARY=en_US.UTF-8    LC_MESSAGES=en_US.UTF-8   
 [7] LC_PAPER=en_US.UTF-8       LC_NAME=C                 
 [9] LC_ADDRESS=C               LC_TELEPHONE=C            
[11] LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C       

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

other attached packages:
[1] Matrix_1.2-18       singleCellNet_0.1.0 cowplot_1.1.1      
[4] reshape2_1.4.4      pheatmap_1.0.12     dplyr_1.0.7        
[7] ggplot2_3.3.3      

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.6          plyr_1.8.6          RColorBrewer_1.1-2 
 [4] bslib_0.2.4         compiler_4.0.3      pillar_1.6.0       
 [7] jquerylib_0.1.4     tools_4.0.3         digest_0.6.27      
[10] lattice_0.20-41     jsonlite_1.7.2      evaluate_0.14      
[13] lifecycle_1.0.0     tibble_3.1.1        gtable_0.3.0       
[16] pkgconfig_2.0.3     rlang_0.4.10        rstudioapi_0.13    
[19] cli_2.5.0           DBI_1.1.1           parallel_4.0.3     
[22] yaml_2.2.1          xfun_0.22           withr_2.4.2        
[25] stringr_1.4.0       knitr_1.33          generics_0.1.0     
[28] sass_0.3.1          vctrs_0.3.8         grid_4.0.3         
[31] tidyselect_1.1.1    glue_1.4.2          R6_2.5.0           
[34] fansi_0.4.2         rmarkdown_2.7       farver_2.1.0       
[37] purrr_0.3.4         magrittr_2.0.1      scales_1.1.1       
[40] ellipsis_0.3.2      htmltools_0.5.1.1   randomForest_4.6-14
[43] assertthat_0.2.1    colorspace_2.0-0    utf8_1.2.1         
[46] stringi_1.5.3       munsell_0.5.0       crayon_1.4.1       
LS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