Introduction


In this tutorial we provide a basic overview of Spectre's graphing and violin plot options, with statistical analysis included.


library('Spectre')
package.load()

sum.dat <- Spectre::demo.sum
sum.dat
        Sample Group Batch Cells per sample -- CD4 T cells Cells per sample -- CD8 T cells Cells per sample -- Infil Macrophages	...
 1: 01_Mock_01  Mock     A                        734.6282                       2696.9910                              2143.504	...
 2: 02_Mock_02  Mock     B                        506.0006                       1037.9500                              2536.490	...
 3: 03_Mock_03  Mock     B                        540.5026                       1003.7905                              2470.869	...
 4: 04_Mock_04  Mock     A                        252.2882                        404.8345                              1965.501	...
 5: 05_Mock_05  Mock     A                        201.5021                        549.5512                              2198.205	...
 6: 06_Mock_06  Mock     B                        531.5886                       1308.5259                              4722.961	...
 7:  07_WNV_01   WNV     A                      54094.7075                      50529.2479                            605738.162	...
 8:  08_WNV_02   WNV     B                      20636.9741                      23901.9282                            674243.824	...
 9:  09_WNV_03   WNV     A                      26314.1446                      34814.6759                            678792.425	...
10:  10_WNV_04   WNV     A                      26910.2796                      32397.4082                            652559.687	...
11:  11_WNV_05   WNV     B                      31520.7836                      36292.8545                            644041.191	...
12:  12_WNV_06   WNV     A                      34251.3184                      37500.6658                            645714.590	...
as.matrix(names(sum.dat))
      [,1]                                              
 [1,] "Sample"                                          
 [2,] "Group"                                           
 [3,] "Batch"                                           
 [4,] "Cells per sample -- CD4 T cells"                 
 [5,] "Cells per sample -- CD8 T cells"                 
 [6,] "Cells per sample -- Infil Macrophages"           
 [7,] "Cells per sample -- Microglia"                   
 [8,] "Cells per sample -- Neutrophils"                 
 [9,] "Cells per sample -- NK cells"                    
[10,] "Percent Ly6C_asinh positive -- CD4 T cells"      
[11,] "Percent Ly6C_asinh positive -- CD8 T cells"      
[12,] "Percent Ly6C_asinh positive -- Infil Macrophages"
[13,] "Percent Ly6C_asinh positive -- Microglia"        
[14,] "Percent Ly6C_asinh positive -- Neutrophils"      
[15,] "Percent Ly6C_asinh positive -- NK cells" 
getwd()
make.autograph(dat = sum.dat, 
               x.axis = 'Group', 
               y.axis = 'Cells per sample -- CD4 T cells')


make.autograph(dat = sum.dat, 
               x.axis = 'Group', 
               y.axis = 'Cells per sample -- CD4 T cells', 
               colour.by = 'Batch', 
               violin = FALSE)


make.autograph(dat = sum.dat, 
               x.axis = 'Group', 
               y.axis = 'Cells per sample -- CD4 T cells', 
               grp.order = c('WNV', 'Mock'))


  • No labels