Skip to contents

The function can calculate the pathway pcascore for celltypes and single cells.

Usage

Pathway_pcascore_run(
  Pagwas = NULL,
  Pathway_list = NULL,
  min.pathway.size = 10,
  max.pathway.size = 1000
)

Arguments

Pagwas

Pagwas format

Pathway_list

Pathawy gene list(gene symbol),list name is pathway name.

min.pathway.size

Threshold for min pathway gene size.

max.pathway.size

Threshold for max pathway gene size.

Value

pca score for pathway in single data and celltypes

Author

Chunyu Deng

Examples

library(scPagwas)
Pagwas <- list()
# Start to read the single cell data
Single_data <- readRDS(system.file("extdata", "scRNAexample.rds",
  package = "scPagwas"
))
Pagwas <- Single_data_input(
  Pagwas = Pagwas,
  assay = "RNA",
  Single_data = Single_data,
  Pathway_list = Genes_by_pathway_kegg
)
#> Input single cell data!
#> 10 cell types are remain, after filter!
Single_data <- Single_data[, colnames(Pagwas$data_mat)]
# Run pathway pca score!
Pagwas <- Pathway_pcascore_run(
  Pagwas = Pagwas,
  Pathway_list = Genes_by_pathway_kegg
)
#> * Start to get Pathway SVD socre!
#> 
  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |=======                                                               |  10%[1] "Celltype1"
#> 
  |                                                                            
  |==============                                                        |  20%[1] "Celltype2"
#> 
  |                                                                            
  |=====================                                                 |  30%[1] "Celltype3"
#> 
  |                                                                            
  |============================                                          |  40%[1] "Celltype4"
#> 
  |                                                                            
  |===================================                                   |  50%[1] "Celltype5"
#> 
  |                                                                            
  |==========================================                            |  60%[1] "Celltype6"
#> 
  |                                                                            
  |=================================================                     |  70%[1] "Celltype7"
#> 
  |                                                                            
  |========================================================              |  80%[1] "Celltype8"
#> 
  |                                                                            
  |===============================================================       |  90%[1] "Celltype9"
#> 
  |                                                                            
  |======================================================================| 100%[1] "Celltype10"
#> 
#> Using score as value column: use value.var to override.