├── .DS_Store ├── .Rbuildignore ├── .gitignore ├── DESCRIPTION ├── LICENSE ├── NAMESPACE ├── R ├── .DS_Store ├── AnnotatedDotPlot.R ├── CalculateExpFreqs.R ├── CreatePostIntegrationObject.R ├── DSDotPlot.R ├── ExportPiData.R ├── ExpressionPlot.R ├── MatrixPlot.R ├── Pi.R ├── ProportionPlot.R ├── RunAnnotatedDotPlot.R ├── RunDSDotPlot.R ├── RunDimPlot.R ├── RunExpressionPlot.R ├── RunFindAllMarkers.R ├── RunMatrixPlot.R ├── RunProportionPlot.R ├── RunPseudobulkAnalysis.R ├── RunSankeyPlot.R ├── RunStackedVlnPlot.R ├── RunSubclusterReprojection.R ├── RunSummarizedHeatmap.R ├── SankeyPlot.R ├── StackedVlnPlot.R ├── SummarizedHeatmap.R ├── data.R └── utils.R ├── README.md ├── Ragas.Rproj ├── data ├── .DS_Store ├── csle.bcell.pi.RData ├── csle.bcell.small.RData ├── csle.cd4.mem.pi.RData ├── csle.cd4.mem.small.RData ├── csle.pbmc.pi.RData ├── csle.pbmc.small.RData ├── csle.tcell.pi.RData ├── csle.tcell.small.RData ├── csle.treg.pi.RData └── csle.treg.small.RData ├── man ├── .DS_Store ├── AddPiData.Rd ├── AnnotatedDotPlot.Rd ├── CalculateExpFreqs.Rd ├── CheckPiData.Rd ├── ConfigureReprojection.Rd ├── CreatePostIntegrationObject.Rd ├── DSDotPlot.Rd ├── ExportPiData.Rd ├── ExpressionPlot.Rd ├── MatrixPlot.Rd ├── Pi.Rd ├── PiCellPropData.Rd ├── PiDSData.Rd ├── PiData.Rd ├── PiDataList.Rd ├── PiExpFreqData.Rd ├── PiMarkerData.Rd ├── PiParentMetaData.Rd ├── ProportionPlot.Rd ├── RunAnnotatedDotPlot.Rd ├── RunDSDotPlot.Rd ├── RunDimPlot.Rd ├── RunExpressionPlot.Rd ├── RunFindAllMarkers.Rd ├── RunMatrixPlot.Rd ├── RunProportionPlot.Rd ├── RunPseudobulkAnalysis.Rd ├── RunSankeyPlot.Rd ├── RunStackedVlnPlot.Rd ├── RunSummarizedHeatmap.Rd ├── SankeyPlot.Rd ├── StackedVlnPlot.Rd ├── SummarizedHeatmap.Rd ├── csle.bcell.pi.Rd ├── csle.bcell.small.Rd ├── csle.cd4.mem.pi.Rd ├── csle.cd4.mem.small.Rd ├── csle.pbmc.pi.Rd ├── csle.pbmc.small.Rd ├── csle.tcell.pi.Rd ├── csle.tcell.small.Rd ├── csle.treg.pi.Rd ├── csle.treg.small.Rd └── figs │ ├── .gitignore │ ├── Ragas.logo.png │ └── sc-parent-child.png └── vignettes ├── .gitignore ├── CrossCompatibilityExamples.Rmd ├── CrossCompatibilityExamples.html ├── CrossCompatibilityExamples.md ├── CrossCompatibilityExamples_files └── figure-gfm │ ├── unnamed-chunk-10-1.png │ ├── unnamed-chunk-11-1.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-15-1.png │ ├── unnamed-chunk-17-1.png │ ├── unnamed-chunk-19-1.png │ ├── unnamed-chunk-21-1.png │ ├── unnamed-chunk-23-1.png │ ├── unnamed-chunk-24-1.png │ ├── unnamed-chunk-26-1.png │ ├── unnamed-chunk-28-1.png │ ├── unnamed-chunk-4-1.png │ ├── unnamed-chunk-61-1.png │ ├── unnamed-chunk-64-1.png │ ├── unnamed-chunk-65-1.png │ ├── unnamed-chunk-67-1.png │ ├── unnamed-chunk-68-1.png │ ├── unnamed-chunk-7-1.png │ ├── unnamed-chunk-70-1.png │ ├── unnamed-chunk-72-1.png │ ├── unnamed-chunk-74-1.png │ ├── unnamed-chunk-76-1.png │ ├── unnamed-chunk-78-1.png │ ├── unnamed-chunk-8-1.png │ ├── unnamed-chunk-80-1.png │ ├── unnamed-chunk-81-1.png │ ├── unnamed-chunk-83-1.png │ └── unnamed-chunk-85-1.png ├── QuickStart.Rmd ├── QuickStart.html ├── QuickStart.md ├── QuickStart_files └── figure-gfm │ ├── unnamed-chunk-12-1.png │ ├── unnamed-chunk-13-1.png │ ├── unnamed-chunk-14-1.png │ ├── unnamed-chunk-15-1.png │ ├── unnamed-chunk-16-1.png │ ├── unnamed-chunk-17-1.png │ ├── unnamed-chunk-18-1.png │ ├── unnamed-chunk-19-1.png │ ├── unnamed-chunk-20-1.png │ ├── unnamed-chunk-21-1.png │ ├── unnamed-chunk-22-1.png │ ├── unnamed-chunk-23-1.png │ ├── unnamed-chunk-24-1.png │ ├── unnamed-chunk-4-1.png │ ├── unnamed-chunk-5-1.png │ └── unnamed-chunk-8-1.png ├── Ragas_jupyternotebook_demo.ipynb ├── ds └── pbmc.ds.csv ├── parent-child-example.png ├── reprojection.png ├── sc-parent-child.png ├── subcluster.Rmd ├── subcluster.html ├── subcluster.md └── subcluster_files └── figure-gfm ├── unnamed-chunk-1-1.png ├── unnamed-chunk-10-1.png ├── unnamed-chunk-11-1.png ├── unnamed-chunk-12-1.png ├── unnamed-chunk-13-1.png ├── unnamed-chunk-14-1.png ├── unnamed-chunk-15-1.png ├── unnamed-chunk-16-1.png ├── unnamed-chunk-18-1.png ├── unnamed-chunk-19-1.png ├── unnamed-chunk-2-1.png ├── unnamed-chunk-3-1.png ├── unnamed-chunk-4-1.png ├── unnamed-chunk-5-1.png ├── unnamed-chunk-6-1.png ├── unnamed-chunk-7-1.png └── unnamed-chunk-9-1.png /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/.DS_Store -------------------------------------------------------------------------------- /.Rbuildignore: -------------------------------------------------------------------------------- 1 | ^.*\.Rproj$ 2 | ^\.Rproj\.user$ 3 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .Rproj.user 2 | .Rhistory 3 | .RData 4 | .Ruserdata 5 | -------------------------------------------------------------------------------- /DESCRIPTION: -------------------------------------------------------------------------------- 1 | Package: Ragas 2 | Type: Package 3 | Title: R Advanced Gallery for Analysis of Single-cell Data 4 | Version: 0.1.0 5 | Authors@R: c( 6 | person(given = "Jinghua", family = "Gu", email = "jig4003@med.cornell.edu", role = c("aut", "cre")), 7 | person(given = "Uthra", family = "Balaji", email = "utb4001@med.cornell.edu", role = c("aut")), 8 | person(given = "Virginia", family = "Pascual", email = "vip2021@med.cornell.edu", role = "fnd")) 9 | Maintainer: Jinghua Gu 10 | Description: An R package for analysis and visualization of single-cell RNA-Seq data 11 | License: GPL3 12 | Depends: Seurat 13 | Imports: ggplot2, randomcoloR, SingleCellExperiment, Matrix, uwot, future, dplyr, reshape2, scales, ComplexHeatmap, grid, circlize, gplots, muscat, limma, ggtree, patchwork, ggprism, rstatix, cowplot, aplot, crayon, ggsankey 14 | Encoding: UTF-8 15 | LazyData: true 16 | RoxygenNote: 7.2.3 17 | -------------------------------------------------------------------------------- /NAMESPACE: -------------------------------------------------------------------------------- 1 | # Generated by roxygen2: do not edit by hand 2 | 3 | S3method("[[",Pi) 4 | S3method("[[",PiCellPropData) 5 | S3method("[[",PiDSData) 6 | S3method("[[",PiData) 7 | S3method("[[",PiDataList) 8 | S3method("[[",PiExpFreqData) 9 | S3method("[[",PiMarkerData) 10 | S3method("[[",PiParentMetaData) 11 | S3method("[[<-",Pi) 12 | S3method(AddPiData,Pi) 13 | S3method(AddPiData,PiData) 14 | S3method(AddPiData,PiDataList) 15 | S3method(AddPiData,default) 16 | S3method(CheckPiData,Pi) 17 | S3method(CheckPiData,PiCellPropData) 18 | S3method(CheckPiData,PiDSData) 19 | S3method(CheckPiData,PiDataList) 20 | S3method(CheckPiData,PiExpFreqData) 21 | S3method(CheckPiData,PiMarkerData) 22 | S3method(CheckPiData,PiParentMetaData) 23 | S3method(CheckPiData,default) 24 | S3method(print,Pi) 25 | S3method(print,PiCellPropData) 26 | S3method(print,PiDSData) 27 | S3method(print,PiData) 28 | S3method(print,PiDataList) 29 | S3method(print,PiExpFreqData) 30 | S3method(print,PiMarkerData) 31 | S3method(print,PiParentMetaData) 32 | export(AddPiData) 33 | export(CalculateExpFreqs) 34 | export(CheckPiData) 35 | export(ConfigureReprojection) 36 | export(CreatePostIntegrationObject) 37 | export(ExportPiData) 38 | export(Pi) 39 | export(PiCellPropData) 40 | export(PiDSData) 41 | export(PiData) 42 | export(PiDataList) 43 | export(PiExpFreqData) 44 | export(PiMarkerData) 45 | export(PiParentMetaData) 46 | export(RunAnnotatedDotPlot) 47 | export(RunDSDotPlot) 48 | export(RunDimPlot) 49 | export(RunExpressionPlot) 50 | export(RunFindAllMarkers) 51 | export(RunMatrixPlot) 52 | export(RunProportionPlot) 53 | export(RunPseudobulkAnalysis) 54 | export(RunSankeyPlot) 55 | export(RunStackedVlnPlot) 56 | export(RunSummarizedHeatmap) 57 | export(SankeyPlot) 58 | importFrom(ComplexHeatmap,Heatmap) 59 | importFrom(ComplexHeatmap,HeatmapAnnotation) 60 | importFrom(ComplexHeatmap,anno_text) 61 | importFrom(Matrix,rowSums) 62 | importFrom(SingleCellExperiment,colData) 63 | importFrom(SingleCellExperiment,counts) 64 | importFrom(aplot,xlim2) 65 | importFrom(circlize,colorRamp2) 66 | importFrom(cowplot,get_legend) 67 | importFrom(cowplot,plot_grid) 68 | importFrom(cowplot,theme_nothing) 69 | importFrom(crayon,blue) 70 | importFrom(crayon,bold) 71 | importFrom(crayon,cyan) 72 | importFrom(crayon,green) 73 | importFrom(crayon,magenta) 74 | importFrom(crayon,red) 75 | importFrom(crayon,yellow) 76 | importFrom(dplyr,"%>%") 77 | importFrom(dplyr,group_by) 78 | importFrom(dplyr,n) 79 | importFrom(dplyr,summarise) 80 | importFrom(dplyr,summarize) 81 | importFrom(future,nbrOfWorkers) 82 | importFrom(future,plan) 83 | importFrom(ggplot2,aes) 84 | importFrom(ggplot2,element_blank) 85 | importFrom(ggplot2,element_line) 86 | importFrom(ggplot2,element_rect) 87 | importFrom(ggplot2,element_text) 88 | importFrom(ggplot2,expansion) 89 | importFrom(ggplot2,facet_grid) 90 | importFrom(ggplot2,facet_wrap) 91 | importFrom(ggplot2,geom_bar) 92 | importFrom(ggplot2,geom_boxplot) 93 | importFrom(ggplot2,geom_errorbar) 94 | importFrom(ggplot2,geom_hline) 95 | importFrom(ggplot2,geom_jitter) 96 | importFrom(ggplot2,geom_point) 97 | importFrom(ggplot2,geom_tile) 98 | importFrom(ggplot2,geom_violin) 99 | importFrom(ggplot2,ggplot) 100 | importFrom(ggplot2,guide_legend) 101 | importFrom(ggplot2,guides) 102 | importFrom(ggplot2,labs) 103 | importFrom(ggplot2,position_dodge) 104 | importFrom(ggplot2,position_jitterdodge) 105 | importFrom(ggplot2,position_nudge) 106 | importFrom(ggplot2,scale_color_manual) 107 | importFrom(ggplot2,scale_fill_continuous) 108 | importFrom(ggplot2,scale_fill_gradient2) 109 | importFrom(ggplot2,scale_fill_manual) 110 | importFrom(ggplot2,scale_y_continuous) 111 | importFrom(ggplot2,scale_y_discrete) 112 | importFrom(ggplot2,theme) 113 | importFrom(ggplot2,vars) 114 | importFrom(ggprism,add_pvalue) 115 | importFrom(ggsankey,geom_sankey) 116 | importFrom(ggsankey,geom_sankey_text) 117 | importFrom(ggsankey,make_long) 118 | importFrom(ggsankey,theme_sankey) 119 | importFrom(ggtree,ggtree) 120 | importFrom(ggtree,layout_dendrogram) 121 | importFrom(gplots,colorpanel) 122 | importFrom(grid,gpar) 123 | importFrom(grid,unit) 124 | importFrom(limma,makeContrasts) 125 | importFrom(muscat,aggregateData) 126 | importFrom(muscat,pbDS) 127 | importFrom(muscat,prepSCE) 128 | importFrom(muscat,resDS) 129 | importFrom(patchwork,plot_layout) 130 | importFrom(patchwork,plot_spacer) 131 | importFrom(randomcoloR,distinctColorPalette) 132 | importFrom(reshape2,dcast) 133 | importFrom(reshape2,melt) 134 | importFrom(rstatix,add_significance) 135 | importFrom(rstatix,add_x_position) 136 | importFrom(rstatix,add_y_position) 137 | importFrom(rstatix,drop_na) 138 | importFrom(rstatix,group_by) 139 | importFrom(scales,hue_pal) 140 | importFrom(scales,squish) 141 | importFrom(uwot,umap) 142 | -------------------------------------------------------------------------------- /R/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/R/.DS_Store -------------------------------------------------------------------------------- /R/CalculateExpFreqs.R: -------------------------------------------------------------------------------- 1 | #' Calculate Expression Frequencies 2 | #' 3 | #' Calculate single-cell expression frequency for each gene per identity class. 4 | #' 5 | #' The function will return a list object, either directly as output or indirectly as part of the updated Pi object, with each list element 6 | #' being a data.frame to store the expression frequencies for all genes per \code{ident}. If \code{group.by} is NULL, the data.frame will have only one column called "AllCells" to store gene expression frequencies 7 | #' across all the cells for each identity; if \code{group.by} is set, additional columns storing gene expression frequencies in cells groups defined by \code{group.by} will be calculated and stored. 8 | #' 9 | #' @param object A Seurat or \code{\link[Ragas]{Pi}} object 10 | #' @param ident Name of the metadata column as cell identity (default: seurat_clusters) 11 | #' @param group.by Additional factor to group the cells by 12 | #' @param cutoff Log-expression cutoff (default: 0) 13 | #' @param verbose Verbosity (default: TRUE) 14 | #' 15 | #' @return When \code{object} is a Seurat object, a list containing expression frequencies per \code{ident} will be returned; 16 | #' If \code{object} is a Pi object, an updated Pi object will be returned: a \code{\link[Ragas]{PiExpFreqData}} object that encloses the list 17 | #' containing expression frequencies per \code{ident} will be created and added to the \code{exp.freq} field. 18 | #' 19 | #' @importFrom SingleCellExperiment counts 20 | #' @importFrom Matrix rowSums 21 | #' @examples 22 | #' \dontrun{ 23 | #' my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small) ## a minimum Pi object 24 | #' my.pi <- CalculateExpFreqs(my.pi) 25 | #' } 26 | #' @export 27 | 28 | CalculateExpFreqs <- function(object, 29 | ident = "seurat_clusters", 30 | group.by = NULL, 31 | cutoff = 0, 32 | verbose = TRUE 33 | ){ 34 | if(is(object, "Pi") || is(object, "Seurat")){ 35 | if(is(object, "Pi")){seurat.obj <- object$seurat.obj} 36 | if(is(object, "Seurat")){seurat.obj <- object} 37 | 38 | ## check input args 39 | if(!(ident %in% names(seurat.obj[[]]))){ 40 | stop("The ident argument ", ident," not found in the meta data") 41 | }else{ 42 | ident.dat <- seurat.obj[[ident, drop = TRUE]] 43 | if(!is.factor(ident.dat)){ident.dat <- as.factor(ident.dat)} 44 | ident.dat <- droplevels(x = ident.dat) 45 | } 46 | if(!is.null(group.by)){ 47 | if(!(group.by %in% names(seurat.obj[[]]))){ 48 | stop("The group.by argument ", group.by, " not found in the meta data") 49 | }else{ 50 | group.dat <- seurat.obj[[group.by, drop = TRUE]] 51 | if(!is.factor(group.dat)){group.dat <- as.factor(group.dat)} 52 | if(length(levels(group.dat)) < 2){stop("The group.by argument should at least have 2 levels. Otherwise set is to NULL")} 53 | group.dat <- droplevels(x = group.dat) 54 | } 55 | } 56 | 57 | ## retrieve counts and calculate cell frequencies 58 | sce <- as.SingleCellExperiment(seurat.obj) 59 | dat <- counts(sce) 60 | 61 | ident.levels <- levels(ident.dat) 62 | group.levels <- NULL 63 | if(!is.null(group.by)){ 64 | group.levels <- levels(group.dat) 65 | n.group <- length(group.levels) + 1 66 | }else{ 67 | n.group <- 1 68 | } 69 | 70 | exp.freq <- list() 71 | for(i in 1:length(ident.levels)) 72 | { 73 | if(verbose){message("Calculating expression frequencies for ",ident, ": ", ident.levels[i], appendLF = TRUE)} 74 | exp.freq.i <- matrix(0, dim(dat)[1], n.group) 75 | colnames(exp.freq.i) <- c('AllCells',group.levels) 76 | rownames(exp.freq.i) <- rownames(dat) 77 | 78 | dat.sub <- dat[, which(ident.dat == ident.levels[i]), drop = FALSE] 79 | exp.freq.i[,'AllCells'] <- rowSums(dat.sub > cutoff) / dim(dat.sub)[2] 80 | 81 | if(!is.null(group.by)){ 82 | group.dat.sub <- group.dat[which(ident.dat == ident.levels[i])] 83 | for(j in 1:length(group.levels)){ 84 | idx <- which(group.dat.sub == group.levels[j]) 85 | if(length(idx) > 0){ 86 | dat.sub1 <- dat.sub[, idx, drop = FALSE] 87 | exp.freq.i[,group.levels[j]] <- rowSums(dat.sub1 > cutoff) / dim(dat.sub1)[2] 88 | }else{ 89 | exp.freq.i[,group.levels[j]] <- 0 90 | } 91 | } 92 | } 93 | 94 | exp.freq[[i]] <- exp.freq.i 95 | } 96 | names(exp.freq) <- ident.levels 97 | 98 | if(verbose){message("Done!")} 99 | if(is(object, "Pi")){ 100 | ef <- PiExpFreqData(data = exp.freq, 101 | ident = ident, 102 | group = group.by, 103 | cutoff = cutoff) 104 | CheckPiData(ef, seurat.obj = object$seurat.obj) 105 | object <- AddPiData(object, ef) 106 | return(object) 107 | }else{ 108 | return(exp.freq) 109 | } 110 | 111 | }else{ 112 | stop("Invalid input object. Either Seurat or Pi object is required.") 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /R/ExportPiData.R: -------------------------------------------------------------------------------- 1 | #' Export Pi Data 2 | #' 3 | #' Function to export data from \code{\link[Ragas]{Pi}} object 4 | #' 5 | #' This function takes in a Pi object, field and key parameters to export data 6 | #' 7 | #' @param object A \code{\link[Ragas]{Pi}} object 8 | #' @param field Name of pi object component to be exported 9 | #' @param key A unique identifier to retrieve data from the \code{field} parameter 10 | #' @param ds.export.cpm Option to export CPM data. Default: FALSE 11 | #' @param ds.export.freq Option to export frequency data. Default: FALSE 12 | #' @param export.path path to the directory where data should be exported. Default to current working directory 13 | #' @examples 14 | #' \dontrun{ 15 | #' ExportPiData(object = csle.pbmc.pi, 16 | #' field = 'exp.freq', 17 | #' key = 'ExpFreq|subcluster_idents|cutoff=0' 18 | #' ) 19 | #' 20 | #' } 21 | #' @export 22 | #' 23 | ExportPiData <- function(object, field = NULL, key = NULL, file.prefix = NULL, ds.export.cpm = FALSE, ds.export.freq = FALSE, export.path = NULL) 24 | { 25 | if(!(is(object, "Pi"))){stop("Invalid input argument \"object\". Pi object is required.")} 26 | if(is.null(file.prefix)){stop('The argument file.prefix must be provided. It is recommended to use informative prefix such as \'pbmc.ds\'.')} 27 | if(is.null(export.path)) 28 | { 29 | export.path <- getwd() 30 | } 31 | if(!(dir.exists(export.path))) 32 | { 33 | dir.create(export.path) 34 | } 35 | 36 | if(is.null(field)) 37 | { 38 | stop("field cannot be NULL. The following field(s) are available:\n ", paste(c("exp.freq","markers","ds"), collapse = "\n ")) 39 | }else if(field == 'exp.freq') 40 | { 41 | if(length(object$exp.freq) == 0) 42 | { 43 | stop("The \"exp.freq\" field of the Pi object is empty. Run CalculateExpFreqs on the Pi object first.") 44 | }else 45 | { 46 | if(is.null(key)) 47 | { 48 | stop("key cannot be NULL. The following key(s) are available:\n ", paste(names(object$exp.freq), collapse = "\n "),"\nEither choose an availble key or rerun CalculateExpFreqs.") 49 | }else if(!key %in% names(object$exp.freq)){ 50 | stop("Invalid key \"",key, "\" for the exp.freq object. The following key(s) are available:\n ", paste(names(object$exp.freq), collapse = "\n "),"\nEither choose an availble key or rerun CalculateExpFreqs.") 51 | }else 52 | { 53 | export.data <- object$exp.freq[[key]][["data"]] 54 | names(export.data) <- gsub('/','_',names(export.data)) 55 | 56 | dirName <- file.path(export.path,'exp.freq') 57 | dir.create(path = dirName) 58 | my.write.fun <- function(x,y) 59 | { 60 | fileName <- paste(file.prefix, '_', y,'.csv',sep = '') 61 | write.csv(x, file = file.path(dirName,fileName),row.names = TRUE) 62 | } 63 | invisible(mapply(my.write.fun, export.data, names(export.data) )) 64 | } 65 | } 66 | }else if(field == 'markers') 67 | { 68 | if(length(object$markers) == 0) 69 | { 70 | stop("The \"markers\" field of the Pi object is empty. Run RunFindAllMarkers on the Pi object first.") 71 | }else 72 | { 73 | if(is.null(key)) 74 | { 75 | stop("key cannot be NULL. The following key(s) are available:\n ", paste(names(object$markers), collapse = "\n "),"\nEither choose an availble key or rerun RunFindAllMarkers.") 76 | }else if(!key %in% names(object$markers)){ 77 | stop("Invalid key \"",key, "\" for the markers object. The following key(s) are available:\n ", paste(names(object$markers), collapse = "\n "),"\nEither choose an availble key or rerun RunFindAllMarkers.") 78 | }else 79 | { 80 | export.data <- object$markers[[key]][["data"]] 81 | fileName <- paste(file.prefix, '.csv',sep = '') 82 | 83 | dirName <- file.path(export.path,'markers') 84 | dir.create(path = dirName) 85 | 86 | write.csv(export.data, file = file.path(dirName,fileName),row.names = TRUE) 87 | } 88 | } 89 | }else if(field == 'ds') 90 | { 91 | if(length(object$ds) == 0) 92 | { 93 | stop("The \"ds\" field of the Pi object is empty. Run RunPseudobulkAnalysis on the Pi object first.") 94 | }else 95 | { 96 | if(is.null(key)) 97 | { 98 | stop("key cannot be NULL. The following key(s) are available:\n ", paste(names(object$ds), collapse = "\n "),"\nEither choose an availble key or rerun RunPseudobulkAnalysis") 99 | }else if(!key %in% names(object$ds)){ 100 | stop("Invalid key \"",key, "\" for the ds object. The following key(s) are available:\n ", paste(names(object$ds), collapse = "\n "),"\nEither choose an availble key or rerun RunPseudobulkAnalysis") 101 | }else 102 | { 103 | export.data <- object$ds[[key]][["data"]]$tbl 104 | fileName <- paste(file.prefix, '.csv',sep = '') 105 | 106 | dirName <- file.path(export.path,'ds') 107 | dir.create(path = dirName) 108 | 109 | if(isTRUE(ds.export.cpm) & isTRUE(ds.export.freq)) 110 | { 111 | write.csv(export.data, file = file.path(dirName,fileName),row.names = FALSE) 112 | }else if(isTRUE(ds.export.cpm) & isFALSE(ds.export.freq)) 113 | { 114 | idx <- grep('frq',colnames(export.data)) 115 | export.data <- export.data[,-idx] 116 | write.csv(export.data, file = file.path(dirName,fileName),row.names = FALSE) 117 | }else if(isFALSE(ds.export.cpm) & isTRUE(ds.export.freq)) 118 | { 119 | idx <- grep('cpm',colnames(export.data)) 120 | export.data <- export.data[,-idx] 121 | write.csv(export.data, file = file.path(dirName,fileName),row.names = FALSE) 122 | }else if(isFALSE(ds.export.cpm) & isFALSE(ds.export.freq)) 123 | { 124 | idx <- c(grep('cpm',colnames(export.data)), grep('frq',colnames(export.data))) 125 | export.data <- export.data[,-idx] 126 | write.csv(export.data, file = file.path(dirName,fileName),row.names = FALSE) 127 | } 128 | } 129 | } 130 | }else if(field == 'cell.prop') 131 | { 132 | if(length(object$cell.prop) == 0) 133 | { 134 | stop("The \"cell.prop\" field of the Pi object is empty. Run RunProportionPlot on the Pi object first.") 135 | }else 136 | { 137 | if(is.null(key)) 138 | { 139 | stop("key cannot be NULL. The following key(s) are available:\n ", paste(names(object$cell.prop), collapse = "\n "),"\nEither choose an availble key or rerun RunProportionPlot.") 140 | }else if(!key %in% names(object$cell.prop)){ 141 | stop("Invalid key \"",key, "\" for the cell.prop object. The following key(s) are available:\n ", paste(names(object$cell.prop), collapse = "\n "),"\nEither choose an availble key or rerun RunProportionPlot") 142 | }else 143 | { 144 | # export data 145 | export.data <- object$cell.prop[[key]]$data$data 146 | 147 | fileName <- paste(file.prefix, '.data.csv',sep = '') 148 | 149 | dirName <- file.path(export.path,'cell.prop') 150 | dir.create(path = dirName) 151 | 152 | write.csv(export.data, file = file.path(dirName,fileName),row.names = FALSE) 153 | 154 | # export stats (if applicable) 155 | export.stats <- object$cell.prop[[key]]$data$stats 156 | if(!is.null(export.stats)) 157 | { 158 | fileName <- paste(file.prefix, '.stats.csv',sep = '') 159 | write.csv(export.stats, file = file.path(dirName,fileName),row.names = FALSE) 160 | } 161 | } 162 | } 163 | }else 164 | { 165 | stop("Invalid field \"",field, "\". The following field(s) are available:\n ", paste(c("exp.freq","markers","ds"), collapse = "\n ")) 166 | } 167 | 168 | } 169 | -------------------------------------------------------------------------------- /R/RunAnnotatedDotPlot.R: -------------------------------------------------------------------------------- 1 | #' Run Annotated DotPlot for Seurat or post-integration (Pi) object 2 | #' 3 | #' A wrapper function for \code{\link[Ragas]{AnnotatedDotPlot}} 4 | #' 5 | #' 6 | #' @param object A Seurat or \code{\link[Ragas]{Pi}} object 7 | #' @param group.by A factor that contains identity information to group the cells by (default: seurat_clusters) 8 | #' @param assay Name of the assay to use (default: the active assay as indicated by \code{\link[Seurat]{DefaultAssay}}) 9 | #' @param annotations User defined annotations in one of the following two formats: 10 | #' \itemize{ 11 | #' \item{list} : a named list object. Each list element is a character vector of a group of features; the name of the list element will be extracted to represent the feature group 12 | #' \item{data.frame} : a data.frame with two columns: "features" and "annotation" 13 | #' } 14 | #' @param annotation.cols Colors for feature annotations. Needs to be a character vector (preferably a named vector with its names matching the "annotations" argument. See example below) of the same length as annotation feature groups; will be automatically assigned with random colors if set to NULL 15 | #' @param features a list of features/genes to plot without annotations. Will be ignored if argument annotations is set 16 | #' @param cols Colors to plot. Same as the "cols" argument of \code{\link[Seurat]{DotPlot}} (default: c("lightgrey", "blue")) 17 | #' @param split.by Factor to split the groups by. Same as the "split.by" argument of \code{\link[Seurat]{DotPlot}} 18 | #' @param clust.row Whether to cluster the rows/identities (default: TRUE) 19 | #' @param clust.column Whether to cluster the columns/features (default: FALSE) 20 | #' @param column.fontsize Size of column text (default: 12) 21 | #' @param row.fontsize Size of row text (default: 12) 22 | #' @param legend.label.fontsize Size of the legend labels (default: 13) 23 | #' @param legend.title.fontsize Size of the legend title (default: 15) 24 | #' @param random.col.seed Set seed to control colors 25 | #' @param ... Extra parameters passed to DotPlot 26 | #' 27 | #' @return A \code{\link[ggplot2]{ggplot}} object 28 | #' 29 | #' @references Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 30 | #' 31 | #' @examples 32 | #' \dontrun{ 33 | #' my.list <- list(Monocytes = c("CD14","FCGR3A"), 34 | #' B = "MS4A1", 35 | #' T = c("CCR7", "CD8A"), 36 | #' NK = "NKG7") 37 | #' RunAnnotatedDotPlot(object = csle.pbmc.pi, 38 | #' annotation.cols = c( 'Monocytes'= 'tomato', 'B' = 'seagreen', 'T' = 'steelblue', 'NK' = 'purple'), 39 | #' annotations = my.list) 40 | #' } 41 | #' 42 | #' @export 43 | 44 | RunAnnotatedDotPlot <- function(object, 45 | assay = NULL, 46 | group.by = "seurat_clusters", 47 | annotations = NULL, 48 | annotation.cols = NULL, 49 | features = NULL, 50 | cols = c("lightgrey", "blue"), 51 | split.by = NULL, 52 | clust.row = TRUE, 53 | clust.column = FALSE, 54 | column.fontsize = 12, 55 | row.fontsize = 12, 56 | legend.label.fontsize=13, 57 | legend.title.fontsize=15, 58 | random.col.seed = 42, 59 | ... 60 | ){ 61 | if(!(is(object, "Pi") || is(object, "Seurat"))){stop("Invalid input argument \"object\". Either Seurat or Pi object is required.")} 62 | if(is(object, "Pi")){seurat.obj <- object$seurat.obj} 63 | if(is(object, "Seurat")){seurat.obj <- object} 64 | 65 | if(is.null(assay)){ 66 | assay <- DefaultAssay(seurat.obj) 67 | } 68 | 69 | ## check input args 70 | if(!(group.by %in% names(seurat.obj[[]]))){stop("argument \"group.by\" not found in the meta data")} 71 | 72 | if(is.null(annotations) && is.null(features)){stop("Arguments \"annotations\" and \"features\" are both NULL. One of them has to be set.")} 73 | 74 | if (!is.null(annotations)){ 75 | if(is.list(annotations) & !is.data.frame(annotations)){ 76 | if(is.null(names(annotations))){stop("Invalid annotations in list format: a named list is required.")} 77 | column.annotation <- stack(annotations) 78 | colnames(column.annotation) <- c("features", "annotation") 79 | }else if(is.data.frame(annotations)){ 80 | if(!identical(colnames(annotations), c("features", "annotation"))){stop("Invalid column names for annotation: must be have two columns named \"features\" and \"annotation\".")} 81 | column.annotation <- annotations 82 | }else{stop("Argument \"annotation\" must be a named list or data.frame.")} 83 | column.annotation$features <- as.character(column.annotation$features) 84 | column.annotation$annotation <- as.character(column.annotation$annotation) 85 | 86 | 87 | if(length(which(nchar(column.annotation$annotation) == 0)) > 0){print(column.annotation); stop("Name of annotation cannot be empty character.")} 88 | # print(column.annotation) 89 | 90 | feature_exist <- column.annotation$features %in% rownames(seurat.obj) 91 | if(length(feature_exist) == length(which(feature_exist == FALSE))){ 92 | stop("None of the features provided in the \"annotation\" argument exist in the Seurat object.") 93 | }else{ 94 | if(length(which(feature_exist == FALSE)) > 0){ 95 | warning("Warning: the following feature(s) ", paste(column.annotation$features[!feature_exist], collapse = ", "), " do(es) not exist in the Seurat object.") 96 | } 97 | } 98 | 99 | ## assign annotation color 100 | if(is.null(annotation.cols)){ 101 | set.seed(random.col.seed) 102 | annotation.cols <- distinctColorPalette(length(unique(column.annotation$annotation))) 103 | }else{ 104 | if(length(annotation.cols) != length(unique(column.annotation$annotation))){ 105 | stop("The length of user provided \"annotation.cols\" does not match the number of feature-annotation groups") 106 | } 107 | if(!is.null(names(annotation.cols))){ 108 | if(!all(names(annotation.cols) %in% unique(column.annotation$annotation))){ 109 | stop("Names of \"annotation.cols\" do not match \"annotations\"!") 110 | } 111 | 112 | } 113 | } 114 | 115 | features = column.annotation$features 116 | }else{ 117 | names(features) <- NULL 118 | feature_exist <- features %in% rownames(seurat.obj) 119 | if(length(feature_exist) == length(which(feature_exist == FALSE))){ 120 | stop("None of the features provided in the \"features\" argument exist in the Seurat object.") 121 | }else{ 122 | if(length(which(feature_exist == FALSE)) > 0){ 123 | warning("Warning: the following feature(s) ", paste(features[!feature_exist], collapse = ", "), " do(es) not exist in the Seurat object.") 124 | } 125 | } 126 | column.annotation <- NULL 127 | } 128 | 129 | 130 | p <- AnnotatedDotPlot(object = seurat.obj, 131 | features = features, 132 | assay = assay, 133 | split.by = split.by, 134 | group.by = group.by, 135 | clust.row = clust.row, 136 | clust.column = clust.column, 137 | cols = cols, 138 | column.annotation = column.annotation, 139 | column.annotation.cols = annotation.cols, 140 | column.fontsize = column.fontsize, 141 | row.fontsize = row.fontsize, 142 | legend.label.fontsize = legend.label.fontsize, 143 | legend.title.fontsize = legend.title.fontsize, 144 | ...) 145 | return(p) 146 | } 147 | -------------------------------------------------------------------------------- /R/RunDSDotPlot.R: -------------------------------------------------------------------------------- 1 | #' Run DSDotPlot 2 | #' 3 | #' A wrapper function for \code{\link[Ragas]{DSDotPlot}} 4 | #' 5 | #' The input Pi object must have analyzed results in the \code{ds} and \code{exp.freq} fields, which can be accomplished by running \code{\link[Ragas]{RunPseudobulkAnalysis}} 6 | #' and \code{\link[Ragas]{CalculateExpFreqs}}, respectively. 7 | #' 8 | #' Gene filtering will be performed based on significance (i.e., \code{p.filter} and \code{FC.filter}) and expression frequency (\code{exp.freq.filter}). 9 | #' The purpose of significance filtering is twofold: (1) only features that passed the filtering criteria in at least one of the identity groups (e.g., cell clusters, 10 | #' in most cases) will be included in the plot; (2) significant features that passed the filtering criteria will be highlighted on their corresponding clusters. 11 | #' The \code{FC.filter} argument expects un-logged fold-change and a \code{FC.filter} of 2 can mean a two-fold expression change for both up or down-regulation. 12 | #' If \code{top.n} is set to a number other than Inf, only the top genes will be plotted. 13 | #' 14 | #' If the argument \code{features} is set, all valid features (i.e., exist in the Seurat object) will be plotted in the figure regardless of their significance. However, only features 15 | #' passed the filtering criteria will be highlighted. 16 | #' 17 | #' @param object A \code{\link[Ragas]{Pi}} object 18 | #' @param features A list of features/genes to plot 19 | #' @param exp.freq.key A unique identifier to retrieve data from the \code{exp.freq} object. See \code{\link[Ragas]{CalculateExpFreqs}} for more details 20 | #' @param ds.key A unique identifier to retrieve data from the \code{ds} object. See \code{\link[Ragas]{RunPseudobulkAnalysis}} for more details 21 | #' @param p.filter P-Value cutoff for gene filtering (default: 0.05) 22 | #' @param FC.filter Fold change cutoff for gene filtering (default: 2) 23 | #' @param exp.freq.filter Gene expression frequency filtering cutoff (default: 0.1) 24 | #' @param filter.by.median.diff Whether to perform additional filtering based on median CPM differences between groups. This will remove differential genes due to outliers. 25 | #' @param median.diff.filter Median difference filtering cutoff (default: 0) 26 | #' @param to.adjust Whether to perform adjustment for multiple testing (default: FALSE) 27 | #' @param top.n Number of top genes to plot (default: Inf, i.e., all genes passing filtering criteria will be plotted) 28 | #' @param direction Whether to plot "up" or "down" regulated genes, or "both" (default: "both") 29 | #' @param to.highlight Whether to highlight feature/identity pairs that passed the filtering criteria (default: TRUE) 30 | #' @param clust.row Whether to cluster rows (default: TRUE) 31 | #' @param clust.column Whether to cluster columns (default: FALSE) 32 | #' @param verbose Verbosity (default: TRUE) 33 | #' @param ... Extra parameters passed to \code{\link[Ragas]{DSDotPlot}} to change plot font and color, etc. 34 | #' 35 | #' @return A \code{\link[ggplot2]{ggplot}} object 36 | #' 37 | #' @references Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 38 | #' 39 | #' @examples 40 | #' \dontrun{ 41 | #' RunDSDotPlot(object = csle.bcell.pi, 42 | #' exp.freq.key = "ExpFreq|cluster.annotation|cutoff=0", 43 | #' ds.key = "DS|cluster.annotation|edgeR|group=Groups;sample=Names;gp1=cSLE;gp2=cHD;contrast=cSLE-cHD", 44 | #' p.filter = 0.05) 45 | #' 46 | #' } 47 | #' @export 48 | #' 49 | RunDSDotPlot <- function(object, 50 | features = NULL, 51 | exp.freq.key, 52 | ds.key, 53 | p.filter = 0.05, 54 | FC.filter = 2, 55 | exp.freq.filter = 0.1, 56 | filter.by.median.diff = TRUE, 57 | median.diff.filter = 0, 58 | to.adjust = FALSE, 59 | top.n = Inf, 60 | direction = "both", 61 | to.highlight = TRUE, 62 | clust.row = TRUE, 63 | clust.column = FALSE, 64 | verbose = TRUE, 65 | ... 66 | ){ 67 | if(!is(object, "Pi")){ 68 | if(is(object, "Seurat")){ 69 | message("RunDEDotPlot requires Pi object as input, but Seurat object is provided. Run \"CreatePostIntegrationObject\" first.") 70 | }else{ 71 | stop("Invalid input argument: object. Post-integration object is required.") 72 | } 73 | } 74 | 75 | object <- unclass(object) 76 | 77 | ## Check and load exp.freq 78 | if(length(object$exp.freq) == 0){ 79 | stop("The \"exp.freq\" field of the Pi object is empty. Run CalculateExpFreqs on the Pi object first.") 80 | }else{ 81 | if(!exp.freq.key %in% names(object$exp.freq)){ 82 | stop("Invalid key \"",exp.freq.key, "\" for the exp.freq object. The following key(s) are available:\n ", paste(names(object$exp.freq), collapse = "\n "),"\nEither choose an availble key or rerun CalculateExpFreqs.") 83 | }else{ 84 | exp.freq <- object$exp.freq[[exp.freq.key]][["data"]] 85 | } 86 | } 87 | 88 | ## Check and load pseudobulk analysis results 89 | if(length(object$ds) == 0){ 90 | stop("The \"ds\" field of the Pi object is empty. Run RunPseudobulkAnalysis on the Pi object first.") 91 | }else{ 92 | if(!ds.key %in% names(object$ds)){ 93 | stop("Invalid key \"",ds.key ,"\" for the ds object. The following key(s) are available:\n ", paste(names(object$ds), collapse = "\n "),"\nEither choose an availble key or rerun RunPseudobulkAnalysis") 94 | }else{ 95 | res <- object$ds[[ds.key]][["data"]]$res$table[[1]] 96 | } 97 | } 98 | if(!(length(names(res)) == length(names(exp.freq)))){ 99 | cat("Idents from the exp.freq object: ",names(exp.freq),"\n") 100 | cat("Idents from the ds object: ",names(res),"\n") 101 | stop("Identity names of the exp.freq and ds objects do not match") 102 | }else{ 103 | if(!all(names(res) == names(exp.freq))){ 104 | cat("Idents from the exp.freq object: ",names(exp.freq),"\n") 105 | cat("Idents from the ds object: ",names(res),"\n") 106 | stop("Identity names of the exp.freq and ds objects do not match") 107 | } 108 | } 109 | 110 | ## Check features 111 | if(!is.null(features)){ 112 | if(length(features) != length(unique(features))){ 113 | features <- unique(features) 114 | if(verbose){message("The features provided are not unique. Taking unique.")} 115 | } 116 | features.valid <- intersect(features, rownames(object$seurat.obj)) 117 | features.invalid <- setdiff(features, features.valid) 118 | if(length(features.invalid) > 0){ 119 | message("The following feature(s): ", paste(features.invalid, collapse = ", "), " not found in the Pi object") 120 | } 121 | if(length(features.valid) == 0){ 122 | stop("None of the provided features are found in the Pi object") 123 | } 124 | } 125 | 126 | ## Check direction 127 | if(!direction %in% c("up", "down", "both")){stop("The \"direction argument\" must be one of the following: up, down, or both!")} 128 | 129 | ## Additional filtering when applicable 130 | if(filter.by.median.diff){ 131 | cpm.dat <- object$ds[[ds.key]][["data"]]$tbl 132 | group.col.name <- object$ds[[ds.key]]$param$group 133 | sample.col.name <- object$ds[[ds.key]]$param$sample 134 | case.group <- object$ds[[ds.key]]$param$gp1 135 | ref.group <- object$ds[[ds.key]]$param$gp2 136 | }else{ 137 | cpm.dat <- NULL 138 | } 139 | 140 | p <- DSDotPlot(object = object$seurat.obj, 141 | res = res, 142 | exp.freq = exp.freq, 143 | features = features, 144 | p.threshold = p.filter, 145 | FC.threshold = FC.filter, 146 | pct.threshold = exp.freq.filter, 147 | n.deg = top.n, 148 | p.adj.filter = to.adjust, 149 | highlight.deg = to.highlight, 150 | direction = direction, 151 | clust.row = clust.row, 152 | clust.column = clust.column, 153 | cpm.dat = cpm.dat, 154 | exp.filter = filter.by.median.diff, 155 | exp.filter.thr = median.diff.filter, 156 | group.col.name = group.col.name, 157 | sample.col.name = sample.col.name, 158 | case.group = case.group, 159 | ref.group = ref.group, 160 | ...) 161 | return(suppressWarnings(print(p))) 162 | # return(p) 163 | } 164 | -------------------------------------------------------------------------------- /R/RunDimPlot.R: -------------------------------------------------------------------------------- 1 | #' Run DimPlot 2 | #' 3 | #' Run DimPlot for Seurat or post-integration (Pi) object 4 | #' 5 | #' Wrapper functiuon for \code{\link[Seurat]{DimPlot}} that is enhanced to: (1) uses \code{\link[randomcoloR]{distinctColorPalette}} to generate random colors; 6 | #' (2) allows adjustment of overlap among identity labels. By default, column \code{seurat_clusters} from the metadata 7 | #' will be by assigned as \code{group.by}. 8 | #' 9 | #' @param object A Seurat or \code{\link[Ragas]{Pi}} object 10 | #' @param group.by Name of the metadata column to group (color) cells by (default: seurat_clusters) 11 | #' @param reduction Which dimension reduction to use (default: umap) 12 | #' @param label Whether to show the label of clusters (default: TRUE) 13 | #' @param repel Whether to repel labels (default: TRUE) 14 | #' @param pt.size Plot point size (default: 0.1) 15 | #' @param label.size Label size (default: 3) 16 | #' @param random.col.seed Set seed to control colors 17 | #' @param cols User-defined colors. When cols is set, random.col.seed will be ignored 18 | #' @param ggrepel.max.overlaps Adjust overlap for ggrepel (default: Inf) 19 | #' @param ... Extra parameters passed to DimPlot 20 | #' 21 | #' @importFrom randomcoloR distinctColorPalette 22 | #' @importFrom ggplot2 scale_color_manual 23 | #' 24 | #' @references Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 25 | #' @references H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016. 26 | #' @references Ron Ammar (2019). randomcoloR: Generate Attractive Random Colors. R package version 1.1.0.1.https://CRAN.R-project.org/package=randomcoloR 27 | #' @return A \code{\link[ggplot2]{ggplot}} object 28 | #' @examples 29 | #' \dontrun{ 30 | #' ## default, use "seurat_clusters" to group cells 31 | #' RunDimPlot(object = csle.pbmc.pi) 32 | #' 33 | #' ## use subcluster identities and re-projected UMAP 34 | #' RunDimPlot(object = csle.pbmc.pi, group.by = "subcluster_idents", reduction = "rp", label.size = 5, pt.size = 1) 35 | #' } 36 | #' @export 37 | 38 | RunDimPlot <- function(object, 39 | group.by = "seurat_clusters", 40 | reduction = "umap", 41 | label = TRUE, 42 | repel = TRUE, 43 | pt.size = .1, 44 | label.size = 3, 45 | random.col.seed = 42, 46 | cols = NULL, 47 | ggrepel.max.overlaps = Inf, 48 | ...){ 49 | if(!(is(object, "Pi") || is(object, "Seurat"))){stop("Invalid input argument \"object\". Either Seurat or Pi object is required.")} 50 | if(is(object, "Pi")){seurat.obj <- object$seurat.obj} 51 | if(is(object, "Seurat")){seurat.obj <- object} 52 | 53 | ## manipulate grouping variable 54 | if(length(group.by) > 1){stop("Invalid \"group.by\" argument: more than 1 metadata column provided. Only supports 1 metadata column.")} 55 | if(group.by == "seurat_clusters" & !group.by %in% names(seurat.obj[[]])){stop("Cannot find \"seurat_clusters\" (default value for argument \"group.by\") in the metadata. Consider changing value for \"group.by\".")} 56 | if(!group.by %in% names(seurat.obj[[]])){stop("Invalid argument \"group.by\": ", group.by)} 57 | group.dat <- seurat.obj[[group.by, drop = TRUE]] 58 | if(!is.factor(group.dat)){group.dat <- as.factor(group.dat)} 59 | group.dat <- droplevels(x = group.dat) 60 | 61 | 62 | if(is.null(cols)){ 63 | set.seed(random.col.seed) 64 | cols <- distinctColorPalette(length(levels(group.dat))) 65 | names(cols) <- levels(group.dat) 66 | } 67 | 68 | 69 | p <- DimPlot(object = seurat.obj, reduction = reduction, group.by = group.by, pt.size = pt.size,repel = repel, ...) + 70 | scale_color_manual(values = cols) 71 | if(label){ 72 | options(ggrepel.max.overlaps = ggrepel.max.overlaps) 73 | p <- LabelClusters(plot = p, id = group.by, size = label.size) 74 | } 75 | 76 | return(p) 77 | 78 | } 79 | -------------------------------------------------------------------------------- /R/RunFindAllMarkers.R: -------------------------------------------------------------------------------- 1 | #' Run FindAllMarkers from Seurat 2 | #' 3 | #' This is a wrapper function to run \code{\link[Seurat]{FindAllMarkers}} function on Seurat or Pi object 4 | #' 5 | #' @param object A Seurat or \code{\link[Ragas]{Pi}} object 6 | #' @param ident Name of the metadata column used as cell identity (default: seurat_clusters) 7 | #' @param test.use Which test to use. See details in \code{\link[Seurat]{FindAllMarkers}} (default: wilcox) 8 | #' @param latent.vars Latent variables to test. See details in \code{\link[Seurat]{FindAllMarkers}} 9 | #' @param future.strategy Parallelization strategies. See \code{\link[future]{plan}} for more details (default: "multisession) 10 | #' @param future.workers Number of parallelizations (default: 1) 11 | #' @param future.globals.maxSize.MB Maximum allowed total size (in Megabyte) of global variables. See \code{\link[future]{future.options}} (default: 1000) 12 | #' @param ... Additional parameters passed to \code{\link[Seurat]{FindAllMarkers}} 13 | #' 14 | #' @return If \code{object} is a Seurat object, a matrix containing markers and their associated statistics will be returned 15 | #' (see \code{\link[Seurat]{FindMarkers}} for more details); If \code{object} is a Pi object, a \code{\link[Ragas]{PiMarkerData}} object containing 16 | #' the marker result matrix will be created and attached to the \code{markers} field. 17 | #' 18 | #' @references Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 19 | #' 20 | #' @importFrom future plan 21 | #' @export 22 | #' 23 | #' @examples 24 | #' \dontrun{ 25 | #' my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small) ## a minimum Pi object 26 | #' my.pi <- RunFindAllMarkers(object = my.pi) 27 | #' } 28 | #' 29 | RunFindAllMarkers <- function(object, 30 | ident = "seurat_clusters", 31 | test.use = "wilcox", 32 | latent.vars = NULL, 33 | future.strategy = "multisession", 34 | future.workers = 1, 35 | future.globals.maxSize.MB = 1000, 36 | ...){ 37 | if(is(object, "Pi") || is(object, "Seurat")){ 38 | if(is(object, "Pi")){seurat.obj <- object$seurat.obj} 39 | if(is(object, "Seurat")){seurat.obj <- object} 40 | 41 | run.type <- "AllMarkers" 42 | 43 | if(!ident %in% names(seurat.obj[[]])){ 44 | stop("\"ident\" not found in the meta data") 45 | }else{ 46 | Idents(seurat.obj) <- ident 47 | } 48 | 49 | if(future.workers > 1){ 50 | message("Running multiple workers...") 51 | options(future.globals.maxSize = future.globals.maxSize.MB * 10^6) 52 | plan(future.strategy, workers = future.workers) 53 | plan() 54 | } 55 | markers <- FindAllMarkers(seurat.obj, test.use = test.use, latent.vars = latent.vars, ...) 56 | ## need to implement DeFindAllMarkers 57 | 58 | plan("default") 59 | 60 | if(is(object, "Pi")){ 61 | mk <- PiMarkerData(data = markers, 62 | ident = ident, 63 | method = run.type, 64 | test.use = test.use, 65 | latent.vars = latent.vars) 66 | CheckPiData(mk, seurat.obj = object$seurat.obj) 67 | 68 | object <- AddPiData(object, mk) 69 | return(object) 70 | } 71 | if(is(object, "Seurat")){return(markers)} 72 | }else{ 73 | stop('Invalid input object. Either Seurat or Pi object is required.') 74 | } 75 | } 76 | -------------------------------------------------------------------------------- /R/RunMatrixPlot.R: -------------------------------------------------------------------------------- 1 | #' Run Matrix Plot 2 | #' 3 | #' A wrapper function for \code{\link[Ragas]{MatrixPlot}} 4 | #' 5 | #' This function takes pre-calculated results from the \code{markers} field of the Pi object and plots heatmap of 6 | #' top genes for each identity group (e.g., cluster). Running \code{\link[Ragas]{RunFindAllMarkers}} is always required prior to run this function, 7 | #' which will store new \code{\link[Seurat]{FindAllMarkers}} results in the \code{markers} object with a unique identifier. 8 | #' This unique identifier needs to be passed to the \code{markers.key} argument so the function can pull relevant differential 9 | #' expression data for plotting. 10 | #' 11 | #' A new assay with assay name determined by argument \code{alt.assay.name} will be created, followed by 12 | #' RC normalization and scaling. When scaling, no variables are regressed out so the scaled expression will be more consistent with that from 13 | #' \code{\link[Seurat]{FeaturePlot}}. The new assay only contains \code{top.n} genes from each identity group (e.g., clusters, in most cases) to 14 | #' reduce computational cost. 15 | #' 16 | #' 17 | #' @param object A \code{\link[Ragas]{Pi}} object 18 | #' @param markers.key A unique identifier for \code{\link[Ragas]{RunFindAllMarkers}} to pull results from the \code{markers} field 19 | #' @param alt.assay.name Name of the alternative assay to store RC normalized data 20 | #' @param top.n Number of top markers to plot (per identity group) 21 | #' @param up.genes Whether to plot the up-regulated genes (default: TRUE) 22 | #' @param heatmap.cols Colors to plot the heatmap (optional). A character vector with colors for low, medium and high expression. 23 | #' @param min.exp The minimum expression value to plot (default: -1.5) 24 | #' @param max.exp The maximum expression value to plot (default: 1.5) 25 | #' @param column.fontsize Font size for column texts (default: 6) 26 | #' @param row.fontsize Font size for row texts (default: 8) 27 | #' @param column.anno.cols Named character vector with colors for column annotations (default: NULL). Names should match Idents of object. 28 | #' @param column.anno.name.fontsize Font size for column annotations, such as clusters (default: 10) 29 | #' @param column.anno.name.rot Rotation of column annotations (default: 0) 30 | #' @param column.anno.name.just Alignment of column annotations (default: "left") 31 | #' @param legend.label.fontsize Font size for legend label (default: 10) 32 | #' @param legend.title.fontsize Font size for legend title (default: 10) 33 | #' @param heatmap.width Width of the heatmap (default: 20) 34 | #' @param heatmap.height Height of the heatmap (default: 8) 35 | #' 36 | #' @return A \code{\link[ComplexHeatmap]{Heatmap-class}} object 37 | #' 38 | #' @references Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 39 | #' @references Gu, Z. (2016) Complex heatmaps reveal patterns and correlations in multidimensional genomic data. Bioinformatics. 40 | #' @export 41 | #' 42 | #' @examples 43 | #' \dontrun{ 44 | #' ## Run matrix plot for pre-calculated markers in the example data 45 | #' RunMatrixPlot(csle.pbmc.pi, 46 | #' markers.key = "Markers|subcluster_idents|AllMarkers|test.use=wilcox", 47 | #' column.anno.name.rot = 45) 48 | #' } 49 | #' 50 | RunMatrixPlot <- function(object, 51 | markers.key, 52 | alt.assay.name = "RNAalt", 53 | top.n = 5, 54 | up.genes = TRUE, 55 | heatmap.cols = NULL, 56 | min.exp = -1.5, 57 | max.exp = 1.5, 58 | column.fontsize = 6, 59 | row.fontsize = 8, 60 | column.anno.cols = NULL, 61 | column.anno.name.fontsize = 10, 62 | column.anno.name.rot = 0, 63 | column.anno.name.just="left", 64 | legend.label.fontsize = 10, 65 | legend.title.fontsize = 10, 66 | heatmap.width = 20, 67 | heatmap.height = 8 68 | ){ 69 | if(is(object, "Pi")){ 70 | object <- unclass(object) 71 | if(length(object$markers) == 0){ 72 | stop("The \"markers\" field of the Pi object is empty. Run RunFindAllMarkers on the Pi object first.") 73 | }else{ 74 | if(!markers.key %in% names(object$markers)){ 75 | stop("Invalid key \"",markers.key, "\" for the markers object. The following key(s) are available:\n ", paste(names(object$markers), collapse = "\n "),"\nEither choose an availble key or rerun RunFindAllMarkers.") 76 | }else{ 77 | my.markers <- object$markers[[markers.key]][["data"]] 78 | my.marker.type <- unlist(strsplit(markers.key, split = "|", fixed = TRUE))[3] 79 | my.marker.idents <- unlist(strsplit(markers.key, split = "|", fixed = TRUE))[2] 80 | 81 | if(!identical(Idents(object$seurat.obj), object$seurat.obj[[my.marker.idents, drop = TRUE]])){ 82 | Idents(object$seurat.obj) <- my.marker.idents 83 | message("Set active identity to ", my.marker.idents) 84 | } 85 | } 86 | } 87 | 88 | stopifnot(top.n > 0, is.numeric(top.n)) 89 | ## only run re-normalization on top markers 90 | markers.split0 <- split(my.markers, f = my.markers$cluster) 91 | if(up.genes){ 92 | markers.split <- lapply(markers.split0, function(x) x %>% 93 | dplyr::filter(avg_log2FC > 0) %>% 94 | dplyr::arrange(desc(avg_log2FC)) 95 | ) 96 | }else{ 97 | markers.split <- lapply(markers.split0, function(x) x %>% 98 | dplyr::filter(avg_log2FC < 0) %>% 99 | dplyr::arrange(avg_log2FC) 100 | ) 101 | } 102 | n.list <- unlist(lapply(markers.split, function(x) dim(x)[1])) 103 | 104 | n.deg.list <- pmin(n.list, top.n) 105 | 106 | top.markers.list <- lapply(seq_along(markers.split), function(i) markers.split[[i]][1:n.deg.list[i], "gene"]) 107 | 108 | top.markers.list[which(is.na(top.markers.list))] <- NULL 109 | top.markers <- unique(unlist(top.markers.list)) 110 | 111 | ## Re-run normalization using RC method 112 | dat <- GetAssayData(object$seurat.obj,assay = 'RNA',slot = 'counts') 113 | RNA.alt <- CreateAssayObject(count = dat) 114 | object$seurat.obj[[alt.assay.name]] <- RNA.alt 115 | DefaultAssay(object$seurat.obj) <- alt.assay.name 116 | object$seurat.obj <- NormalizeData(object$seurat.obj,normalization.method = 'RC') 117 | object$seurat.obj <- ScaleData(object$seurat.obj, features = top.markers) 118 | 119 | all.marker.types <- c('all', 'conserved') 120 | names(all.marker.types) <- c('AllMarkers','AllConservedMarkers') 121 | 122 | p <- MatrixPlot(object = object$seurat.obj, 123 | markers.list = my.markers, 124 | n.genes = top.n, 125 | type = all.marker.types[my.marker.type], 126 | up.genes = up.genes, 127 | down.genes = !up.genes, 128 | heatmap.cols = heatmap.cols, 129 | min.exp = min.exp, 130 | max.exp = max.exp, 131 | column.fontsize = column.fontsize, 132 | row.fontsize = row.fontsize, 133 | column.anno.cols = column.anno.cols, 134 | column.anno.name.fontsize = column.anno.name.fontsize, 135 | column.anno.name.rot = column.anno.name.rot, 136 | column.anno.name.just = column.anno.name.just, 137 | legend.label.fontsize = legend.label.fontsize, 138 | legend.title.fontsize = legend.title.fontsize, 139 | heatmap.width = heatmap.width, 140 | heatmap.height = heatmap.height) 141 | 142 | 143 | return(p) 144 | 145 | }else{ 146 | stop('Invalid input object. Post Integration (Pi) object is required.') 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /R/RunSankeyPlot.R: -------------------------------------------------------------------------------- 1 | #' Run Sankey Plot 2 | #' 3 | #' A wrapper function for \code{\link[Ragas]{SankeyPlot}} 4 | #' 5 | #' This function takes 2 metadata column from seurat object and creates a sankey diagram 6 | #' 7 | #' @param object A \code{\link[Ragas]{Pi}} object or Seurat object 8 | #' @param meta.1 Name of metadata column to map from 9 | #' @param meta.2 Name of metadata column to map to 10 | #' @param node.colors A character vector with colors for the node. The length must be the same as the unique number of items in meta.1 and meta.2 11 | #' @param node.outline.color Color for node outline (default: black) 12 | #' @param node.text.size Text size for node (default: 5) 13 | #' @param node.text.color Color for node text (default: black) 14 | #' @param node.text.hjust Horizontal justification (in [0, 1]) for node text 15 | #' @param node.text.vjust Vertical justification (in [0, 1]) for node text 16 | #' @param axis.text.size Axis text size 17 | #' @param random.col.seed Set seed to control colors 18 | #' 19 | #' @return A \code{\link[ggplot2]{ggplot}} object 20 | #' @export 21 | #' 22 | #' @examples 23 | #' \dontrun{ 24 | #' ## Sankey plot 25 | #' RunSankeyPlot(csle.pbmc.pi, 26 | #' meta.1 = "cluster.annotation", meta.2 = "subcluster_idents") 27 | #' } 28 | #' 29 | RunSankeyPlot <- function(object, meta.1, meta.2, 30 | node.colors = NULL, node.outline.color = 'black', 31 | node.text.size = 5, node.text.color = 'black', 32 | node.text.hjust = 0,node.text.vjust = 0.5, 33 | axis.text.size = 20, random.col.seed = 1) 34 | { 35 | if(!(is(object, "Pi") || is(object, "Seurat"))){stop("Invalid input argument \"object\". Either Seurat or Pi object is required.")} 36 | if(is(object, "Pi")){seurat.obj <- object$seurat.obj} 37 | if(is(object, "Seurat")){seurat.obj <- object} 38 | 39 | if(!(meta.1 %in% names(seurat.obj[[]])) & !(meta.2 %in% names(seurat.obj[[]]))){ 40 | stop("argument \"meta.1\" and \"meta.2\" not found in the meta data") 41 | }else if(!(meta.1 %in% names(seurat.obj[[]])) & (meta.2 %in% names(seurat.obj[[]]))) 42 | { 43 | stop("argument \"meta.1\" not found in the meta data") 44 | }else if((meta.1 %in% names(seurat.obj[[]])) & !(meta.2 %in% names(seurat.obj[[]]))) 45 | { 46 | stop("argument \"meta.2\" not found in the meta data") 47 | } 48 | 49 | SankeyPlot(object = seurat.obj, meta.1, meta.2, 50 | node.colors = node.colors, node.outline.color = node.outline.color, 51 | node.text.size = node.text.size, node.text.color = node.text.color, 52 | node.text.hjust = node.text.hjust,node.text.vjust = node.text.vjust, 53 | axis.text.size = axis.text.size, random.col.seed = random.col.seed) 54 | 55 | } 56 | -------------------------------------------------------------------------------- /R/RunSubclusterReprojection.R: -------------------------------------------------------------------------------- 1 | #' Integrate and reproject sub-cluster analysis 2 | #' 3 | #' Combine dimension reduction and nearest neighbor data from child Seurat objects generated by subcluster analysis 4 | #' and integrate with the parent Seurat object 5 | #' 6 | #' @param object The parent Seurat object 7 | #' @param subclusters.list A list of child Seurat/Pi object to be combined 8 | #' @param keep.child.object.name Whether to keep the child object name as the prefix for subcluster identities 9 | #' @param weight A numeric number between 0 and 1 indicating the weight to reserve nearest neighbor structures from the parent object (default: 1) 10 | #' @param main.cluster.anno Additional cluster annotation for the parent Seurat object, such as user-annotated cluster identities 11 | #' @param main.cluster.umap.config A list containing UMAP run parameters for main clusters 12 | #' @param main.cluster.to.preserve Name of the metadata column containing main cluster identities that needs to be preserved during re-projection (default: seurat_clusters) 13 | #' @param subcluster.colname Name of the metadata column of the child object contains subcluster identities (default: seurat_clusters) 14 | #' @param subcluster.umap.config A list containing UMAP run parameters for subclusters per child object 15 | #' @param diet.dimredc Whether to preserve a subset of DimReducs when running \code{DietSeurat} (default: pca, harmony, umap) 16 | #' @param rp.reduction.name Name to store the re-projected dimension reduction object (default: rp) 17 | #' @param rp.reduction.key Key for the re-projected dimension reduction object (default: RPUMAP_) 18 | #' @param rp.seed Random seed for re-projected UMAP 19 | #' @param verbose Verbosity (default: TRUE) 20 | #' 21 | #' @return An updated parent Seurat object with two key modifications 22 | #' \itemize{ 23 | #' \item Added a new metadata column \code{subcluster_idents} to store subcluster identities 24 | #' \item Added a new dimension reduction object (default reduction: rp) with re-projected embedding 25 | #' } 26 | #' @keywords internal 27 | #' 28 | #'@noRd 29 | 30 | RunSubclusterReprojection <- function(object, 31 | subclusters.list, 32 | keep.child.object.name = TRUE, 33 | weight = 1, 34 | main.cluster.anno = NULL, 35 | main.cluster.umap.config = NULL, 36 | main.cluster.to.preserve = "seurat_clusters", 37 | subcluster.colname = "seurat_clusters", 38 | subcluster.umap.config = NULL, 39 | rp.reduction.name = "rp", 40 | rp.reduction.key = "RPUMAP_", 41 | rp.seed = 42L, 42 | verbose = TRUE 43 | ){ 44 | ## parent object 45 | if(!is(object, "Seurat")){ 46 | stop("Invalid input argument \"object\". Seurat object is required.") 47 | }else{ 48 | parent.obj = object 49 | } 50 | 51 | if(is.null(main.cluster.anno)){ 52 | if(verbose){ 53 | message("No annotation data for main clusters. Proceed with \"seurat_clusters\"") 54 | } 55 | main.cluster.anno <- "seurat_clusters" 56 | } 57 | 58 | ## Create child object list for subclusters 59 | child.obj.list <-list() 60 | main.clusters.analyzed <- c() 61 | for(i in 1:length(subclusters.list)){ 62 | obj.name <- names(subclusters.list)[i] 63 | child.obj.list[[obj.name]] <- list() 64 | ## load child objects 65 | if(length(subclusters.list[[i]]) > 1){ 66 | if(verbose){message("Loading", subclusters.list[[i]][1],"...\n")} 67 | load(subclusters.list[[i]][1]) 68 | input.obj <- get(subclusters.list[[i]][2]) 69 | }else{ 70 | input.obj <- get(subclusters.list[[i]][1]) 71 | } 72 | ## check object type 73 | if(is(input.obj, "Seurat")){ 74 | seurat.obj <- input.obj 75 | }else{ 76 | if(is(input.obj, "Pi")){ 77 | seurat.obj <- input.obj[["seurat.obj"]] 78 | }else{ 79 | stop("Child object must be a Seurat or Pi object!") 80 | } 81 | } 82 | ## check cell overlap 83 | cells.child <- colnames(seurat.obj) 84 | cells.parent <- colnames(parent.obj) 85 | cells.common <- intersect(cells.child, cells.parent) 86 | if(length(cells.child) > length(cells.common)){ 87 | message("The child object ", obj.name, " has ", length(cells.child), " cells, ", length(cells.common), " are found in the parent object.") 88 | message("Subsetting child object...\n") 89 | seurat.obj <- seurat.obj[, cells.common] 90 | } 91 | 92 | main.clusters.analyzed <- c(main.clusters.analyzed, unique(as.character(parent.obj[,colnames(seurat.obj)]$seurat_clusters))) 93 | # print(main.clusters.analyzed) 94 | child.obj.list[[obj.name]] <- seurat.obj 95 | } 96 | 97 | ## Create new metadata column "subcluster_idents" 98 | parent.obj$subcluster_idents <- "none" 99 | clusters.to.keep <- setdiff(levels(parent.obj$seurat_clusters), main.clusters.analyzed) 100 | # print(clusters.to.keep) 101 | if(length(clusters.to.keep) > 0){ 102 | if(verbose){message("The following seurat_clusters are kept as-is without sub-cluster analysis: ", paste(clusters.to.keep,collapse = ", "))} 103 | } 104 | if(length(clusters.to.keep) > 0){ 105 | for(i in 1:length(clusters.to.keep)){ 106 | idx <- which(parent.obj$seurat_clusters == clusters.to.keep[i]) 107 | parent.obj$subcluster_idents[idx] <- as.character(parent.obj[[main.cluster.anno, drop = TRUE]][idx]) 108 | } 109 | } 110 | # print(unique(parent.obj$subcluster_idents)) 111 | ## assign sub-cluster identities 112 | for(i in 1:length(child.obj.list)){ 113 | idx <- match(colnames(child.obj.list[[i]]), colnames(parent.obj)) 114 | if(keep.child.object.name){ 115 | parent.obj$subcluster_idents[idx] <- paste(names(child.obj.list)[i],child.obj.list[[i]][[subcluster.colname[names(child.obj.list)[i]], drop = TRUE]], sep = '-') 116 | }else{ 117 | parent.obj$subcluster_idents[idx] <- as.character(child.obj.list[[i]][[subcluster.colname[names(child.obj.list)[i]], drop = TRUE]]) 118 | } 119 | } 120 | 121 | parent.obj <- subset(parent.obj, subset = subcluster_idents != 'none') 122 | 123 | ## make factor and order levels 124 | parent.obj$subcluster_idents <- factor(parent.obj$subcluster_idents, levels = sort(unique(parent.obj$subcluster_idents))) 125 | # print(table(parent.obj$subcluster_idents, parent.obj$seurat_clusters)) 126 | 127 | parent.obj <- .RunReprojection(parent.obj, 128 | child.obj.list, 129 | mc.umap.config = main.cluster.umap.config, 130 | sc.umap.config = subcluster.umap.config, 131 | mc.cluster.to.preserve = main.cluster.to.preserve, 132 | w = weight, 133 | reduction.name = rp.reduction.name, 134 | reduction.key = rp.reduction.key, 135 | seed = rp.seed, 136 | verbose = verbose) 137 | return(parent.obj) 138 | 139 | 140 | } 141 | -------------------------------------------------------------------------------- /R/SankeyPlot.R: -------------------------------------------------------------------------------- 1 | #' Make Sankey Plot 2 | #' 3 | #' A function to make Sankey plot between metadata columns for Seurat or Pi object. 4 | #' 5 | #' @param object A \code{\link[Ragas]{Pi}} object or Seurat object 6 | #' @param meta.1 Name of metadata column to map from 7 | #' @param meta.2 Name of metadata column to map to 8 | #' @param node.colors A character vector with colors for the node. The length must be the same as the unique number of items in meta.1 and meta.2 9 | #' @param node.outline.color Color for node outline (default: black) 10 | #' @param node.text.size Text size for node (default: 5) 11 | #' @param node.text.color Color for node text (default: black) 12 | #' @param node.text.hjust Horizontal justification for node text (default: -0.05) 13 | #' @param node.text.vjust Vertical justification for node text (default: 0.5) 14 | #' @param axis.text.size Axis text size (default: 20) 15 | #' @param random.col.seed Set seed to control colors (default: 1) 16 | #' 17 | #' @importFrom ggsankey make_long geom_sankey geom_sankey_text theme_sankey 18 | #' @importFrom ggplot2 ggplot aes scale_fill_manual theme element_blank element_text position_nudge 19 | #' @importFrom randomcoloR distinctColorPalette 20 | #' @return A \code{\link[ggplot2]{ggplot}} object 21 | #' @examples 22 | #' \dontrun{ 23 | #' SankeyPlot(object = csle.pbmc.pi, meta.1 = 'cluster.annotation', meta.2 = 'subcluster_idents') 24 | #' } 25 | #' @export 26 | #' 27 | 28 | SankeyPlot <- function(object, meta.1, meta.2, 29 | node.colors = NULL, node.outline.color = 'black', 30 | node.text.size = 5, node.text.color = 'black', 31 | node.text.hjust = (-0.05),node.text.vjust = 0.5, 32 | axis.text.size = 20, random.col.seed = 1) 33 | { 34 | if(!(is(object, "Pi") || is(object, "Seurat"))){stop("Invalid input argument \"object\". Either Seurat or Pi object is required.")} 35 | if(is(object, "Pi")){object <- object$seurat.obj} 36 | dat <- object@meta.data[,c(meta.1,meta.2)] 37 | dat <- suppressWarnings(dat %>% make_long(c(meta.1,meta.2))) 38 | 39 | if(is.null(node.colors)) 40 | { 41 | set.seed(random.col.seed) 42 | node.colors <- distinctColorPalette(length(unique(dat$node))) 43 | }else if(!is.null(node.colors)) 44 | { 45 | if(length(node.colors) != length(unique(dat$node))) 46 | { 47 | stop("The length of \"node.colors\" must be the same as the unique number of items in \"meta.1\" and \"meta.2\" .") 48 | } 49 | } 50 | 51 | final.plot <- ggplot(dat, aes(x = x, 52 | next_x = next_x, 53 | node = node, 54 | next_node = next_node, 55 | fill = factor(node), 56 | label = node)) + 57 | geom_sankey(flow.alpha = 0.8, node.color = node.outline.color, type = 'sankey') + 58 | geom_sankey_text(size = node.text.size, color = node.text.color, 59 | hjust = node.text.hjust,vjust = node.text.vjust, 60 | position = position_nudge(x = 0.05)) + 61 | scale_fill_manual(values = node.colors) + 62 | theme_sankey(base_size = 11) + 63 | theme(legend.position = "none", axis.title.x = element_blank(), 64 | axis.text.x = element_text(size = axis.text.size)) 65 | 66 | return(final.plot) 67 | } 68 | -------------------------------------------------------------------------------- /R/data.R: -------------------------------------------------------------------------------- 1 | #' A small example of PBMC data from child SLE 2 | #' 3 | #' This object contains 3000 down-sampled PBMC cells from Nehar-Belaid et al., 2020 4 | #' 5 | #' @format A Seurat object 6 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 7 | #' 8 | "csle.pbmc.small" 9 | 10 | 11 | #' A small example of B cell data from child SLE 12 | #' 13 | #' This object contains down-sampled cells from Nehar-Belaid et al., 2020 14 | #' 15 | #' @format A Seurat object 16 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 17 | #' 18 | "csle.bcell.small" 19 | 20 | #' A small example of T cell data from child SLE 21 | #' 22 | #' This object contains down-sampled cells from Nehar-Belaid et al., 2020 23 | #' 24 | #' @format A Seurat object 25 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 26 | #' 27 | "csle.tcell.small" 28 | 29 | #' A small example of Treg data from child SLE 30 | #' 31 | #' This object contains down-sampled cells from Nehar-Belaid et al., 2020 32 | #' 33 | #' @format A Seurat object 34 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 35 | #' 36 | "csle.treg.small" 37 | 38 | #' A small example of CD4+ memory T cell data from child SLE 39 | #' 40 | #' This object contains down-sampled cells from Nehar-Belaid et al., 2020 41 | #' 42 | #' @format A Seurat object 43 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 44 | #' 45 | "csle.cd4.mem.small" 46 | 47 | #' An example Pi object built from csle.pbmc.small 48 | #' 49 | #' This data contained 3000 down-sampled PBMC cells from Nehar-Belaid et al., 2020. 50 | #' Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.pbmc.small}}: 51 | #' 52 | #' @examples 53 | #' \dontrun{ 54 | #' ## A list of subclusters to combine 55 | #' subclusters <- list("B cell" = "csle.bcell.small", "T cell" = "csle.tcell.pi") 56 | #' 57 | #' ## UMAP configuration 58 | #' sc.config <- ConfigureReprojection(type = "sc", "B cell") 59 | #' sc.config <- ConfigureReprojection(type = "sc", "T cell", umap.name = "rp", append.to = sc.config) 60 | #' 61 | #' ## select columns for cell identities 62 | #' sc.colnames <- c("B cell" = "cluster.annotation", "T cell" = "subcluster_idents") 63 | #' 64 | #' ## integrate subclusters 65 | #' library(dplyr) 66 | #' csle.pbmc.pi <- csle.pbmc.small %>% 67 | #' CreatePostIntegrationObject(child.object.list = subclusters, 68 | #' rp.subcluster.umap.config = sc.config, 69 | #' rp.main.cluster.anno = "cluster.annotation", 70 | #' rp.subcluster.colname = sc.colnames) %>% 71 | #' CalculateExpFreqs(ident = "subcluster_idents") %>% 72 | #' RunFindAllMarkers(ident = "subcluster_idents") %>% 73 | #' RunPseudobulkAnalysis(ident.var = "subcluster_idents", 74 | #' group.var = "Groups", 75 | #' sample.var = "Names", 76 | #' group.1 = "cSLE", 77 | #' group.2 = "cHD") %>% 78 | #' RunProportionPlot(group.by = "Groups", 79 | #' ident = "subcluster_idents", 80 | #' method = "unpooled", 81 | #' unpool.by = "Names" 82 | #' ) 83 | #' 84 | #'} 85 | #' @format A \code{\link[Ragas]{Pi}} object 86 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 87 | #' 88 | "csle.pbmc.pi" 89 | 90 | #' An example Pi object built from csle.bcell.small 91 | #' 92 | #' This data contained down-sampled B cells from Nehar-Belaid et al., 2020. 93 | #' Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.bcell.small}}: 94 | #' 95 | #' @examples 96 | #' \dontrun{ 97 | #' csle.bcell.pi <- csle.bcell.small %>% 98 | #' CreatePostIntegrationObject(parent.object = csle.pbmc.small) %>% 99 | #' CalculateExpFreqs(ident = "cluster.annotation") %>% 100 | #' RunFindAllMarkers(ident = "cluster.annotation") %>% 101 | #' RunPseudobulkAnalysis(ident.var = "cluster.annotation", 102 | #' group.var = "Groups", 103 | #' sample.var = "Names", 104 | #' group.1 = "cSLE", 105 | #' group.2 = "cHD") %>% 106 | #' RunProportionPlot(group.by = "Groups", 107 | #' ident = "cluster.annotation", 108 | #' method = "unpooled", 109 | #' unpool.by = "Names", 110 | #' use.parent.as.ref = TRUE 111 | #' ) 112 | #'} 113 | #' @format A \code{\link[Ragas]{Pi}} object 114 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 115 | #' 116 | "csle.bcell.pi" 117 | 118 | 119 | #' An example Pi object built from csle.tcell.small 120 | #' 121 | #' This data contained down-sampled T cells from Nehar-Belaid et al., 2020. 122 | #' Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.tcell.small}}: 123 | #' 124 | #' @examples 125 | #' \dontrun{ 126 | #' ## A list of T cell subclusters to combine 127 | #' subclusters <- list("CD4mem" = "csle.cd4.mem.small", "Treg" = "csle.treg.small") 128 | #' 129 | #' csle.tcell.pi <- csle.tcell.small %>% 130 | #' CreatePostIntegrationObject(child.object.list = subclusters, 131 | #' rp.main.cluster.anno = "cluster.annotation", 132 | #' rp.subcluster.colname = "cluster.annotation", 133 | #' parent.object = csle.pbmc.small) %>% 134 | #' CalculateExpFreqs(ident = "subcluster_idents") %>% 135 | #' RunFindAllMarkers(ident = "subcluster_idents") %>% 136 | #' RunPseudobulkAnalysis(ident.var = "subcluster_idents", 137 | #' group.var = "Groups", 138 | #' sample.var = "Names", 139 | #' group.1 = "cSLE", 140 | #' group.2 = "cHD") %>% 141 | #' RunProportionPlot(ident = "subcluster_idents", 142 | #' group.by = "Groups", 143 | #' method = "unpooled", 144 | #' unpool.by = "Names", 145 | #' use.parent.as.ref = TRUE 146 | #' ) 147 | #' 148 | #'} 149 | #' @format A \code{\link[Ragas]{Pi}} object 150 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 151 | #' 152 | "csle.tcell.pi" 153 | 154 | #' An example Pi object built from csle.treg.small 155 | #' 156 | #' This data contained down-sampled Treg cells from Nehar-Belaid et al., 2020. 157 | #' Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.treg.small}}: 158 | #' 159 | #' @examples 160 | #' \dontrun{ 161 | #' csle.treg.pi <- csle.treg.small %>% 162 | #' CreatePostIntegrationObject(parent.object = csle.tcell.small) %>% ## use total T cell as reference for later proportion analysis 163 | #' CalculateExpFreqs(ident = "cluster.annotation") %>% 164 | #' RunFindAllMarkers(ident = "cluster.annotation") %>% 165 | #' RunPseudobulkAnalysis(ident.var = "cluster.annotation", 166 | #' group.var = "Groups", 167 | #' sample.var = "Names", 168 | #' group.1 = "cSLE", 169 | #' group.2 = "cHD") %>% 170 | #' RunProportionPlot(group.by = "Groups", 171 | #' method = "unpooled", 172 | #' unpool.by = "Names", 173 | #' use.parent.as.ref = TRUE 174 | #' ) 175 | #' 176 | #'} 177 | #' @format A \code{\link[Ragas]{Pi}} object 178 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 179 | #' 180 | "csle.treg.pi" 181 | 182 | #' An example Pi object built from csle.cd4.mem.small 183 | #' 184 | #' This data contained down-sampled CD4+ memory T cells from Nehar-Belaid et al., 2020. 185 | #' Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.cd4.mem.small}}: 186 | #' 187 | #' @examples 188 | #' \dontrun{ 189 | #' csle.cd4.mem.pi <- csle.cd4.mem.small %>% 190 | #' CreatePostIntegrationObject(parent.object = csle.tcell.small) %>% ## use total T cell as reference for later proportion analysis 191 | #' CalculateExpFreqs(ident = "cluster.annotation") %>% 192 | #' RunFindAllMarkers(ident = "cluster.annotation") %>% 193 | #' RunPseudobulkAnalysis(ident.var = "cluster.annotation", 194 | #' group.var = "Groups", 195 | #' sample.var = "Names", 196 | #' group.1 = "cSLE", 197 | #' group.2 = "cHD") %>% 198 | #' RunProportionPlot(group.by = "Groups", 199 | #' method = "unpooled", 200 | #' unpool.by = "Names", 201 | #' use.parent.as.ref = TRUE 202 | #' ) 203 | #' 204 | #'} 205 | #' @format A \code{\link[Ragas]{Pi}} object 206 | #' @source \url{https://www.nature.com/articles/s41590-020-0743-0} 207 | #' 208 | "csle.cd4.mem.pi" 209 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Ragas 2 | 3 | [![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0) 4 | 5 | Introduction to RAGAS 6 | === 7 | Jinghua Gu, Uthra Balaji 8 | 04/29/2024 9 | 10 | Ragas (**R** **A**dvanced **G**allery for **A**nalysis of 11 | **S**ingle-cell Data) is an R package that provides enhanced analysis 12 | and visualization for single-cell RNA-Seq. Developed under a unique 13 | consideration for [subcluster 14 | analysis](https://github.com/jig4003/Ragas/blob/main/vignettes/subcluster.md), 15 | Ragas offers functions that seamlessly integrates essential components 16 | of the subcluster analysis. Ragas has the following unique advantages: 17 | - **Unified data structure** 18 | All data from a variety of analysis are assembled under a unified 19 | structure called the “post-integration” (Pi) object 20 | 21 | - **Subcluster re-projection** 22 | Objects from subclustering can be integrated and re-projected to the 23 | main object so that cell sub-populations from different clusters can 24 | be systematically analyzed side-by-side. 25 | 26 | - **Enhanced Visualization** 27 | We have developed and re-developed many popular tools for single 28 | cell RNA-Seq, including matrix plot, annotated dot plot, stacked 29 | violin plot, as well as more basic box plot and bar plot to 30 | visualize expression and cell proportion changes acorss cluster or 31 | groups 32 | 33 | Documentation 34 | === 35 | Read the following tutorials for a jump-start: 36 | - [**Tutorial 1: A quick start guide**](https://github.com/jig4003/Ragas/blob/main/vignettes/QuickStart.md) 37 | - [**Tutorial 2: Ragas for subcluster analysis**](https://github.com/jig4003/Ragas/blob/main/vignettes/subcluster.md) 38 | - [**Tutorial 3: More examples on running Ragas with different scRNA-Seq workflows**](https://github.com/jig4003/Ragas/blob/main/vignettes/CrossCompatibilityExamples.md) 39 | 40 | Installation 41 | === 42 | 1. Install R 43 | 2. Install most of the dependencies using BiocManager::install 44 | ```r 45 | BiocManager::install(c("Seurat", "ggplot2", "randomcoloR", "SingleCellExperiment", "Matrix", "future", "dplyr", "reshape2", "scales", "ComplexHeatmap", "grid", "circlize", "gplots", "muscat", "limma", "ggtree", "patchwork", "ggprism", "rstatix", "cowplot", "aplot", "crayon"), update = FALSE) 46 | ``` 47 | 3. Install the ggsankey package from github 48 | ```r 49 | devtools::install_github("davidsjoberg/ggsankey", upgrade = "never") 50 | ``` 51 | 4. Install the Ragas package from github 52 | ```r 53 | devtools::install_github("jig4003/Ragas", upgrade = "never") 54 | ``` 55 | 5. In case users receive a version inconsistency warning about TMB (e.g., "Warning in checkDepPackageVersion(dep_pkg = "TMB"): Package version inconsistency detected...), reinstall glmmTMB 56 | ```r 57 | install.packages("glmmTMB", type="source") 58 | ``` 59 | Docker 60 | === 61 | We have created a Ragas docker image based on the Jupyter docker (https://jupyter-docker-stacks.readthedocs.io/en/latest/). To access the Ragas docker, simply run the following: 62 | ```bash 63 | docker pull uthrabalaji/ragas-docker:latest 64 | ``` 65 | To start the container, simply run: 66 | ```bash 67 | docker run -it --rm --name ragas_docker -p 10000:8888 -v "${PWD}":/home/jovyan uthrabalaji/ragas-docker 68 | ``` 69 | In the above command, by setting -v to "${PWD}":/home/jovyan, it mounts the current working directory ${PWD} as /home/jovyan. 70 | 71 | When openning the browser, the user will be asked to provide a token to access the container, which can be found in the console. 72 | 73 | A demo jupyter notebook can be found [here](https://github.com/jig4003/Ragas/blob/main/vignettes/Ragas_jupyternotebook_demo.ipynb). 74 | -------------------------------------------------------------------------------- /Ragas.Rproj: -------------------------------------------------------------------------------- 1 | Version: 1.0 2 | 3 | RestoreWorkspace: Default 4 | SaveWorkspace: Default 5 | AlwaysSaveHistory: Default 6 | 7 | EnableCodeIndexing: Yes 8 | UseSpacesForTab: Yes 9 | NumSpacesForTab: 2 10 | Encoding: UTF-8 11 | 12 | RnwWeave: Sweave 13 | LaTeX: pdfLaTeX 14 | 15 | AutoAppendNewline: Yes 16 | StripTrailingWhitespace: Yes 17 | 18 | BuildType: Package 19 | PackageUseDevtools: Yes 20 | PackageInstallArgs: --no-multiarch --with-keep.source 21 | PackageRoxygenize: rd,collate,namespace 22 | -------------------------------------------------------------------------------- /data/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/.DS_Store -------------------------------------------------------------------------------- /data/csle.bcell.pi.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.bcell.pi.RData -------------------------------------------------------------------------------- /data/csle.bcell.small.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.bcell.small.RData -------------------------------------------------------------------------------- /data/csle.cd4.mem.pi.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.cd4.mem.pi.RData -------------------------------------------------------------------------------- /data/csle.cd4.mem.small.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.cd4.mem.small.RData -------------------------------------------------------------------------------- /data/csle.pbmc.pi.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.pbmc.pi.RData -------------------------------------------------------------------------------- /data/csle.pbmc.small.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.pbmc.small.RData -------------------------------------------------------------------------------- /data/csle.tcell.pi.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.tcell.pi.RData -------------------------------------------------------------------------------- /data/csle.tcell.small.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.tcell.small.RData -------------------------------------------------------------------------------- /data/csle.treg.pi.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.treg.pi.RData -------------------------------------------------------------------------------- /data/csle.treg.small.RData: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/data/csle.treg.small.RData -------------------------------------------------------------------------------- /man/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/man/.DS_Store -------------------------------------------------------------------------------- /man/AddPiData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{AddPiData} 4 | \alias{AddPiData} 5 | \alias{AddPiData.default} 6 | \title{Add PiData} 7 | \usage{ 8 | AddPiData(x, ...) 9 | 10 | \method{AddPiData}{default}(x, value) 11 | } 12 | \arguments{ 13 | \item{x}{A PiData/PiDataList/Pi or list object} 14 | 15 | \item{...}{Additional arguments} 16 | 17 | \item{value}{A \code{PiData} object} 18 | } 19 | \value{ 20 | A PiDataList or Pi object. 21 | } 22 | \description{ 23 | Add PiData object to an existing PiData/PiDataList/Pi object. This function is intended to combine multiple analysis results of the same type. 24 | } 25 | \examples{ 26 | \dontrun{ 27 | ## Create two PiData objects for markers analysis 28 | res1 <- RunFindAllMarkers(csle.bcell.small, 29 | ident = "seurat_clusters", 30 | test.use = "wilcox", 31 | latent.vars = NULL) 32 | mk1 <- PiMarkerData(data = res1, 33 | ident = "seurat_clusters", 34 | method = "AllMarkers", 35 | test.use = "wilcox", 36 | latent.vars = NULL) 37 | res2 <- RunFindAllMarkers(csle.bcell.small, 38 | ident = "main.cluster.anno", 39 | test.use = "wilcox", 40 | latent.vars = NULL) 41 | mk2 <- PiMarkerData(data = res2, 42 | ident = "main.cluster.anno", 43 | method = "AllMarkers", 44 | test.use = "wilcox", 45 | latent.vars = NULL) 46 | 47 | ## Add a PiData object to another PiData object of the same type returns a PiDataList of two elements 48 | mk.list <- AddPiData(mk1, mk2) 49 | 50 | ## Add a PiData object to an empty list returns a PiDataList 51 | mk.list <- AddPiData(list(), mk1) 52 | 53 | ## Add a PiData object to a PiDataList. If the same PiData object already exists in the list, it will be overwritten 54 | mk.list1 <- AddPiData(mk.list, mk1) 55 | 56 | ## Add a PiData object to a Pi object 57 | my.pi <- CreatePostIntegrationObject(csle.bcell.small) ## a minimum Pi object 58 | my.pi <- AddPiData(my.pi, mk1) 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /man/AnnotatedDotPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/AnnotatedDotPlot.R 3 | \name{AnnotatedDotPlot} 4 | \alias{AnnotatedDotPlot} 5 | \title{AnnotatedDotPlot for Seurat or post-integration (pi) object} 6 | \usage{ 7 | AnnotatedDotPlot( 8 | object, 9 | features, 10 | cols = c("lightgrey", "blue"), 11 | split.by = NULL, 12 | group.by = NULL, 13 | clust.row = TRUE, 14 | clust.column = FALSE, 15 | column.annotation = NULL, 16 | column.annotation.cols = NULL, 17 | column.fontsize = 12, 18 | row.fontsize = 12, 19 | legend.label.fontsize = 13, 20 | legend.title.fontsize = 15, 21 | ... 22 | ) 23 | } 24 | \arguments{ 25 | \item{object}{A Seurat object} 26 | 27 | \item{features}{Genes/features to plot} 28 | 29 | \item{cols}{Colors to plot. Same as the "cols" argument of \code{\link[Seurat]{DotPlot}} (default: c("lightgrey", "blue"))} 30 | 31 | \item{split.by}{Factor to split the groups by. Same as the "split.by" argument of \code{\link[Seurat]{DotPlot}}} 32 | 33 | \item{group.by}{Factor to group the cells by. Same as the "group.by" argument of \code{\link[Seurat]{DotPlot}}} 34 | 35 | \item{clust.row}{Whether to cluster the rows/identities (default: TRUE)} 36 | 37 | \item{clust.column}{Whether to cluster the columns/features (default: FALSE)} 38 | 39 | \item{column.annotation}{A data.frame contains features and their annotation groups} 40 | 41 | \item{column.annotation.cols}{Colors for column annotation} 42 | 43 | \item{column.fontsize}{Size of column text (default: 12)} 44 | 45 | \item{row.fontsize}{Size of row text (default: 12)} 46 | 47 | \item{legend.label.fontsize}{Size of the legend labels (default: 13)} 48 | 49 | \item{legend.title.fontsize}{Size of the legend title (default: 15)} 50 | 51 | \item{...}{Extra parameters passed to DotPlot} 52 | } 53 | \value{ 54 | A \code{\link[ggplot2]{ggplot}} object 55 | } 56 | \description{ 57 | The AnnotatedDotPlot function enhances the original \code{\link[Seurat]{DotPlot}} function from Seurat by: 58 | (1) adding feature annotations to the columns); (2) allowing clustering and visualzation of dendrograms of 59 | identities on the rows. Use its wrapper function \code{\link[Ragas]{RunAnnotatedDotPlot}} for plotting. 60 | } 61 | \references{ 62 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 63 | } 64 | \keyword{internal} 65 | -------------------------------------------------------------------------------- /man/CalculateExpFreqs.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CalculateExpFreqs.R 3 | \name{CalculateExpFreqs} 4 | \alias{CalculateExpFreqs} 5 | \title{Calculate Expression Frequencies} 6 | \usage{ 7 | CalculateExpFreqs( 8 | object, 9 | ident = "seurat_clusters", 10 | group.by = NULL, 11 | cutoff = 0, 12 | verbose = TRUE 13 | ) 14 | } 15 | \arguments{ 16 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 17 | 18 | \item{ident}{Name of the metadata column as cell identity (default: seurat_clusters)} 19 | 20 | \item{group.by}{Additional factor to group the cells by} 21 | 22 | \item{cutoff}{Log-expression cutoff (default: 0)} 23 | 24 | \item{verbose}{Verbosity (default: TRUE)} 25 | } 26 | \value{ 27 | When \code{object} is a Seurat object, a list containing expression frequencies per \code{ident} will be returned; 28 | If \code{object} is a Pi object, an updated Pi object will be returned: a \code{\link[Ragas]{PiExpFreqData}} object that encloses the list 29 | containing expression frequencies per \code{ident} will be created and added to the \code{exp.freq} field. 30 | } 31 | \description{ 32 | Calculate single-cell expression frequency for each gene per identity class. 33 | } 34 | \details{ 35 | The function will return a list object, either directly as output or indirectly as part of the updated Pi object, with each list element 36 | being a data.frame to store the expression frequencies for all genes per \code{ident}. If \code{group.by} is NULL, the data.frame will have only one column called "AllCells" to store gene expression frequencies 37 | across all the cells for each identity; if \code{group.by} is set, additional columns storing gene expression frequencies in cells groups defined by \code{group.by} will be calculated and stored. 38 | } 39 | \examples{ 40 | \dontrun{ 41 | my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small) ## a minimum Pi object 42 | my.pi <- CalculateExpFreqs(my.pi) 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /man/CheckPiData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{CheckPiData} 4 | \alias{CheckPiData} 5 | \alias{CheckPiData.default} 6 | \title{Check Validity for PiData} 7 | \usage{ 8 | CheckPiData(x, ...) 9 | 10 | \method{CheckPiData}{default}(x, seurat.obj, verbose = FALSE) 11 | } 12 | \arguments{ 13 | \item{x}{A PiData object} 14 | 15 | \item{...}{Additional arguments} 16 | 17 | \item{seurat.obj}{A Seurat object} 18 | 19 | \item{verbose}{Whether to print messages (default: FALSE)} 20 | } 21 | \description{ 22 | Check the validity of PiData/PiDataList/Pi object 23 | } 24 | \seealso{ 25 | Usage of \code{CheckPiData} for different classes: \code{\link[Ragas]{PiExpFreqData}}, \code{\link[Ragas]{PiMarkerData}}, 26 | \code{\link[Ragas]{PiDSData}}, \code{\link[Ragas]{PiCellPropData}}, \code{\link[Ragas]{PiParentMetaData}}, 27 | \code{\link[Ragas]{PiDataList}}, \code{\link[Ragas]{Pi}}. 28 | } 29 | -------------------------------------------------------------------------------- /man/ConfigureReprojection.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/utils.R 3 | \name{ConfigureReprojection} 4 | \alias{ConfigureReprojection} 5 | \title{Create UMAP configuration for re-projection} 6 | \usage{ 7 | ConfigureReprojection( 8 | type = c("main", "sc"), 9 | sc.name = NULL, 10 | umap.name = "umap", 11 | umap.input.reduction.name = "harmony", 12 | umap.dims = 1:20, 13 | umap.n.neighbors = 30, 14 | umap.metric = "cosine", 15 | append.to = NULL 16 | ) 17 | } 18 | \arguments{ 19 | \item{type}{Type of UMAP configure, either "main" for main cluster or "sc" for subcluster} 20 | 21 | \item{sc.name}{Name of the child object for subcluster analysis, which should be consistent with the \code{child.object.list} 22 | argument of the \code{\link[Ragas]{CreatePostIntegrationObject}} function} 23 | 24 | \item{umap.name}{Name of the UMAP object (default: umap)} 25 | 26 | \item{umap.input.reduction.name}{Name of the reduction as input to re-run UMAP (default: harmony)} 27 | 28 | \item{umap.dims}{Input dimensions to run UMAP with. Same as the \code{dims} argument of the \code{\link[Seurat]{RunUMAP}} function (default: 1:20).} 29 | 30 | \item{umap.n.neighbors}{Number of neighbors for the KNN graph. Same as the \code{n.neighbors} argument of the \code{\link[Seurat]{RunUMAP}} function (default: 30)} 31 | 32 | \item{umap.metric}{Distance metric. Same as the \code{metric} argument of the \code{\link[Seurat]{RunUMAP}} function (default: "cosine")} 33 | 34 | \item{append.to}{Existing subcluster configuration to append to} 35 | } 36 | \value{ 37 | A list containing configurations for UAMP re-projection 38 | } 39 | \description{ 40 | Allow users to provide custom parameters to retrieve KNN data or re-run UMAP for re-projection 41 | } 42 | \examples{ 43 | \dontrun{ 44 | my.config <- ConfigureReprojection(type = "sc", sc.name = "Bcell") 45 | my.config <- ConfigureReprojection(type = "sc", sc.name = "Tcell", append.to = my.config) 46 | } 47 | 48 | } 49 | -------------------------------------------------------------------------------- /man/CreatePostIntegrationObject.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/CreatePostIntegrationObject.R 3 | \name{CreatePostIntegrationObject} 4 | \alias{CreatePostIntegrationObject} 5 | \title{Create a Post Integration Object} 6 | \usage{ 7 | CreatePostIntegrationObject( 8 | object, 9 | child.object.list = NULL, 10 | keep.child.object.name = TRUE, 11 | parent.object = NULL, 12 | parent.key = NULL, 13 | rp.main.cluster.anno = NULL, 14 | rp.main.cluster.umap.config = NULL, 15 | rp.main.cluster.to.preserve = "seurat_clusters", 16 | rp.subcluster.colname = NULL, 17 | rp.subcluster.umap.config = NULL, 18 | rp.weight = 1, 19 | rp.reduction.name = "rp", 20 | rp.reduction.key = "RPUMAP_", 21 | rp.seed = 42L, 22 | verbose = TRUE 23 | ) 24 | } 25 | \arguments{ 26 | \item{object}{A Seurat object} 27 | 28 | \item{child.object.list}{A list of Seurat/Pi objects that are the children of \code{object} from sub-cluster analysis} 29 | 30 | \item{keep.child.object.name}{Whether to keep the child object name as the prefix for subcluster identities. See Example 2 below} 31 | 32 | \item{parent.object}{A Seurat object that is the parent of \code{object}} 33 | 34 | \item{parent.key}{An optional character to describe the parent object. If not provided, the name of the parent object will be used.} 35 | 36 | \item{rp.main.cluster.anno}{Additional cluster annotation from the metadata column, such as user-annotated cluster identities. 37 | Only applies to re-projection of subclusters} 38 | 39 | \item{rp.main.cluster.umap.config}{A list containing UMAP run parameters for main clusters. See \code{\link[Ragas]{ConfigureReprojection}} for more details. When this argument is set to NULL, 40 | defaults of \code{\link[Ragas]{ConfigureReprojection}} will be used when re-running UMAP} 41 | 42 | \item{rp.main.cluster.to.preserve}{Name of the metadata column containing main cluster identities that needs to be preserved during re-projection (default: seurat_clusters)} 43 | 44 | \item{rp.subcluster.colname}{Name of the metadata column of the child object contains subcluster identities (default: seurat_clusters). Two formats are accepted: 45 | \itemize{ 46 | \item{a single character} : name of the (common) metadata column containing cell identity/cluster information for one or more child objects 47 | \item{a character vector} : must be a named vector with its elements correspond to the child objects. Its names must match those of the \code{child.object.list} 48 | }} 49 | 50 | \item{rp.subcluster.umap.config}{A list containing UMAP run parameters for subclusters per child object. Same as the \code{rp.main.cluster.umap.config}, when set to NULL, 51 | defaults of \code{\link[Ragas]{ConfigureReprojection}} will be used when re-running UMAP. Names of the list must match those of the \code{child.object.list}} 52 | 53 | \item{rp.weight}{A numeric number between 0 and 1 indicating the weight to reserve nearest neighbor structures from the parent object. 54 | Only applies to re-projection of subclusters (default: 1)} 55 | 56 | \item{rp.reduction.name}{Name to store the re-projected dimension reduction object (default: rp)} 57 | 58 | \item{rp.reduction.key}{Key for the re-projected dimension reduction object (default: RPUMAP_)} 59 | 60 | \item{rp.seed}{Random seed for re-projected UMAP} 61 | 62 | \item{verbose}{Verbosity (default: TRUE)} 63 | } 64 | \value{ 65 | A \code{\link[Ragas]{Pi}} object includes the following components: 66 | \itemize{ 67 | \item{"seurat.obj}: a Seurat object 68 | \item{"exp.freq}: cell expression frequency 69 | \item{"markers}: results of differential expression analysis to identify markers for each cell identity 70 | \item{"ds}: results of differential state analysis by pseudobulk method 71 | \item{"cell.prop}: results of differential analysis on cell proportions 72 | \item{"parent.meta.data}: metadata from the parent object, if applicable 73 | } 74 | } 75 | \description{ 76 | Initiates a \code{\link[Ragas]{Pi}} object that collects information after single-cell integration at either main level or sub-cluster level. 77 | } 78 | \details{ 79 | This function loads Seurat object(s) after basic analytic steps (i.e., normalization, dimension reduction, single-cell integration) 80 | and prepares for downstream analysis. When sub-cluster analysis has been performed, the function provides an interface to link 81 | parent and child Seurat objects so seamless analysis can be orchestrated. 82 | } 83 | \examples{ 84 | \dontrun{ 85 | ## Example 1: create a Pi object without integrating subclusters 86 | my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small) 87 | 88 | ## Example 2: create a Pi object and integrate subclusters with default UMAP run parameters 89 | subclusters <- list(T = "csle.tcell.small") 90 | my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small, 91 | keep.child.object.name = FALSE, 92 | child.object.list = subclusters, 93 | rp.main.cluster.anno = "cluster.annotation", 94 | rp.subcluster.colname = "cluster.annotation") 95 | ### A new UMAP called "rp" will be created; by default, cell cluster information is stored in a Seurat metadata column called "subcluster_idents" 96 | RunDimPlot(my.pi, reduction = "rp", group.by = "subcluster_idents",label = TRUE, raster = FALSE) 97 | 98 | ## Example 3: create a Pi object with user-defined parameters for re-projection (multi-level reprojection) 99 | ### level 1: integrate T cell and its subclusters 100 | subclusters <- list("CD4mem" = "csle.cd4.mem.small", "Treg" = "csle.treg.small") 101 | tcell.pi <- CreatePostIntegrationObject(object = csle.tcell.small, rp.weight = 0, 102 | child.object.list = subclusters, 103 | rp.main.cluster.anno = "cluster.annotation", 104 | rp.subcluster.colname = "cluster.annotation") 105 | 106 | ### level 2: integrate PBMC with T and B subclusters 107 | subclusters <- list("B cell" = "csle.bcell.small", "T cell" = "tcell.pi") 108 | sc.config <- ConfigureReprojection(type = "sc", "B cell") ## default 109 | sc.config <- ConfigureReprojection(type = "sc", "T cell", umap.name = "rp", append.to = sc.config) ## use UMAP named "rp" 110 | sc.colnames <- c("B cell" = "cluster.annotation", "T cell" = "subcluster_idents") 111 | pbmc.pi <- CreatePostIntegrationObject(object = csle.pbmc.small, 112 | child.object.list = subclusters, 113 | rp.subcluster.umap.config = sc.config, 114 | rp.main.cluster.anno = "cluster.annotation", 115 | rp.subcluster.colname = sc.colnames) 116 | RunDimPlot(pbmc.pi, reduction = "rp", group.by = "subcluster_idents",label = TRUE, raster = FALSE) 117 | } 118 | 119 | } 120 | \references{ 121 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 122 | } 123 | -------------------------------------------------------------------------------- /man/DSDotPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/DSDotPlot.R 3 | \name{DSDotPlot} 4 | \alias{DSDotPlot} 5 | \title{DotPlot for Differential State Analysis} 6 | \usage{ 7 | DSDotPlot( 8 | object, 9 | res, 10 | exp.freq, 11 | cpm.dat, 12 | features = NULL, 13 | p.threshold = 0.05, 14 | FC.threshold = 1.5, 15 | n.deg = Inf, 16 | p.adj.filter = TRUE, 17 | pct.threshold = 0.1, 18 | direction = "both", 19 | exp.filter = TRUE, 20 | exp.filter.thr = 0, 21 | group.col.name = NULL, 22 | sample.col.name = NULL, 23 | case.group = NULL, 24 | ref.group = NULL, 25 | bin.max = 0.5, 26 | bin.len = 0.1, 27 | lfc.min = -2, 28 | lfc.max = 2, 29 | clust.row = TRUE, 30 | clust.column = FALSE, 31 | heatmap.cols = NULL, 32 | highlight.deg = TRUE, 33 | deg.col = NULL, 34 | column.fontsize = 12, 35 | row.fontsize = 12, 36 | column.names.rotation = 90, 37 | axis.text.hjust = 0.5, 38 | axis.text.vjust = 0.5, 39 | legend.label.fontsize = 13, 40 | legend.title.fontsize = 15 41 | ) 42 | } 43 | \arguments{ 44 | \item{object}{A Seurat object} 45 | 46 | \item{res}{A list containing data.frame with differential testing results. See \code{\link[muscat]{pbDS}}} 47 | 48 | \item{exp.freq}{A list containing per gene expression frequencies. See \code{\link[Ragas]{CalculateExpFreqs}}} 49 | 50 | \item{cpm.dat}{A data frame containing CPM} 51 | 52 | \item{p.threshold}{P-Value cutoff} 53 | 54 | \item{FC.threshold}{Fold-change cutoff} 55 | 56 | \item{n.deg}{Number of genes to plot} 57 | 58 | \item{p.adj.filter}{Whether to apply multiple testing correction} 59 | 60 | \item{pct.threshold}{Cutoff for per gene expression frequencies} 61 | 62 | \item{direction}{Plot for either up or down-regulated genes, or both} 63 | 64 | \item{exp.filter}{Whether to perform additional expression filter based on median expression difference between groups (default: TRUE)} 65 | 66 | \item{exp.filter.thr}{Threshold for difference between median expression from two groups being compared (default: 0)} 67 | 68 | \item{group.col.name, sample.col.name}{Column names from the Seurat metadata used as group or sample variable by \code{\link[Ragas]{RunPseudobulkAnalysis}}} 69 | 70 | \item{case.group, ref.group}{Names for the case and control/reference group, corresponding to group.1 and group.2 from \code{\link[Ragas]{RunPseudobulkAnalysis}}, respectively} 71 | 72 | \item{bin.max}{Maximum exp proportion for binning pct expression data (default: 0.5)} 73 | 74 | \item{bin.len}{Step size for binning (default: 0.1)} 75 | 76 | \item{lfc.min, lfc.max}{Minimum/maximum logFC to plot} 77 | 78 | \item{clust.row, clust.column}{Whether to cluster row and columns} 79 | 80 | \item{heatmap.cols}{Three colors for heatmap (low, medium, high)} 81 | 82 | \item{highlight.deg}{Whether to highlight significant genes} 83 | 84 | \item{deg.col}{Color of the highlight} 85 | 86 | \item{column.fontsize, row.fontsize}{Column and row font size} 87 | 88 | \item{column.names.rotation}{Rotation for column names} 89 | 90 | \item{axis.text.hjust, axis.text.vjust}{Horizontal/vertical justification (in [0, 1]) for axis text (default: 0.5)} 91 | 92 | \item{legend.label.fontsize, legend.title.fontsize}{Font sizes for legend label and title} 93 | } 94 | \value{ 95 | A \code{\link[ggplot2]{ggplot}} object 96 | } 97 | \description{ 98 | An internal function that visualizes differential state analysis results from \code{\link[Ragas]{RunPseudobulkAnalysis}}, which also 99 | incorporates per gene expression frequencies calculated from \code{\link[Ragas]{CalculateExpFreqs}} as dot size. 100 | Use its wrapper function \code{\link[Ragas]{RunDSDotPlot}} for plotting. 101 | } 102 | \references{ 103 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 104 | } 105 | \keyword{internal} 106 | -------------------------------------------------------------------------------- /man/ExportPiData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ExportPiData.R 3 | \name{ExportPiData} 4 | \alias{ExportPiData} 5 | \title{Export Pi Data} 6 | \usage{ 7 | ExportPiData( 8 | object, 9 | field = NULL, 10 | key = NULL, 11 | file.prefix = NULL, 12 | ds.export.cpm = FALSE, 13 | ds.export.freq = FALSE, 14 | export.path = NULL 15 | ) 16 | } 17 | \arguments{ 18 | \item{object}{A \code{\link[Ragas]{Pi}} object} 19 | 20 | \item{field}{Name of pi object component to be exported} 21 | 22 | \item{key}{A unique identifier to retrieve data from the \code{field} parameter} 23 | 24 | \item{ds.export.cpm}{Option to export CPM data. Default: FALSE} 25 | 26 | \item{ds.export.freq}{Option to export frequency data. Default: FALSE} 27 | 28 | \item{export.path}{path to the directory where data should be exported. Default to current working directory} 29 | } 30 | \description{ 31 | Function to export data from \code{\link[Ragas]{Pi}} object 32 | } 33 | \details{ 34 | This function takes in a Pi object, field and key parameters to export data 35 | } 36 | \examples{ 37 | \dontrun{ 38 | ExportPiData(object = csle.pbmc.pi, 39 | field = 'exp.freq', 40 | key = 'ExpFreq|subcluster_idents|cutoff=0' 41 | ) 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /man/ExpressionPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ExpressionPlot.R 3 | \name{ExpressionPlot} 4 | \alias{ExpressionPlot} 5 | \title{Expression Plot} 6 | \usage{ 7 | ExpressionPlot( 8 | object, 9 | feature = NULL, 10 | assay = "RNA", 11 | group.by = NULL, 12 | split.by = NULL, 13 | ident = "seurat_clusters", 14 | res = NULL, 15 | plot.ds.p.value = FALSE, 16 | plot.ds.adjp.value = FALSE, 17 | colors = NULL, 18 | random.col.seed = 1, 19 | point.size = 1, 20 | axis.text.size = 12, 21 | axis.text.angle = 90, 22 | axis.text.hjust = 0, 23 | axis.text.vjust = 0, 24 | axis.title.size = 15, 25 | legend.text.size = 12, 26 | legend.title.size = 15, 27 | sig.size = 8, 28 | sig.bracket.color = "gray50", 29 | sig.color = "gray50", 30 | sig.bracket.width = 0.5 31 | ) 32 | } 33 | \arguments{ 34 | \item{object}{A Seurat object} 35 | 36 | \item{feature}{Gene name} 37 | 38 | \item{assay}{Name of the assay to use (default: "RNA")} 39 | 40 | \item{group.by}{Name of metadata column to group cells by} 41 | 42 | \item{split.by}{Name of the metadata column to split expression by (optional)} 43 | 44 | \item{ident}{Cell identity variable (default: seurat_clusters)} 45 | 46 | \item{res}{A list containing data.frame with differential testing results. See \code{\link[muscat]{pbDS}}} 47 | 48 | \item{plot.ds.p.value}{TRUE/FALSE if p-value from differential testing should be plotted (default: FALSE)} 49 | 50 | \item{plot.ds.adjp.value}{TRUE/FALSE if adjusted p-value from differential testing should be plotted (default: FALSE)} 51 | 52 | \item{colors}{Colors for plotting. Number of colors must be the equal to number of idents or the number of groups if split.by is used (optional)} 53 | 54 | \item{random.col.seed}{Set seed to control colors} 55 | 56 | \item{point.size}{Point size for box plot} 57 | 58 | \item{axis.text.size, legend.text.size}{Text size for axis or legend (default: 12)} 59 | 60 | \item{axis.text.angle}{Rotation of axis text} 61 | 62 | \item{axis.text.hjust}{Horizontal justification (in [0, 1]) for axis text} 63 | 64 | \item{axis.text.vjust}{Vertical justification (in [0, 1]) for axis text} 65 | 66 | \item{axis.title.size, legend.title.size}{Title size for axis or legend (default: 15)} 67 | 68 | \item{sig.size}{Asterisk size for significant tests} 69 | 70 | \item{sig.bracket.color}{Bracket color for significant tests} 71 | 72 | \item{sig.color}{Asterisk color for significant tests} 73 | 74 | \item{sig.bracket.width}{Bracket width for significant tests} 75 | } 76 | \description{ 77 | An internal function to plot expression of a gene groups by identity class or additional meta data. Use its wrapper function \code{\link[Ragas]{RunExpressionPlot}} for plotting. 78 | } 79 | \keyword{internal} 80 | -------------------------------------------------------------------------------- /man/MatrixPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/MatrixPlot.R 3 | \name{MatrixPlot} 4 | \alias{MatrixPlot} 5 | \title{Matrix Plot} 6 | \usage{ 7 | MatrixPlot( 8 | object, 9 | markers.list, 10 | n.genes = 3, 11 | type = "all", 12 | up.genes = TRUE, 13 | down.genes = FALSE, 14 | heatmap.cols = NULL, 15 | min.exp = -2, 16 | max.exp = 2, 17 | column.fontsize = 12, 18 | row.fontsize = 12, 19 | column.anno.cols = NULL, 20 | column.anno.name.fontsize = 15, 21 | column.anno.name.rot = 45, 22 | column.anno.name.just = "center", 23 | legend.label.fontsize = 13, 24 | legend.title.fontsize = 15, 25 | heatmap.width = 15, 26 | heatmap.height = 10 27 | ) 28 | } 29 | \arguments{ 30 | \item{object}{A Seurat object} 31 | 32 | \item{markers.list}{A data.frame that contains marker data from \code{\link[Seurat]{FindAllMarkers}}} 33 | 34 | \item{n.genes}{Number of genes to plot for each identity group} 35 | 36 | \item{type}{The type of markers, either "all" or "conserved", which correspond results from \code{\link[Seurat]{FindAllMarkers}} 37 | and \code{\link[Seurat]{FindConservedMarkers}}, respectively. In the current version, only \code{FindAllMarkers} is supported (default: "all")} 38 | 39 | \item{up.genes}{Whether to plot the up-regulated genes (default: TRUE)} 40 | 41 | \item{down.genes}{Whether to plot the down-regulated genes (default: FALSE)} 42 | 43 | \item{heatmap.cols}{Colors to plot the heatmap (optional). A character vector with colors for low, medium and high expression.} 44 | 45 | \item{min.exp}{The minimum expression value to plot (default: -2)} 46 | 47 | \item{max.exp}{The maximum expression value to plot (default: 2)} 48 | 49 | \item{column.fontsize}{Font size for column texts (default: 12)} 50 | 51 | \item{row.fontsize}{Font size for row texts (default: 12)} 52 | 53 | \item{column.anno.cols}{Named character vector with colors for column annotations (default: NULL). Names should match Idents of object.} 54 | 55 | \item{column.anno.name.fontsize}{Font size for column annotations, such as clusters (default: 15)} 56 | 57 | \item{column.anno.name.rot}{Rotation of column annotations (default: 45)} 58 | 59 | \item{column.anno.name.just}{Alignment of column annotations (default: "center")} 60 | 61 | \item{legend.label.fontsize}{Font size for legend label (default: 13)} 62 | 63 | \item{legend.title.fontsize}{Font size for legend title (15)} 64 | 65 | \item{heatmap.width}{Width of the heatmap (default: 15)} 66 | 67 | \item{heatmap.height}{Height of the heatmap (default: 10)} 68 | } 69 | \value{ 70 | A \code{\link[ComplexHeatmap]{Heatmap-class}} object 71 | } 72 | \description{ 73 | An internal function to make matrix plot based on Seurat object. 74 | } 75 | -------------------------------------------------------------------------------- /man/Pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{Pi} 4 | \alias{Pi} 5 | \alias{CheckPiData.Pi} 6 | \alias{print.Pi} 7 | \alias{[[.Pi} 8 | \alias{[[<-.Pi} 9 | \alias{AddPiData.Pi} 10 | \title{The Post Integration (Pi) Class.} 11 | \usage{ 12 | Pi( 13 | object, 14 | exp.freq = NULL, 15 | markers = NULL, 16 | ds = NULL, 17 | cell.prop = NULL, 18 | parent.meta.data = NULL 19 | ) 20 | 21 | \method{CheckPiData}{Pi}(x, verbose = FALSE, ...) 22 | 23 | \method{print}{Pi}(x, ...) 24 | 25 | \method{[[}{Pi}(x, i) 26 | 27 | \method{[[}{Pi}(x, i) <- value 28 | 29 | \method{AddPiData}{Pi}(x, value) 30 | } 31 | \arguments{ 32 | \item{object}{A Seurat object} 33 | 34 | \item{exp.freq}{A \code{\link[Ragas]{PiDataList}} containing calculated per gene expression frequency} 35 | 36 | \item{markers}{A \code{\link[Ragas]{PiDataList}} containing expression markers} 37 | 38 | \item{ds}{A \code{\link[Ragas]{PiDataList}} containing differential state analysis results by pseudobulk method} 39 | 40 | \item{cell.prop}{A \code{\link[Ragas]{PiDataList}} containing differential analysis results on cell proportions} 41 | 42 | \item{parent.meta.data}{A \code{\link[Ragas]{PiDataList}} containing Parent metadata} 43 | 44 | \item{x}{A Pi object} 45 | 46 | \item{verbose}{Whether to print messages (default: FALSE)} 47 | 48 | \item{...}{Additional arguments} 49 | 50 | \item{i}{index for list element to extract or replace} 51 | 52 | \item{value}{An object of class \code{PiData}, \code{PiDataList}, or \code{Seurat} to replace its current value} 53 | 54 | \item{seurat.obj}{A Seurat object} 55 | } 56 | \description{ 57 | An object of class Pi is a list of six fields that covers a variety of analyses for single cell RNA-seq. 58 | These six fields are: (1) "seurat.obj", a \code{\link[Seurat]{Seurat}} object that contains processed data (i.e., data that are filtered, normalized, 59 | batch-integrated, clustered and dimension-reduced); (2) "exp.freq", a list that contains per-gene expression frequency, which is the output of 60 | \code{\link[Ragas]{CalculateExpFreqs}}; (3) "markers", a data.frame that contains results from differential gene expression analysis, such as markers 61 | between different clusters, by running \code{\link[Ragas]{RunFindAllMarkers}}; (4) "ds", differential state analysis results for multi-sample, multi-group study 62 | design by running \code{\link[Ragas]{RunPseudobulkAnalysis}}; (5) "cell.prop", differential cell proportion analysis results from \code{\link[Ragas]{RunProportionPlot}}; 63 | (6) "Parent.meta.data", a data.frame containing metadata of from the parent Seurat object. 64 | } 65 | \examples{ 66 | ## Create a minimum Pi object from a Seurat object 67 | Pi(object = csle.pbmc.small) 68 | 69 | \dontrun{ 70 | ## Check the validity of Pi object 71 | CheckPiData(csle.pbmc.pi, verbose = TRUE)} 72 | 73 | ## print the Pi object 74 | csle.pbmc.pi 75 | 76 | ## Get a sub-object 77 | csle.pbmc.pi[["exp.freq"]] 78 | csle.pbmc.pi[["ds"]] 79 | 80 | } 81 | \seealso{ 82 | \code{\link[Ragas]{CreatePostIntegrationObject}} for a formal way to initialize a Pi object. 83 | 84 | Other related classes: \code{\link[Ragas]{PiData}}, \code{\link[Ragas]{PiExpFreqData}}, \code{\link[Ragas]{PiMarkerData}}, 85 | \code{\link[Ragas]{PiDSData}}, \code{\link[Ragas]{PiCellPropData}}, \code{\link[Ragas]{PiParentMetaData}}, and 86 | \code{\link[Ragas]{PiDataList}}. 87 | } 88 | -------------------------------------------------------------------------------- /man/PiCellPropData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiCellPropData} 4 | \alias{PiCellPropData} 5 | \alias{CheckPiData.PiCellPropData} 6 | \alias{print.PiCellPropData} 7 | \alias{[[.PiCellPropData} 8 | \title{PiCellPropData Class} 9 | \usage{ 10 | PiCellPropData(data, ident, method, group, by, parent = NULL) 11 | 12 | \method{CheckPiData}{PiCellPropData}(x, seurat.obj) 13 | 14 | \method{print}{PiCellPropData}(x, ...) 15 | 16 | \method{[[}{PiCellPropData}(x, i) 17 | } 18 | \arguments{ 19 | \item{data}{A data.frame containing test results from \code{\link[Ragas]{RunProportionPlot}}} 20 | 21 | \item{ident}{Name for the identity data} 22 | 23 | \item{method}{A character string describing the analysis method} 24 | 25 | \item{group}{Name of the metadata column to group cells by} 26 | 27 | \item{parent}{Name of the parent object} 28 | 29 | \item{x}{A PiCellPropData object} 30 | 31 | \item{seurat.obj}{A Seurat object} 32 | 33 | \item{...}{Additional arguments} 34 | 35 | \item{i}{Index for the list element to be extracted} 36 | } 37 | \description{ 38 | The PiCellPropData inherts \code{\link[Ragas]{PiData}} class, which stores differential cell proportion analysis results from \code{\link[Ragas]{RunProportionPlot}}. 39 | } 40 | \examples{ 41 | \dontrun{ 42 | ## Run cell proportion analysis on a Seurat object and construct a PiCellPropData object 43 | ## In this case, use.parent.as.ref = TRUE is not supported. 44 | ## Run ?RunProportionPlot to see how to use parent metadata for proportion analysis 45 | res <- RunProportionPlot(csle.bcell.small, 46 | ident = "seurat_clusters", 47 | group.by = "Groups", 48 | method = "unpooled", 49 | unpool.by = "Names") 50 | cp <- PiCellPropData(data = res, 51 | ident = "seurat_clusters", 52 | method = "unpooled", 53 | group = "Groups", 54 | parent = NULL) 55 | ## Print object 56 | cp 57 | 58 | ## Check object validity 59 | CheckPiData(cp, seurat.obj = csle.bcell.small) 60 | 61 | ## Add PiCellPropData object to an existing Pi object 62 | my.pi <- CreatePostIntegrationObject(csle.bcell.small) ## a minimum Pi object 63 | my.pi <- AddPiData(my.pi, cp) 64 | } 65 | 66 | } 67 | -------------------------------------------------------------------------------- /man/PiDSData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiDSData} 4 | \alias{PiDSData} 5 | \alias{CheckPiData.PiDSData} 6 | \alias{print.PiDSData} 7 | \alias{[[.PiDSData} 8 | \title{PiDSData Class} 9 | \usage{ 10 | PiDSData( 11 | data, 12 | ident, 13 | group, 14 | sample, 15 | block = NULL, 16 | method, 17 | group.1, 18 | group.2, 19 | contrast 20 | ) 21 | 22 | \method{CheckPiData}{PiDSData}(x, seurat.obj) 23 | 24 | \method{print}{PiDSData}(x, ...) 25 | 26 | \method{[[}{PiDSData}(x, i) 27 | } 28 | \arguments{ 29 | \item{data}{Output from \code{\link[Ragas]{RunPseudobulkAnalysis}}} 30 | 31 | \item{ident}{Name for the identity data} 32 | 33 | \item{group}{Name of the group from Seurat metadata for differential state analysis} 34 | 35 | \item{sample}{Name of the metadata column to identify samples} 36 | 37 | \item{block}{Blocking variable, such as Batch} 38 | 39 | \item{method}{A character string describing the analysis method} 40 | 41 | \item{group.1}{Group name for case} 42 | 43 | \item{group.2}{Group name for control} 44 | 45 | \item{contrast}{A character string summarizing the comparison} 46 | 47 | \item{x}{A PiDSData object} 48 | 49 | \item{seurat.obj}{A Seurat object} 50 | 51 | \item{...}{Additional arguments} 52 | 53 | \item{i}{Index for the list element to be extracted} 54 | } 55 | \description{ 56 | The PiDSData inherts \code{\link[Ragas]{PiData}} class, which stores differential state analysis results from \code{\link[Ragas]{RunPseudobulkAnalysis}}. 57 | } 58 | \examples{ 59 | \dontrun{ 60 | ## Run pseudobulk analysis and construct a PiDSData object 61 | gp1 <- "cSLE"; gp2 <- "cHD"; 62 | res <- RunPseudobulkAnalysis(csle.bcell.small, 63 | ident.var = "seurat_clusters", 64 | group.var = "Groups", 65 | sample.var = "Names", 66 | group.1 = gp1, 67 | group.2 = gp2, 68 | pbDS.method = "edgeR") 69 | ds <- PiDSData(data = res, 70 | ident = "seurat_clusters", 71 | method = "edgeR", 72 | group = "Groups", 73 | sample = "Names", 74 | group.1 = gp1, 75 | group.2 = gp2, 76 | contrast = paste(gp1, "-", gp2, sep = ""), 77 | block = NULL) 78 | 79 | ## Print object 80 | ds 81 | 82 | ## Check object validity 83 | CheckPiData(ds, seurat.obj = csle.bcell.small) 84 | 85 | ## Add PiDSData object to an existing Pi object 86 | my.pi <- CreatePostIntegrationObject(csle.bcell.small) ## a minimum Pi object 87 | my.pi <- AddPiData(my.pi, ds) 88 | } 89 | 90 | } 91 | -------------------------------------------------------------------------------- /man/PiData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiData} 4 | \alias{PiData} 5 | \alias{print.PiData} 6 | \alias{[[.PiData} 7 | \alias{AddPiData.PiData} 8 | \title{PiData Class} 9 | \usage{ 10 | PiData( 11 | data, 12 | type = c("un-specified", "exp.freq", "markers", "ds", "cell.prop", "parent.meta.data"), 13 | ident, 14 | method = NULL, 15 | param = NULL 16 | ) 17 | 18 | \method{print}{PiData}(x, ...) 19 | 20 | \method{[[}{PiData}(x, i) 21 | 22 | \method{AddPiData}{PiData}(x, value) 23 | } 24 | \arguments{ 25 | \item{data}{Analysis data. Depending on the type of the analysis, \code{data} can be a list or data.frame} 26 | 27 | \item{type}{A character string indicating the type of the analysis ("un-specified", "exp.freq", "markers", "ds", "cell.prop", or "parent.meta.data")} 28 | 29 | \item{ident}{Name for the identity data} 30 | 31 | \item{method}{A character string describing the analysis method} 32 | 33 | \item{param}{Additional descriptions of the analysis parameters} 34 | 35 | \item{x}{A PiData object} 36 | 37 | \item{...}{Additional arguments} 38 | 39 | \item{i}{Index for the list element to be extracted} 40 | 41 | \item{value}{A \code{PiData} object} 42 | } 43 | \description{ 44 | PiData class is the most fundamental class for Ragas analysis, which is the parent class for \code{\link[Ragas]{PiExpFreqData}}, \code{\link[Ragas]{PiMarkerData}}, 45 | \code{\link[Ragas]{PiDSData}}, \code{\link[Ragas]{PiCellPropData}}, and \code{\link[Ragas]{PiParentMetaData}}. When multiple analyses of the same type have been performed, 46 | A \code{\link[Ragas]{PiDataList}} object will be created, which assembles several \code{PiData} objects of the same analysis/data type into one list. 47 | A \code{\link[Ragas]{Pi}} object consists of different types of \code{PiDataList}. 48 | } 49 | \seealso{ 50 | Other related classes: \code{\link[Ragas]{PiExpFreqData}}, \code{\link[Ragas]{PiMarkerData}}, 51 | \code{\link[Ragas]{PiDSData}}, \code{\link[Ragas]{PiCellPropData}}, \code{\link[Ragas]{PiParentMetaData}}, and 52 | \code{\link[Ragas]{PiDataList}}. 53 | } 54 | -------------------------------------------------------------------------------- /man/PiDataList.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiDataList} 4 | \alias{PiDataList} 5 | \alias{CheckPiData.PiDataList} 6 | \alias{print.PiDataList} 7 | \alias{[[.PiDataList} 8 | \alias{AddPiData.PiDataList} 9 | \title{PiDataList Class} 10 | \usage{ 11 | PiDataList(...) 12 | 13 | \method{CheckPiData}{PiDataList}(x, seurat.obj, ...) 14 | 15 | \method{print}{PiDataList}(x, ...) 16 | 17 | \method{[[}{PiDataList}(x, i) 18 | 19 | \method{AddPiData}{PiDataList}(x, value) 20 | } 21 | \arguments{ 22 | \item{...}{\code{\link[Ragas]{PiData}} objects or additional parameters to \code{PiDataList} methods} 23 | 24 | \item{x}{A PiDataList object} 25 | 26 | \item{seurat.obj}{A Seurat object} 27 | 28 | \item{i}{Index for the list element to be extracted} 29 | 30 | \item{value}{A \code{PiData} object} 31 | } 32 | \description{ 33 | PiDataList is a simple list of \code{\link[Ragas]{PiData}} objects 34 | } 35 | -------------------------------------------------------------------------------- /man/PiExpFreqData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiExpFreqData} 4 | \alias{PiExpFreqData} 5 | \alias{CheckPiData.PiExpFreqData} 6 | \alias{print.PiExpFreqData} 7 | \alias{[[.PiExpFreqData} 8 | \title{PiExpFreqData Class} 9 | \usage{ 10 | PiExpFreqData(data, ident, group = NULL, cutoff = 0) 11 | 12 | \method{CheckPiData}{PiExpFreqData}(x, seurat.obj) 13 | 14 | \method{print}{PiExpFreqData}(x, ...) 15 | 16 | \method{[[}{PiExpFreqData}(x, i) 17 | } 18 | \arguments{ 19 | \item{data}{A list containing per-gene expression frequencies for each identity class} 20 | 21 | \item{ident}{Name for the identity data} 22 | 23 | \item{group}{Factor name to group cells by} 24 | 25 | \item{cutoff}{Log-expression cutoff (default: 0)} 26 | 27 | \item{x}{A PiExpFreqData object} 28 | 29 | \item{seurat.obj}{A Seurat object} 30 | 31 | \item{...}{Additional arguments} 32 | 33 | \item{i}{Index for the list element to be extracted} 34 | } 35 | \description{ 36 | The PiExpFreqData inherts \code{\link[Ragas]{PiData}} class, which is used to store per gene expression frequency data calculated by \code{\link[Ragas]{CalculateExpFreqs}}. 37 | } 38 | \examples{ 39 | \dontrun{ 40 | ## Calculate gene expression frequency and construct a PiExpFreqData object 41 | res <- CalculateExpFreqs(csle.bcell.small, 42 | ident = "seurat_clusters", 43 | group.by = NULL, 44 | cutoff = 0) 45 | ef <- PiExpFreqData(data = res, 46 | ident = "seurat_clusters", 47 | group = NULL, 48 | cutoff = 0) 49 | 50 | ## Print object 51 | ef 52 | 53 | ## Check object validity 54 | CheckPiData(ef, seurat.obj = csle.bcell.small) 55 | 56 | ## Add PiExpFreqData object to an existing Pi object 57 | my.pi <- CreatePostIntegrationObject(csle.bcell.small) ## a minimum Pi object 58 | my.pi <- AddPiData(my.pi, ef) 59 | } 60 | 61 | } 62 | -------------------------------------------------------------------------------- /man/PiMarkerData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiMarkerData} 4 | \alias{PiMarkerData} 5 | \alias{CheckPiData.PiMarkerData} 6 | \alias{print.PiMarkerData} 7 | \alias{[[.PiMarkerData} 8 | \title{PiMarkerData Class} 9 | \usage{ 10 | PiMarkerData( 11 | data, 12 | ident, 13 | method = c("AllMarkers"), 14 | test.use, 15 | latent.vars = NULL 16 | ) 17 | 18 | \method{CheckPiData}{PiMarkerData}(x, seurat.obj) 19 | 20 | \method{print}{PiMarkerData}(x, ...) 21 | 22 | \method{[[}{PiMarkerData}(x, i) 23 | } 24 | \arguments{ 25 | \item{data}{A data.frame containing output from \code{\link[Ragas]{RunFindAllMarkers}}} 26 | 27 | \item{ident}{Name for the identity data} 28 | 29 | \item{method}{A character string describing the analysis method} 30 | 31 | \item{test.use}{Which test to use. See details in \code{\link[Seurat]{FindAllMarkers}}} 32 | 33 | \item{latent.vars}{Latent variables to test. See details in \code{\link[Seurat]{FindAllMarkers}}} 34 | 35 | \item{x}{A PiMarkerData object} 36 | 37 | \item{seurat.obj}{A Seurat object} 38 | 39 | \item{...}{Additional arguments} 40 | 41 | \item{i}{Index for the list element to be extracted} 42 | } 43 | \description{ 44 | The PiMarkerData inherts \code{\link[Ragas]{PiData}} class, which stores marker data from \code{\link[Ragas]{RunFindAllMarkers}}. 45 | } 46 | \examples{ 47 | \dontrun{ 48 | ## Run marker analysis and construct a PiMarkerData object 49 | res <- RunFindAllMarkers(csle.bcell.small, 50 | ident = "seurat_clusters", 51 | test.use = "wilcox", 52 | latent.vars = NULL) 53 | mk <- PiMarkerData(data = res, 54 | ident = "seurat_clusters", 55 | method = "AllMarkers", 56 | test.use = "wilcox", 57 | latent.vars = NULL) 58 | ## Print object 59 | mk 60 | 61 | ## Check object validity 62 | CheckPiData(mk, seurat.obj = csle.bcell.small) 63 | 64 | ## Add PiMarkerData object to an existing Pi object 65 | my.pi <- CreatePostIntegrationObject(csle.bcell.small) ## a minimum Pi object 66 | my.pi <- AddPiData(my.pi, mk) 67 | } 68 | 69 | } 70 | -------------------------------------------------------------------------------- /man/PiParentMetaData.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/Pi.R 3 | \name{PiParentMetaData} 4 | \alias{PiParentMetaData} 5 | \alias{CheckPiData.PiParentMetaData} 6 | \alias{print.PiParentMetaData} 7 | \alias{[[.PiParentMetaData} 8 | \title{PiParentMetaData Class} 9 | \usage{ 10 | PiParentMetaData(data, parent.name) 11 | 12 | \method{CheckPiData}{PiParentMetaData}(x, seurat.obj) 13 | 14 | \method{print}{PiParentMetaData}(x, ...) 15 | 16 | \method{[[}{PiParentMetaData}(x, i) 17 | } 18 | \arguments{ 19 | \item{data}{A data.frame for metadata} 20 | 21 | \item{parent.name}{Name of the parent object} 22 | 23 | \item{x}{A PiParentMetaData object} 24 | 25 | \item{seurat.obj}{A Seurat object} 26 | 27 | \item{...}{Additional arguments} 28 | 29 | \item{i}{Index for the list element to be extracted} 30 | } 31 | \description{ 32 | The PiParentMetaData inherts \code{\link[Ragas]{PiData}} class, which stores metadata of the parent Seurat object. 33 | } 34 | \examples{ 35 | \dontrun{ 36 | ## Construct a PiParentMetaData object from the parent Seurat object csle.pbmc.small 37 | pm <- PiParentMetaData(data = csle.pbmc.small[[]], 38 | parent.name = "csle.pbmc.small") 39 | 40 | ## Print object 41 | pm 42 | 43 | ## Check object validity 44 | ## Cells in Seurat object csle.bcell.small is a subset of cells from its PBMC parent 45 | CheckPiData(pm, csle.bcell.small) 46 | 47 | ## Add PiParentMetaData object to an existing Pi object 48 | my.pi <- CreatePostIntegrationObject(csle.bcell.small) ## a minimum Pi object 49 | my.pi <- AddPiData(my.pi, pm) 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /man/ProportionPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/ProportionPlot.R 3 | \name{ProportionPlot} 4 | \alias{ProportionPlot} 5 | \title{Run Cell Proportion Analysis and Make Plots} 6 | \usage{ 7 | ProportionPlot( 8 | object, 9 | var.group, 10 | method = "unpooled", 11 | plot.all = TRUE, 12 | colors = NULL, 13 | prop.by = "cluster", 14 | split.by = NULL, 15 | parent.meta = parent.meta, 16 | unpool.plot.type = "boxplot", 17 | var.unpool, 18 | n.col = 5, 19 | plot.p.sig = TRUE, 20 | plot.p.adj.sig = FALSE, 21 | title.text.size = 18, 22 | axis.title.size = 15, 23 | axis.text.size = 12, 24 | axis.text.angle = 90, 25 | axis.text.hjust = 0, 26 | axis.text.vjust = 0, 27 | legend.title.size = 15, 28 | legend.text.size = 12, 29 | point.size = 1, 30 | sig.size = 8, 31 | sig.bracket.color = "gray50", 32 | sig.color = "gray50", 33 | sig.bracket.width = 0.5, 34 | random.col.seed = 1 35 | ) 36 | } 37 | \arguments{ 38 | \item{object}{A Seurat object} 39 | 40 | \item{var.group}{Name of the metadata column to group cells by} 41 | 42 | \item{method}{Method for cell proportion analysis: either "unpooled" or "pooled"} 43 | 44 | \item{plot.all}{Whether to add proportion for all cells. Only applicable to pooled method (default: TRUE)} 45 | 46 | \item{colors}{Colors for the plotting group} 47 | 48 | \item{prop.by}{Choose one of the two methods to calculate pooled cell proportion: by "cluster" or "group"} 49 | 50 | \item{split.by}{Name of the metadata column to split the pooled proportion plot by (optional)} 51 | 52 | \item{parent.meta}{Meta data inherited from the parent object} 53 | 54 | \item{unpool.plot.type}{Method for the unpooled plot: either boxplot or barplot} 55 | 56 | \item{var.unpool}{Name of the secondary grouping variable from the metadata column, such as sample name} 57 | 58 | \item{n.col}{Number of columns per plot (default: 5)} 59 | 60 | \item{plot.p.sig}{Whether to highlight tests with significant raw p-values} 61 | 62 | \item{plot.p.adj.sig}{Whether to highlight tests with significant adjusted p-values} 63 | 64 | \item{title.text.size}{Text size for plot title} 65 | 66 | \item{axis.title.size}{Axis title size} 67 | 68 | \item{axis.text.size}{Axis text size} 69 | 70 | \item{axis.text.angle}{Rotation of axis text} 71 | 72 | \item{axis.text.hjust}{Horizontal justification (in [0, 1]) for axis text} 73 | 74 | \item{axis.text.vjust}{Vertical justification (in [0, 1]) for axis text} 75 | 76 | \item{legend.title.size}{Legend title size} 77 | 78 | \item{legend.text.size}{Legend text size} 79 | 80 | \item{point.size}{Point size for box plot} 81 | 82 | \item{sig.size}{Asterisk size for significant tests} 83 | 84 | \item{sig.bracket.color}{Bracket color for significant tests} 85 | 86 | \item{sig.color}{Asterisk color for significant tests} 87 | 88 | \item{sig.bracket.width}{Bracket width for significant tests} 89 | 90 | \item{random.col.seed}{Set seed to control colors} 91 | } 92 | \description{ 93 | An internal function to run pooled or unpooled proportion analysis and make bar plot or box plot. 94 | Use its wrapper function \code{\link[Ragas]{RunProportionPlot}} for plotting. 95 | } 96 | \keyword{internal} 97 | -------------------------------------------------------------------------------- /man/RunAnnotatedDotPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunAnnotatedDotPlot.R 3 | \name{RunAnnotatedDotPlot} 4 | \alias{RunAnnotatedDotPlot} 5 | \title{Run Annotated DotPlot for Seurat or post-integration (Pi) object} 6 | \usage{ 7 | RunAnnotatedDotPlot( 8 | object, 9 | assay = NULL, 10 | group.by = "seurat_clusters", 11 | annotations = NULL, 12 | annotation.cols = NULL, 13 | features = NULL, 14 | cols = c("lightgrey", "blue"), 15 | split.by = NULL, 16 | clust.row = TRUE, 17 | clust.column = FALSE, 18 | column.fontsize = 12, 19 | row.fontsize = 12, 20 | legend.label.fontsize = 13, 21 | legend.title.fontsize = 15, 22 | random.col.seed = 42, 23 | ... 24 | ) 25 | } 26 | \arguments{ 27 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 28 | 29 | \item{assay}{Name of the assay to use (default: the active assay as indicated by \code{\link[Seurat]{DefaultAssay}})} 30 | 31 | \item{group.by}{A factor that contains identity information to group the cells by (default: seurat_clusters)} 32 | 33 | \item{annotations}{User defined annotations in one of the following two formats: 34 | \itemize{ 35 | \item{list} : a named list object. Each list element is a character vector of a group of features; the name of the list element will be extracted to represent the feature group 36 | \item{data.frame} : a data.frame with two columns: "features" and "annotation" 37 | }} 38 | 39 | \item{annotation.cols}{Colors for feature annotations. Needs to be a character vector (preferably a named vector with its names matching the "annotations" argument. See example below) of the same length as annotation feature groups; will be automatically assigned with random colors if set to NULL} 40 | 41 | \item{features}{a list of features/genes to plot without annotations. Will be ignored if argument annotations is set} 42 | 43 | \item{cols}{Colors to plot. Same as the "cols" argument of \code{\link[Seurat]{DotPlot}} (default: c("lightgrey", "blue"))} 44 | 45 | \item{split.by}{Factor to split the groups by. Same as the "split.by" argument of \code{\link[Seurat]{DotPlot}}} 46 | 47 | \item{clust.row}{Whether to cluster the rows/identities (default: TRUE)} 48 | 49 | \item{clust.column}{Whether to cluster the columns/features (default: FALSE)} 50 | 51 | \item{column.fontsize}{Size of column text (default: 12)} 52 | 53 | \item{row.fontsize}{Size of row text (default: 12)} 54 | 55 | \item{legend.label.fontsize}{Size of the legend labels (default: 13)} 56 | 57 | \item{legend.title.fontsize}{Size of the legend title (default: 15)} 58 | 59 | \item{random.col.seed}{Set seed to control colors} 60 | 61 | \item{...}{Extra parameters passed to DotPlot} 62 | } 63 | \value{ 64 | A \code{\link[ggplot2]{ggplot}} object 65 | } 66 | \description{ 67 | A wrapper function for \code{\link[Ragas]{AnnotatedDotPlot}} 68 | } 69 | \examples{ 70 | \dontrun{ 71 | my.list <- list(Monocytes = c("CD14","FCGR3A"), 72 | B = "MS4A1", 73 | T = c("CCR7", "CD8A"), 74 | NK = "NKG7") 75 | RunAnnotatedDotPlot(object = csle.pbmc.pi, 76 | annotation.cols = c( 'Monocytes'= 'tomato', 'B' = 'seagreen', 'T' = 'steelblue', 'NK' = 'purple'), 77 | annotations = my.list) 78 | } 79 | 80 | } 81 | \references{ 82 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 83 | } 84 | -------------------------------------------------------------------------------- /man/RunDSDotPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunDSDotPlot.R 3 | \name{RunDSDotPlot} 4 | \alias{RunDSDotPlot} 5 | \title{Run DSDotPlot} 6 | \usage{ 7 | RunDSDotPlot( 8 | object, 9 | features = NULL, 10 | exp.freq.key, 11 | ds.key, 12 | p.filter = 0.05, 13 | FC.filter = 2, 14 | exp.freq.filter = 0.1, 15 | filter.by.median.diff = TRUE, 16 | median.diff.filter = 0, 17 | to.adjust = FALSE, 18 | top.n = Inf, 19 | direction = "both", 20 | to.highlight = TRUE, 21 | clust.row = TRUE, 22 | clust.column = FALSE, 23 | verbose = TRUE, 24 | ... 25 | ) 26 | } 27 | \arguments{ 28 | \item{object}{A \code{\link[Ragas]{Pi}} object} 29 | 30 | \item{features}{A list of features/genes to plot} 31 | 32 | \item{exp.freq.key}{A unique identifier to retrieve data from the \code{exp.freq} object. See \code{\link[Ragas]{CalculateExpFreqs}} for more details} 33 | 34 | \item{ds.key}{A unique identifier to retrieve data from the \code{ds} object. See \code{\link[Ragas]{RunPseudobulkAnalysis}} for more details} 35 | 36 | \item{p.filter}{P-Value cutoff for gene filtering (default: 0.05)} 37 | 38 | \item{FC.filter}{Fold change cutoff for gene filtering (default: 2)} 39 | 40 | \item{exp.freq.filter}{Gene expression frequency filtering cutoff (default: 0.1)} 41 | 42 | \item{filter.by.median.diff}{Whether to perform additional filtering based on median CPM differences between groups. This will remove differential genes due to outliers.} 43 | 44 | \item{median.diff.filter}{Median difference filtering cutoff (default: 0)} 45 | 46 | \item{to.adjust}{Whether to perform adjustment for multiple testing (default: FALSE)} 47 | 48 | \item{top.n}{Number of top genes to plot (default: Inf, i.e., all genes passing filtering criteria will be plotted)} 49 | 50 | \item{direction}{Whether to plot "up" or "down" regulated genes, or "both" (default: "both")} 51 | 52 | \item{to.highlight}{Whether to highlight feature/identity pairs that passed the filtering criteria (default: TRUE)} 53 | 54 | \item{clust.row}{Whether to cluster rows (default: TRUE)} 55 | 56 | \item{clust.column}{Whether to cluster columns (default: FALSE)} 57 | 58 | \item{verbose}{Verbosity (default: TRUE)} 59 | 60 | \item{...}{Extra parameters passed to \code{\link[Ragas]{DSDotPlot}} to change plot font and color, etc.} 61 | } 62 | \value{ 63 | A \code{\link[ggplot2]{ggplot}} object 64 | } 65 | \description{ 66 | A wrapper function for \code{\link[Ragas]{DSDotPlot}} 67 | } 68 | \details{ 69 | The input Pi object must have analyzed results in the \code{ds} and \code{exp.freq} fields, which can be accomplished by running \code{\link[Ragas]{RunPseudobulkAnalysis}} 70 | and \code{\link[Ragas]{CalculateExpFreqs}}, respectively. 71 | 72 | Gene filtering will be performed based on significance (i.e., \code{p.filter} and \code{FC.filter}) and expression frequency (\code{exp.freq.filter}). 73 | The purpose of significance filtering is twofold: (1) only features that passed the filtering criteria in at least one of the identity groups (e.g., cell clusters, 74 | in most cases) will be included in the plot; (2) significant features that passed the filtering criteria will be highlighted on their corresponding clusters. 75 | The \code{FC.filter} argument expects un-logged fold-change and a \code{FC.filter} of 2 can mean a two-fold expression change for both up or down-regulation. 76 | If \code{top.n} is set to a number other than Inf, only the top genes will be plotted. 77 | 78 | If the argument \code{features} is set, all valid features (i.e., exist in the Seurat object) will be plotted in the figure regardless of their significance. However, only features 79 | passed the filtering criteria will be highlighted. 80 | } 81 | \examples{ 82 | \dontrun{ 83 | RunDSDotPlot(object = csle.bcell.pi, 84 | exp.freq.key = "ExpFreq|cluster.annotation|cutoff=0", 85 | ds.key = "DS|cluster.annotation|edgeR|group=Groups;sample=Names;gp1=cSLE;gp2=cHD;contrast=cSLE-cHD", 86 | p.filter = 0.05) 87 | 88 | } 89 | } 90 | \references{ 91 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 92 | } 93 | -------------------------------------------------------------------------------- /man/RunDimPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunDimPlot.R 3 | \name{RunDimPlot} 4 | \alias{RunDimPlot} 5 | \title{Run DimPlot} 6 | \usage{ 7 | RunDimPlot( 8 | object, 9 | group.by = "seurat_clusters", 10 | reduction = "umap", 11 | label = TRUE, 12 | repel = TRUE, 13 | pt.size = 0.1, 14 | label.size = 3, 15 | random.col.seed = 42, 16 | cols = NULL, 17 | ggrepel.max.overlaps = Inf, 18 | ... 19 | ) 20 | } 21 | \arguments{ 22 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 23 | 24 | \item{group.by}{Name of the metadata column to group (color) cells by (default: seurat_clusters)} 25 | 26 | \item{reduction}{Which dimension reduction to use (default: umap)} 27 | 28 | \item{label}{Whether to show the label of clusters (default: TRUE)} 29 | 30 | \item{repel}{Whether to repel labels (default: TRUE)} 31 | 32 | \item{pt.size}{Plot point size (default: 0.1)} 33 | 34 | \item{label.size}{Label size (default: 3)} 35 | 36 | \item{random.col.seed}{Set seed to control colors} 37 | 38 | \item{cols}{User-defined colors. When cols is set, random.col.seed will be ignored} 39 | 40 | \item{ggrepel.max.overlaps}{Adjust overlap for ggrepel (default: Inf)} 41 | 42 | \item{...}{Extra parameters passed to DimPlot} 43 | } 44 | \value{ 45 | A \code{\link[ggplot2]{ggplot}} object 46 | } 47 | \description{ 48 | Run DimPlot for Seurat or post-integration (Pi) object 49 | } 50 | \details{ 51 | Wrapper functiuon for \code{\link[Seurat]{DimPlot}} that is enhanced to: (1) uses \code{\link[randomcoloR]{distinctColorPalette}} to generate random colors; 52 | (2) allows adjustment of overlap among identity labels. By default, column \code{seurat_clusters} from the metadata 53 | will be by assigned as \code{group.by}. 54 | } 55 | \examples{ 56 | \dontrun{ 57 | ## default, use "seurat_clusters" to group cells 58 | RunDimPlot(object = csle.pbmc.pi) 59 | 60 | ## use subcluster identities and re-projected UMAP 61 | RunDimPlot(object = csle.pbmc.pi, group.by = "subcluster_idents", reduction = "rp", label.size = 5, pt.size = 1) 62 | } 63 | } 64 | \references{ 65 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 66 | 67 | H. Wickham. ggplot2: Elegant Graphics for Data Analysis. Springer-Verlag New York, 2016. 68 | 69 | Ron Ammar (2019). randomcoloR: Generate Attractive Random Colors. R package version 1.1.0.1.https://CRAN.R-project.org/package=randomcoloR 70 | } 71 | -------------------------------------------------------------------------------- /man/RunExpressionPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunExpressionPlot.R 3 | \name{RunExpressionPlot} 4 | \alias{RunExpressionPlot} 5 | \title{Run Expression Plot} 6 | \usage{ 7 | RunExpressionPlot( 8 | object, 9 | feature = NULL, 10 | assay = "RNA", 11 | group.by = NULL, 12 | split.by = NULL, 13 | ident = "seurat_clusters", 14 | ds.key = NULL, 15 | plot.ds.p.value = FALSE, 16 | plot.ds.adjp.value = FALSE, 17 | colors = NULL, 18 | random.col.seed = 1, 19 | point.size = 1, 20 | axis.text.size = 12, 21 | axis.text.angle = 90, 22 | axis.text.hjust = 0, 23 | axis.text.vjust = 0, 24 | axis.title.size = 15, 25 | legend.text.size = 12, 26 | legend.title.size = 15, 27 | sig.size = 8, 28 | sig.bracket.color = "gray50", 29 | sig.color = "gray50", 30 | sig.bracket.width = 0.5 31 | ) 32 | } 33 | \arguments{ 34 | \item{object}{A Seurat object or a \code{\link[Ragas]{Pi}} object} 35 | 36 | \item{feature}{Gene name} 37 | 38 | \item{assay}{Name of the assay to use (default: "RNA")} 39 | 40 | \item{group.by}{Name of metadata column to group cells by} 41 | 42 | \item{split.by}{Name of the metadata column to split expression by (optional)} 43 | 44 | \item{ident}{Cell identity variable (default: seurat_clusters)} 45 | 46 | \item{ds.key}{A named list with unique identifier to retrieve data from the \code{ds} object. List names must be of format group1_group2 where group1 and group2 are groups in the split.by argument. See \code{\link[Ragas]{RunPseudobulkAnalysis}} for more details to create ds object.} 47 | 48 | \item{plot.ds.p.value}{TRUE/FALSE if p-value from differential testing should be plotted (default: FALSE)} 49 | 50 | \item{plot.ds.adjp.value}{TRUE/FALSE if adjusted p-value from differential testing should be plotted (default: FALSE)} 51 | 52 | \item{colors}{Colors for plotting. Number of colors must be the equal to number of idents or the number of groups if split.by is used (optional)} 53 | 54 | \item{random.col.seed}{Set seed to control colors} 55 | 56 | \item{point.size}{Point size for box plot} 57 | 58 | \item{axis.text.size, legend.text.size}{Text size for axis or legend (default: 12)} 59 | 60 | \item{axis.title.size, legend.title.size}{Title size for axis or legend (default: 15)} 61 | 62 | \item{sig.size}{Asterisk size for significant tests} 63 | 64 | \item{sig.bracket.color}{Bracket color for significant tests} 65 | 66 | \item{sig.color}{Asterisk color for significant tests} 67 | 68 | \item{sig.bracket.width}{Bracket width for significant tests} 69 | } 70 | \value{ 71 | A \code{\link[ggplot2]{ggplot}} object will be returned 72 | } 73 | \description{ 74 | A wrapper function for \code{\link[Ragas]{ExpressionPlot}} 75 | } 76 | \details{ 77 | Plot expression levels of gene per identity class. The average expression level is calculated by the \code{group.by} argument. If \code{split.by} is set, plot will be 78 | further separated by data defined by the \code{split.by} argument. 79 | 80 | To provide user-defined colors, a vector of colors is required. Number of colors must be equal to number of idents or 81 | number of groups if \code{split.by} is used. 82 | } 83 | \examples{ 84 | \dontrun{ 85 | # Seurat input and user defined colors 86 | library(scales) 87 | cols <- hue_pal()(length(levels(csle.pbmc.small$Groups))) 88 | RunExpressionPlot(object = csle.pbmc.small, 89 | feature = "ISG15", 90 | ident = "cluster.annotation", 91 | group.by = "Names", 92 | split.by = "Groups", 93 | colors = cols) 94 | 95 | # Pi input without ds p-value 96 | RunExpressionPlot(object = csle.pbmc.pi, 97 | feature = "ISG15", 98 | ident = "subcluster_idents", 99 | group.by = "Names", 100 | split.by = "Groups") 101 | 102 | # Pi input with ds p-value 103 | RunExpressionPlot(object = csle.pbmc.pi, 104 | feature = "ISG15", 105 | ident = "subcluster_idents", 106 | group.by = "Names", 107 | ds.key = list(cSLE_cHD = "DS|subcluster_idents|edgeR|group=Groups;sample=Names;gp1=cSLE;gp2=cHD;contrast=cSLE-cHD"), 108 | plot.ds.p.value = TRUE, 109 | plot.ds.adjp.value = FALSE, 110 | split.by = "Groups") 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /man/RunFindAllMarkers.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunFindAllMarkers.R 3 | \name{RunFindAllMarkers} 4 | \alias{RunFindAllMarkers} 5 | \title{Run FindAllMarkers from Seurat} 6 | \usage{ 7 | RunFindAllMarkers( 8 | object, 9 | ident = "seurat_clusters", 10 | test.use = "wilcox", 11 | latent.vars = NULL, 12 | future.strategy = "multisession", 13 | future.workers = 1, 14 | future.globals.maxSize.MB = 1000, 15 | ... 16 | ) 17 | } 18 | \arguments{ 19 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 20 | 21 | \item{ident}{Name of the metadata column used as cell identity (default: seurat_clusters)} 22 | 23 | \item{test.use}{Which test to use. See details in \code{\link[Seurat]{FindAllMarkers}} (default: wilcox)} 24 | 25 | \item{latent.vars}{Latent variables to test. See details in \code{\link[Seurat]{FindAllMarkers}}} 26 | 27 | \item{future.strategy}{Parallelization strategies. See \code{\link[future]{plan}} for more details (default: "multisession)} 28 | 29 | \item{future.workers}{Number of parallelizations (default: 1)} 30 | 31 | \item{future.globals.maxSize.MB}{Maximum allowed total size (in Megabyte) of global variables. See \code{\link[future]{future.options}} (default: 1000)} 32 | 33 | \item{...}{Additional parameters passed to \code{\link[Seurat]{FindAllMarkers}}} 34 | } 35 | \value{ 36 | If \code{object} is a Seurat object, a matrix containing markers and their associated statistics will be returned 37 | (see \code{\link[Seurat]{FindMarkers}} for more details); If \code{object} is a Pi object, a \code{\link[Ragas]{PiMarkerData}} object containing 38 | the marker result matrix will be created and attached to the \code{markers} field. 39 | } 40 | \description{ 41 | This is a wrapper function to run \code{\link[Seurat]{FindAllMarkers}} function on Seurat or Pi object 42 | } 43 | \examples{ 44 | \dontrun{ 45 | my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small) ## a minimum Pi object 46 | my.pi <- RunFindAllMarkers(object = my.pi) 47 | } 48 | 49 | } 50 | \references{ 51 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 52 | } 53 | -------------------------------------------------------------------------------- /man/RunMatrixPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunMatrixPlot.R 3 | \name{RunMatrixPlot} 4 | \alias{RunMatrixPlot} 5 | \title{Run Matrix Plot} 6 | \usage{ 7 | RunMatrixPlot( 8 | object, 9 | markers.key, 10 | alt.assay.name = "RNAalt", 11 | top.n = 5, 12 | up.genes = TRUE, 13 | heatmap.cols = NULL, 14 | min.exp = -1.5, 15 | max.exp = 1.5, 16 | column.fontsize = 6, 17 | row.fontsize = 8, 18 | column.anno.cols = NULL, 19 | column.anno.name.fontsize = 10, 20 | column.anno.name.rot = 0, 21 | column.anno.name.just = "left", 22 | legend.label.fontsize = 10, 23 | legend.title.fontsize = 10, 24 | heatmap.width = 20, 25 | heatmap.height = 8 26 | ) 27 | } 28 | \arguments{ 29 | \item{object}{A \code{\link[Ragas]{Pi}} object} 30 | 31 | \item{markers.key}{A unique identifier for \code{\link[Ragas]{RunFindAllMarkers}} to pull results from the \code{markers} field} 32 | 33 | \item{alt.assay.name}{Name of the alternative assay to store RC normalized data} 34 | 35 | \item{top.n}{Number of top markers to plot (per identity group)} 36 | 37 | \item{up.genes}{Whether to plot the up-regulated genes (default: TRUE)} 38 | 39 | \item{heatmap.cols}{Colors to plot the heatmap (optional). A character vector with colors for low, medium and high expression.} 40 | 41 | \item{min.exp}{The minimum expression value to plot (default: -1.5)} 42 | 43 | \item{max.exp}{The maximum expression value to plot (default: 1.5)} 44 | 45 | \item{column.fontsize}{Font size for column texts (default: 6)} 46 | 47 | \item{row.fontsize}{Font size for row texts (default: 8)} 48 | 49 | \item{column.anno.cols}{Named character vector with colors for column annotations (default: NULL). Names should match Idents of object.} 50 | 51 | \item{column.anno.name.fontsize}{Font size for column annotations, such as clusters (default: 10)} 52 | 53 | \item{column.anno.name.rot}{Rotation of column annotations (default: 0)} 54 | 55 | \item{column.anno.name.just}{Alignment of column annotations (default: "left")} 56 | 57 | \item{legend.label.fontsize}{Font size for legend label (default: 10)} 58 | 59 | \item{legend.title.fontsize}{Font size for legend title (default: 10)} 60 | 61 | \item{heatmap.width}{Width of the heatmap (default: 20)} 62 | 63 | \item{heatmap.height}{Height of the heatmap (default: 8)} 64 | } 65 | \value{ 66 | A \code{\link[ComplexHeatmap]{Heatmap-class}} object 67 | } 68 | \description{ 69 | A wrapper function for \code{\link[Ragas]{MatrixPlot}} 70 | } 71 | \details{ 72 | This function takes pre-calculated results from the \code{markers} field of the Pi object and plots heatmap of 73 | top genes for each identity group (e.g., cluster). Running \code{\link[Ragas]{RunFindAllMarkers}} is always required prior to run this function, 74 | which will store new \code{\link[Seurat]{FindAllMarkers}} results in the \code{markers} object with a unique identifier. 75 | This unique identifier needs to be passed to the \code{markers.key} argument so the function can pull relevant differential 76 | expression data for plotting. 77 | 78 | A new assay with assay name determined by argument \code{alt.assay.name} will be created, followed by 79 | RC normalization and scaling. When scaling, no variables are regressed out so the scaled expression will be more consistent with that from 80 | \code{\link[Seurat]{FeaturePlot}}. The new assay only contains \code{top.n} genes from each identity group (e.g., clusters, in most cases) to 81 | reduce computational cost. 82 | } 83 | \examples{ 84 | \dontrun{ 85 | ## Run matrix plot for pre-calculated markers in the example data 86 | RunMatrixPlot(csle.pbmc.pi, 87 | markers.key = "Markers|subcluster_idents|AllMarkers|test.use=wilcox", 88 | column.anno.name.rot = 45) 89 | } 90 | 91 | } 92 | \references{ 93 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 94 | 95 | Gu, Z. (2016) Complex heatmaps reveal patterns and correlations in multidimensional genomic data. Bioinformatics. 96 | } 97 | -------------------------------------------------------------------------------- /man/RunProportionPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunProportionPlot.R 3 | \name{RunProportionPlot} 4 | \alias{RunProportionPlot} 5 | \title{Run ProportionPlot} 6 | \usage{ 7 | RunProportionPlot( 8 | object, 9 | group.by, 10 | ident = "seurat_clusters", 11 | method = c("unpooled", "pooled"), 12 | group.colors = NULL, 13 | use.parent.as.ref = FALSE, 14 | parent.meta.data.key = NULL, 15 | return.value = c("stats", "ggplot"), 16 | pooled.prop.by = c("cluster", "group"), 17 | pooled.split.by = NULL, 18 | pooled.add.all = TRUE, 19 | unpool.by = NULL, 20 | unpool.plot.type = c("boxplot", "barplot"), 21 | unpool.ncol = 5, 22 | unpool.plot.p.sig = TRUE, 23 | unpool.plot.p.adj.sig = FALSE, 24 | unpool.pt.szie = 1, 25 | unpool.sig.size = 6, 26 | unpool.sig.bracket.color = "black", 27 | unpool.sig.color = "black", 28 | unpool.sig.bracket.width = 0.5, 29 | title.text.size = 12, 30 | axis.title.size = 12, 31 | axis.text.size = 12, 32 | legend.title.size = 12, 33 | legend.text.size = 12, 34 | axis.text.angle = 90, 35 | axis.text.hjust = 1, 36 | axis.text.vjust = 1, 37 | random.col.seed = 1 38 | ) 39 | } 40 | \arguments{ 41 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 42 | 43 | \item{group.by}{Name of the metadata column to group cells by} 44 | 45 | \item{ident}{Cell identity variable (default: seurat_clusters)} 46 | 47 | \item{method}{Method for cell proportion analysis: either "unpooled" or "pooled" (default: "unpooled")} 48 | 49 | \item{group.colors}{Colors for the plotting group} 50 | 51 | \item{use.parent.as.ref}{Whether to use cell counts from the parent object to calculate cell proportions (default: FALSE)} 52 | 53 | \item{parent.meta.data.key}{A unique identifier to retrieve parent metadata} 54 | 55 | \item{return.value}{Type of the return value (default: "stats")} 56 | 57 | \item{pooled.prop.by}{Choose one of the two methods to calculate pooled cell proportion: by "cluster" or "group" (default: "cluster")} 58 | 59 | \item{pooled.split.by}{Name of the metadata column to split the pooled proportion plot by (optional)} 60 | 61 | \item{pooled.add.all}{Whether to add proportion for all cells (default: TRUE)} 62 | 63 | \item{unpool.by}{Name of the secondary grouping variable from the metadata column, such as sample name} 64 | 65 | \item{unpool.plot.type}{Method for the unpooled plot: either boxplot or barplot (default: "boxplot")} 66 | 67 | \item{unpool.ncol}{Number of columns per plot (default: 5)} 68 | 69 | \item{unpool.plot.p.sig}{Whether to highlight tests with significant raw p-values (default: TRUE)} 70 | 71 | \item{unpool.plot.p.adj.sig}{Whether to highlight tests with significant adjusted p-values (default: FALSE)} 72 | 73 | \item{unpool.sig.size, unpool.sig.bracket.color, unpool.sig.color, unpool.sig.bracket.width}{Additional aesthetic parameters that control highlighting of significant tests} 74 | 75 | \item{title.text.size, axis.title.size, axis.text.size, legend.title.size, legend.text.size}{Text size for plot title, axis, or legend (default: 12)} 76 | 77 | \item{axis.text.angle}{Rotation for axis text (default: 90)} 78 | 79 | \item{axis.text.hjust, axis.text.vjust}{Horizontal/vertical justification (in [0, 1]) for axis text (default: 1)} 80 | 81 | \item{random.col.seed}{Set seed to control colors} 82 | 83 | \item{unpool.pt.size}{Point size for box plot (default: 1)} 84 | } 85 | \value{ 86 | When \code{return.value} is "ggplot", a ggplot object will be returned; when \code{return.value} is "stats" and \code{object} is a Seurat object, 87 | a data summary list is returned. If \code{method} is "pooled", the data summary list only contains cell proportions used for the pooled plot; If \code{method} is "unpooled", 88 | the summary list encloses an additional data.frame summarizing test statistics for cell proportions, 89 | which contains the following 11 columns for all pairwise cell proportion comparisons: 90 | \itemize{ 91 | \item{Cluster} : Name of cell cluster/identity 92 | \item{group1} : Name of group 1 93 | \item{group2} : Name of group 2 94 | \item{estimate1} : Estimated proportion of group1 95 | \item{estimate2} : Estimated proportion of group2 96 | \item{estimate} : Estimated proportion difference, i.e., estimate1 - estimate2 97 | \item{statistic} : Test statistic 98 | \item{p} : P-value 99 | \item{p.adj} : Adjusted P-value (method: "BH") 100 | \item{p.signif} : A Boolean variable indicating whether the a test is significant based on P-value 101 | \item{p.adj.signif} : A Boolean variable indicating whether the a test is significant based on adjusted P-value 102 | } 103 | When \code{return.value} is "stats" and \code{object} is a Pi object, an updated Pi object will be returned: a \code{\link[Ragas]{PiCellPropData}} 104 | object that encloses the summary list will be created and added to the \code{cell.prop} field. 105 | } 106 | \description{ 107 | A wrapper function for \code{\link[Ragas]{ProportionPlot}} 108 | } 109 | \details{ 110 | This function supports two methods for single-cell proportion analysis, namely "pooled" and "unpooled". The pooled method 111 | will pool all cells across all samples and calculate cell proportion per cluster per group (as determined by the argument \code{group.by}). 112 | Only bar plot is applicable for the pooled method. 113 | 114 | For the pooled method, proportions can be calculated by two ways, either by cluster or by group, given by the \code{pooled.prop.by} argument. 115 | If \code{pooled.prop.by} is set to "cluster", proportions of cells per cluster per group will be "normalized" by the total number of cells in each cluster. 116 | In this case, for a given cluster, the proportions of cells from all groups will sum up to 1. This will lead to stacked bar plot for each cluster. 117 | If \code{pooled.prop.by} is set to "group", proportion of cells for per cluster per group will be "normalized" by the total number of cells in each group, combining all cell clusters. 118 | This will lead to grouped bar plots. 119 | 120 | The "unpooled" method is suitable for multi-sample, multi-group study design, where an additional grouping argument \code{unpool.by} will decide how to split cells 121 | into biological replicates. A typical choice for \code{unpool.by} is the metadata column that contains the sample/replicate IDs/names. 122 | Two plotting methods are supported under the unpooled mode: box plot and bar plot. For box plot, T test of cell proportion differences will be performed between all groups 123 | using the \code{\link[rstatix]{t_test}} function and significant proportional differences will be highlighted between corresponding groups; for bar plot, 124 | standard errors will be plotted. 125 | 126 | If \code{use.parent.as.ref} is set to TRUE, cell numbers from the parent object will be use as reference (i.e., denominator) for cell proportion calculation. 127 | This will give users the flexibility to investigate cell proportions for any cluster relative to a given choice of "total population". For example, when 128 | comparing cell proportions of memory CD4 T cells, if \code{use.parent.as.ref} is FALSE, then the derived cell proportion per cluster means percentage of 129 | cells within the total memory CD4 cells; if \code{use.parent.as.ref} is TRUE and a PBMC object is assigned as \code{parent.object} when running 130 | \code{\link[Ragas]{CreatePostIntegrationObject}}, then the calculated percentage means percentage of cell in total PBMC. The \code{use.parent.as.ref} 131 | argument only affect unpooled methods and pooled method with \code{pooled.prop.by} set to "group". 132 | } 133 | \examples{ 134 | \dontrun{ 135 | ## Create a Pi object for b cells and assign parent object to the PBMC 136 | my.pi <- CreatePostIntegrationObject(object = csle.bcell.small, 137 | parent.object = csle.pbmc.small) 138 | 139 | ## pooled, proportion by cluster 140 | my.pi <- RunProportionPlot(my.pi, 141 | ident = "cluster.annotation", 142 | group.by = "Groups", 143 | method = "pooled") 144 | 145 | ## pooled and split, proportion by group 146 | my.pi <- RunProportionPlot(my.pi, 147 | ident = "cluster.annotation", 148 | group.by = "Groups", 149 | method = "pooled", 150 | pooled.prop.by = "group", 151 | pooled.split.by = "Ethnicity") 152 | 153 | ## unpooled, boxplot, use parent (pbmc) to normalize cell counts 154 | my.pi <- RunProportionPlot(my.pi, 155 | ident = "cluster.annotation", 156 | group.by = "Groups", 157 | method = "unpooled", 158 | unpool.by = "Names", 159 | use.parent.as.ref = TRUE) 160 | 161 | ## unpooled, barplot 162 | my.pi <- RunProportionPlot(my.pi, 163 | ident = "cluster.annotation", 164 | group.by = "Groups", 165 | method = "unpooled", 166 | unpool.by = "Names", 167 | unpool.plot.type = "barplot") 168 | 169 | ## Input is a Seurat object, output is a ggplot 170 | RunProportionPlot(csle.bcell.small, 171 | ident = "cluster.annotation", 172 | group.by = "Groups", 173 | method = "unpooled", 174 | unpool.by = "Names", 175 | return.value = "ggplot") 176 | } 177 | 178 | } 179 | \references{ 180 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 181 | } 182 | -------------------------------------------------------------------------------- /man/RunPseudobulkAnalysis.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunPseudobulkAnalysis.R 3 | \name{RunPseudobulkAnalysis} 4 | \alias{RunPseudobulkAnalysis} 5 | \title{Run Pseudobulk Analysis} 6 | \usage{ 7 | RunPseudobulkAnalysis( 8 | object, 9 | ident.var, 10 | group.var, 11 | sample.var, 12 | blocking.var = NULL, 13 | group.1, 14 | group.2, 15 | pbDS.method = c("edgeR", "DESeq2", "limma-trend", "limma-voom"), 16 | pbDS.verbose = TRUE, 17 | pbDS.min.cell = 1, 18 | pbDS.filter = "none", 19 | resDS.bind = "row", 20 | resDS.frq = TRUE, 21 | resDS.cpm = TRUE, 22 | resDS.digits = Inf, 23 | resDS.sep = "__", 24 | calcExprFreqs.assay = "counts", 25 | calcExprFreqs.th = 0, 26 | auto.make.names = TRUE, 27 | verbose = TRUE, 28 | ... 29 | ) 30 | } 31 | \arguments{ 32 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 33 | 34 | \item{ident.var}{Cell identity variable} 35 | 36 | \item{group.var}{Group variable, used to test differential state} 37 | 38 | \item{sample.var}{Sample variable} 39 | 40 | \item{blocking.var}{Additional blocking variable used for batch correction (default: NULL)} 41 | 42 | \item{group.1}{A character string for the case group, must be consistent with the levels of \code{group.var}} 43 | 44 | \item{group.2}{A character string for the ctrl group, must be consistent with the levels of \code{group.var}} 45 | 46 | \item{pbDS.method}{Name of the method for pseudobulk analysis (default: edgeR)} 47 | 48 | \item{pbDS.verbose}{Verbosity of the \code{\link[muscat]{pbDS}} function} 49 | 50 | \item{pbDS.min.cell}{A numeric number that specifies the minimum number of cells required in a given cluster-sample. 51 | See \code{\link[muscat]{pbDS}} for details (default 1)} 52 | 53 | \item{pbDS.filter}{Whether to filter on genes and/or samples. See \code{\link[muscat]{pbDS}} for details (default: "none")} 54 | 55 | \item{resDS.bind, resDS.frq, resDS.cpm, resDS.digits, resDS.sep}{parameters for \code{\link[muscat]{resDS}}} 56 | 57 | \item{calcExprFreqs.assay, calcExprFreqs.th}{parameters for \code{\link[muscat]{calcExprFreqs}}} 58 | 59 | \item{auto.make.names}{Whether to automatically check and make syntactically valid names (default: TRUE)} 60 | 61 | \item{verbose}{Verbosity (default: TRUE)} 62 | 63 | \item{...}{Extra parameters passed to \code{\link[muscat]{pbDS}}} 64 | } 65 | \value{ 66 | When \code{object} is a Seurat object, a list containing the output of \code{\link[muscat]{pbDS}} and \code{\link[muscat]{resDS}} will be returned; 67 | If \code{object} is a Pi object (recommended), an updated Pi object will be returned: a \code{\link[Ragas]{PiDSData}} object that encloses pseudobulk analysis results 68 | will be created and added to the \code{ds} field. 69 | } 70 | \description{ 71 | Run differential state analysis with the \code{muscat} package on 72 | pseudobulk counts for multi-sample, multi-group study design 73 | } 74 | \examples{ 75 | \dontrun{ 76 | my.pi <- CreatePostIntegrationObject(object = csle.pbmc.small) ## a minimum Pi object 77 | my.pi <- RunPseudobulkAnalysis(object = my.pi, 78 | ident.var = "cluster.annotation", 79 | group.var = "Groups", 80 | sample.var = "Names", 81 | group.1 = "cSLE", 82 | group.2 = "cHD") 83 | } 84 | } 85 | \references{ 86 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 87 | 88 | Helena L. Crowell, Pierre-Luc Germain, Charlotte Soneson, Anthony Sonrel and Mark D. Robinson (2020). muscat: Multi-sample 89 | multi-group scRNA-seq data analysis tools. R package version 1.4.0. https://github.com/HelenaLC/muscat 90 | 91 | Ritchie, M.E., Phipson, B., Wu, D., Hu, Y., Law, C.W., Shi, W., and Smyth, G.K. (2015). limma powers differential expression analyses 92 | for RNA-sequencing and microarray studies. Nucleic Acids Research 43(7), e47. 93 | } 94 | -------------------------------------------------------------------------------- /man/RunSankeyPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunSankeyPlot.R 3 | \name{RunSankeyPlot} 4 | \alias{RunSankeyPlot} 5 | \title{Run Sankey Plot} 6 | \usage{ 7 | RunSankeyPlot( 8 | object, 9 | meta.1, 10 | meta.2, 11 | node.colors = NULL, 12 | node.outline.color = "black", 13 | node.text.size = 5, 14 | node.text.color = "black", 15 | node.text.hjust = 0, 16 | node.text.vjust = 0.5, 17 | axis.text.size = 20, 18 | random.col.seed = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{object}{A \code{\link[Ragas]{Pi}} object or Seurat object} 23 | 24 | \item{meta.1}{Name of metadata column to map from} 25 | 26 | \item{meta.2}{Name of metadata column to map to} 27 | 28 | \item{node.colors}{A character vector with colors for the node. The length must be the same as the unique number of items in meta.1 and meta.2} 29 | 30 | \item{node.outline.color}{Color for node outline (default: black)} 31 | 32 | \item{node.text.size}{Text size for node (default: 5)} 33 | 34 | \item{node.text.color}{Color for node text (default: black)} 35 | 36 | \item{node.text.hjust}{Horizontal justification (in [0, 1]) for node text} 37 | 38 | \item{node.text.vjust}{Vertical justification (in [0, 1]) for node text} 39 | 40 | \item{axis.text.size}{Axis text size} 41 | 42 | \item{random.col.seed}{Set seed to control colors} 43 | } 44 | \value{ 45 | A \code{\link[ggplot2]{ggplot}} object 46 | } 47 | \description{ 48 | A wrapper function for \code{\link[Ragas]{SankeyPlot}} 49 | } 50 | \details{ 51 | This function takes 2 metadata column from seurat object and creates a sankey diagram 52 | } 53 | \examples{ 54 | \dontrun{ 55 | ## Sankey plot 56 | RunSankeyPlot(csle.pbmc.pi, 57 | meta.1 = "cluster.annotation", meta.2 = "subcluster_idents") 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /man/RunStackedVlnPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunStackedVlnPlot.R 3 | \name{RunStackedVlnPlot} 4 | \alias{RunStackedVlnPlot} 5 | \title{Run Stacked VlnPLot for Seurat or post-integration (Pi) object} 6 | \usage{ 7 | RunStackedVlnPlot( 8 | object, 9 | assay = "RNA", 10 | ident = "seurat_clusters", 11 | features = NULL, 12 | feature.annotation.cols = NULL, 13 | split.by = NULL, 14 | color.by = "features", 15 | clust.row = FALSE, 16 | clust.column = TRUE, 17 | add.points = FALSE, 18 | points.size = 0.1, 19 | column.fontsize = 12, 20 | row.fontsize = 8, 21 | row.title.fontsize = 15, 22 | legend.fontsize = 12, 23 | legend.title.fontsize = 15, 24 | features.fontsize = 12, 25 | column.names.rotation = 0, 26 | axis.text.hjust = 1, 27 | axis.text.vjust = 1, 28 | fill.colors = NULL, 29 | random.annotation.col.seed = 1 30 | ) 31 | } 32 | \arguments{ 33 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 34 | 35 | \item{assay}{Name of the assay to use (default: "RNA")} 36 | 37 | \item{ident}{Name of the metadata column to be used as cell identity (default: seurat_clusters)} 38 | 39 | \item{features}{User defined feature list in one of the following three formats: 40 | \itemize{ 41 | \item{list} : a named list object. Each list element is a character vector of a group of features; the name of the list element will be extracted to represent the feature group 42 | \item{data.frame}: a data.frame with two columns: "features" and "annotation" 43 | \item{vector} : a character vector of features 44 | }} 45 | 46 | \item{feature.annotation.cols}{A character vector of colors for feature annotation. Its length must equal the number of feature groups provided by the "features" argument. 47 | If the vector is named, its names should match the "features" argument (default: NULL)} 48 | 49 | \item{split.by}{Factor to split the columns by (default: NULL)} 50 | 51 | \item{color.by}{One of the five ways to color for the violin plot: "features", "clusters", "median.exp" (median expression), "mean.exp" (mean expression), "split.var" (the variable that splits the violin plot). 52 | When \code{split.by} is set (not to NULL), \code{color.by} must set to "split.var"; and vice versa. (default: "features")} 53 | 54 | \item{clust.row}{Whether to cluster the rows (default: FALSE)} 55 | 56 | \item{clust.column}{Whether to cluster the columns (default: TRUE)} 57 | 58 | \item{add.points}{Whether to add data points to the plot (default: FALSE)} 59 | 60 | \item{points.size}{Point size (default: 0.1)} 61 | 62 | \item{column.fontsize}{Column font size (default: 12)} 63 | 64 | \item{row.fontsize}{Row font size (default: 8)} 65 | 66 | \item{row.title.fontsize}{Row title font size (default: 15)} 67 | 68 | \item{legend.fontsize}{Legend font size (default: 12)} 69 | 70 | \item{legend.title.fontsize}{Legend title font size (default: 15)} 71 | 72 | \item{features.fontsize}{Feature font size (default: 12)} 73 | 74 | \item{column.names.rotation}{Rotation for column names (default: 0)} 75 | 76 | \item{axis.text.hjust, axis.text.vjust}{Horizontal/vertical justification (in [0, 1]) for axis text (default: 1)} 77 | 78 | \item{fill.colors}{Colors to fill the violin plot when \code{color.by} is set to "median.exp" or "mean.exp"} 79 | 80 | \item{random.annotation.col.seed}{Seed to generate random colors for feature annotations} 81 | } 82 | \value{ 83 | A \code{\link[ggplot2]{ggplot}} object 84 | } 85 | \description{ 86 | A wrapper function for the \code{\link[Ragas]{StackedVlnPlot}} 87 | } 88 | \details{ 89 | The Stacked VlnPlot provides several new functionalities compared to \code{\link[Seurat]{VlnPlot}}: 90 | (1) stacked output when multiple features are provided;(2) allows feature annotation; (3) allows clustering 91 | of rows and/or columns; (4) provides multiple way to color volin plots, see argument \code{color.by} for more details. 92 | } 93 | \examples{ 94 | \dontrun{ 95 | my.list <- list(Monocytes = c("CD14","FCGR3A"), 96 | B = "MS4A1", 97 | T = c("CCR7", "CD8A"), 98 | NK = "NKG7") 99 | 100 | ## Seurat input; split.by is NULL; color by mean expression 101 | RunStackedVlnPlot(csle.pbmc.small, 102 | ident = "cluster.annotation", 103 | features = my.list, 104 | feature.annotation.cols = c( 'Monocytes'= 'tomato', 'B' = 'seagreen', 'T' = 'steelblue', 'NK' = 'purple'), 105 | color.by = "mean.exp", 106 | column.names.rotation = 90) 107 | ## Pi input; split.by is not NULL 108 | RunStackedVlnPlot(csle.pbmc.pi, 109 | ident = "cluster.annotation", 110 | features = my.list, 111 | split.by = "Groups", 112 | color.by = "split.var", 113 | column.names.rotation = 90) 114 | } 115 | 116 | } 117 | \references{ 118 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 119 | } 120 | -------------------------------------------------------------------------------- /man/RunSummarizedHeatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/RunSummarizedHeatmap.R 3 | \name{RunSummarizedHeatmap} 4 | \alias{RunSummarizedHeatmap} 5 | \title{Run Summarized Heatmap for Seurat or post-integration (Pi) object} 6 | \usage{ 7 | RunSummarizedHeatmap( 8 | object, 9 | features, 10 | assay = NULL, 11 | ident = "seurat_clusters", 12 | split.by = NULL, 13 | additional.metadata = NULL, 14 | heatmap.cols = c("cadetblue", "black", "yellow"), 15 | clust.row = TRUE, 16 | clust.column = TRUE, 17 | row.annotation.cols = NULL, 18 | column.annotation.cols = NULL, 19 | show.row.names = TRUE, 20 | show.column.names = TRUE, 21 | min.exp = -2, 22 | max.exp = 2, 23 | column.names.rotation = 90, 24 | row.fontsize = 10, 25 | column.fontsize = 8, 26 | legend.label.fontsize = 10, 27 | legend.title.fontsize = 10, 28 | annotation.name.fontsize = 10, 29 | heatmap.width = 12, 30 | heatmap.height = 10, 31 | random.col.seed = 1, 32 | ... 33 | ) 34 | } 35 | \arguments{ 36 | \item{object}{A Seurat or \code{\link[Ragas]{Pi}} object} 37 | 38 | \item{features}{User defined feature list in one of the following two formats: 39 | \itemize{ 40 | \item{list} : a named list object. Each list element is a character vector of a group of features; the name of the list element will be extracted to represent the feature group 41 | \item{vector} : a character vector of features; no row annotation is applicable so leave \code{row.annotation.cols} to NULL 42 | }} 43 | 44 | \item{assay}{Name of the assay to use (default: the active assay as indicated by \code{\link[Seurat]{DefaultAssay}})} 45 | 46 | \item{ident}{Name of the metadata column to be used as cell identity (default: seurat_clusters)} 47 | 48 | \item{split.by}{Factor to split the columns by} 49 | 50 | \item{additional.metadata}{Names of additional metadata used for column annotation} 51 | 52 | \item{heatmap.cols}{Colors for filling the heatmap (default: c("cadetblue","black","yellow"))} 53 | 54 | \item{clust.row, clust.column}{Whether to cluster the rows/columns (default: TRUE)} 55 | 56 | \item{row.annotation.cols}{A named list containing colors for column annotations; If set to NULL, \code{\link[randomcoloR]{distinctColorPalette}} will be used to generate random colors} 57 | 58 | \item{column.annotation.cols}{A character vector containing colors for row annotations; If set to NULL, \code{\link[randomcoloR]{distinctColorPalette}} will be used to generate random colors} 59 | 60 | \item{show.row.names, show.column.names}{Whether to show row/column names (default: TRUE)} 61 | 62 | \item{min.exp, max.exp}{Minimum/maximum scaled expression value to plot (default: -2/2)} 63 | 64 | \item{column.names.rotation}{Rotation for column names (default: 90)} 65 | 66 | \item{row.fontsize, column.fontsize}{Row/column font size (default: 10/8)} 67 | 68 | \item{legend.label.fontsize, legend.title.fontsize, annotation.name.fontsize}{Font sizes for legend label/title and annotation name (default: 10)} 69 | 70 | \item{heatmap.width, heatmap.height}{Width and height of heatmap (default: 12/10)} 71 | 72 | \item{random.col.seed}{Set seed to control row and column annotation colors (default: 1)} 73 | 74 | \item{...}{Extra parameters passed to \code{\link[ComplexHeatmap]{Heatmap}}} 75 | } 76 | \value{ 77 | A \code{\link[ComplexHeatmap]{Heatmap-class}} object 78 | } 79 | \description{ 80 | A wrapper function for \code{\link[Ragas]{SummarizedHeatmap}} 81 | } 82 | \details{ 83 | Plot heatmap summarizing expression levels per identity class. If \code{split.by} is set, the columns of the heatmap will be 84 | further separated by data defined by the \code{split.by} argument. Additional metadata columns are also allowed to be included for column 85 | annotation, provided that their levels are consistent with those of the \code{split.by} argument in a one/multiple (data to split) to one 86 | (additional metadata) relationship. For example, if metadata column "patient" is used to split the columns of the heatmap, additional metadata like "age", 87 | "gender", or "disease group" are allowed since one patient typically has unique values for age, gender, and the disease group; on the other hand, if metadata 88 | "disease group" is used to split the columns, one can no longer add "age", "gender", or "patient" as additional metadata since one level of the disease group 89 | (i.e., healthy) can correspond to multiple patients with difference values for age and gender. 90 | 91 | To provide user-defined colors for column annotations, a named list of color vectors is required, with each of the list element corresponds to annotation data 92 | passed by arguments "ident", "split.by", or "additional.metadata". The list element name for argument "ident" should always be "Cluster", and use the corresponding 93 | metadata column names for annotations provided by "split.by" or "additional.metadata" (see example). 94 | } 95 | \examples{ 96 | \dontrun{ 97 | # Example 1: Seurat input and named list for features 98 | features <- list("T cell" = c("CD8A", "CD8B"), 99 | "ISG" = c("ISG15","ISG20","IFI44L"), 100 | "Housekeeping" = c("ACTB")) 101 | 102 | RunSummarizedHeatmap(object = csle.pbmc.small, 103 | ident = "cluster.annotation", 104 | features = features, 105 | split.by = "Groups") 106 | 107 | # Example 2: a more complex example with more metadata and user-defined column and row annotation color 108 | ## make a small example data set 109 | my.bcell <- subset(csle.bcell.small, subset = Names \%in\% c("cHD1", "CHD2", "cHD3","cSLE1", "cSLE2", "cSLE3")) 110 | my.bcell$Names <- droplevels(my.bcell$Names) 111 | 112 | ## user-defined column annotation color 113 | library(randomcoloR) 114 | cols.cluster <- distinctColorPalette(length(levels(my.bcell$cluster.annotation))); names(cols.cluster) <- levels(my.bcell$cluster.annotation) 115 | cols.name <- distinctColorPalette(length(levels(my.bcell$Names))); names(cols.name) <- levels(my.bcell$Names) 116 | cols.group <- distinctColorPalette(length(levels(my.bcell$Groups))); names(cols.group) <- levels(my.bcell$Groups) 117 | cols.batch <- distinctColorPalette(length(levels(factor(my.bcell$Batch)))); names(cols.batch) <- levels(factor(my.bcell$Batch)) 118 | cols.column.anno <- list("Cluster" = cols.cluster, 119 | "Names" = cols.name, 120 | "Groups" = cols.group, 121 | "Batch" = cols.batch) 122 | ## user-defined row/feature annotation color 123 | features <- list("B cell" = c("TCL1A","ZEB2","CD27","ITGAX"), 124 | "ISG" = c("ISG15","ISG20","IFI44L"), 125 | "Housekeeping" = c("ACTB")) 126 | cols.features <- distinctColorPalette(length(features)) 127 | 128 | RunSummarizedHeatmap(object = my.bcell, 129 | ident = "cluster.annotation", 130 | features = features, 131 | split.by = "Names", 132 | additional.metadata = c("Groups","Batch"), 133 | column.annotation.cols = cols.column.anno, 134 | row.annotation.cols = cols.features ) 135 | 136 | # Example 3: Pi input and vector input for features 137 | features <- c("CD8A","CD8B","ISG15","ISG20","IFI44L","ACTB") 138 | RunSummarizedHeatmap(object = csle.pbmc.pi, 139 | ident = "subcluster_idents", 140 | features = features, 141 | split.by = "Groups") 142 | } 143 | } 144 | \references{ 145 | Gu, Z. (2016) Complex heatmaps reveal patterns and correlations in multidimensional genomic data. Bioinformatics. 146 | } 147 | -------------------------------------------------------------------------------- /man/SankeyPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/SankeyPlot.R 3 | \name{SankeyPlot} 4 | \alias{SankeyPlot} 5 | \title{Make Sankey Plot} 6 | \usage{ 7 | SankeyPlot( 8 | object, 9 | meta.1, 10 | meta.2, 11 | node.colors = NULL, 12 | node.outline.color = "black", 13 | node.text.size = 5, 14 | node.text.color = "black", 15 | node.text.hjust = (-0.05), 16 | node.text.vjust = 0.5, 17 | axis.text.size = 20, 18 | random.col.seed = 1 19 | ) 20 | } 21 | \arguments{ 22 | \item{object}{A \code{\link[Ragas]{Pi}} object or Seurat object} 23 | 24 | \item{meta.1}{Name of metadata column to map from} 25 | 26 | \item{meta.2}{Name of metadata column to map to} 27 | 28 | \item{node.colors}{A character vector with colors for the node. The length must be the same as the unique number of items in meta.1 and meta.2} 29 | 30 | \item{node.outline.color}{Color for node outline (default: black)} 31 | 32 | \item{node.text.size}{Text size for node (default: 5)} 33 | 34 | \item{node.text.color}{Color for node text (default: black)} 35 | 36 | \item{node.text.hjust}{Horizontal justification for node text (default: -0.05)} 37 | 38 | \item{node.text.vjust}{Vertical justification for node text (default: 0.5)} 39 | 40 | \item{axis.text.size}{Axis text size (default: 20)} 41 | 42 | \item{random.col.seed}{Set seed to control colors (default: 1)} 43 | } 44 | \value{ 45 | A \code{\link[ggplot2]{ggplot}} object 46 | } 47 | \description{ 48 | A function to make Sankey plot between metadata columns for Seurat or Pi object. 49 | } 50 | \examples{ 51 | \dontrun{ 52 | SankeyPlot(object = csle.pbmc.pi, meta.1 = 'cluster.annotation', meta.2 = 'subcluster_idents') 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /man/StackedVlnPlot.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/StackedVlnPlot.R 3 | \name{StackedVlnPlot} 4 | \alias{StackedVlnPlot} 5 | \title{Stacked Violin Plot} 6 | \usage{ 7 | StackedVlnPlot( 8 | object, 9 | features, 10 | feature.annotation = NULL, 11 | feature.annotation.cols = NULL, 12 | assay = "RNA", 13 | split.by = NULL, 14 | color.by = "features", 15 | clust.row = FALSE, 16 | clust.column = TRUE, 17 | add.points = FALSE, 18 | points.size = 0.1, 19 | column.fontsize = 12, 20 | row.fontsize = 8, 21 | row.title.fontsize = 15, 22 | legend.fontsize = 12, 23 | legend.title.fontsize = 15, 24 | features.fontsize = 12, 25 | column.names.rotation = 0, 26 | axis.text.hjust = 0.5, 27 | axis.text.vjust = 0.5, 28 | colors = NULL, 29 | random.annotation.col.seed = 1 30 | ) 31 | } 32 | \arguments{ 33 | \item{object}{A Seurat object} 34 | 35 | \item{features}{Features to plot} 36 | 37 | \item{feature.annotation}{Annotation for features} 38 | 39 | \item{feature.annotation.cols}{Annotation color} 40 | 41 | \item{assay}{Name of the assay to use} 42 | 43 | \item{split.by}{Factor to split the columns by} 44 | 45 | \item{color.by}{One of the five ways to color for the violin plot: "features", "clusters", "median.exp" (median expression), "mean.exp" (mean expression), "split.var" (the variable that splits the violin plot). 46 | When \code{split.by} is set (not to NULL), \code{color.by} must set to "split.var"; and vice versa.} 47 | 48 | \item{clust.row, clust.column}{Whether to clusters row and/or columns} 49 | 50 | \item{add.points}{Whether to plot data} 51 | 52 | \item{points.size}{Size for data points} 53 | 54 | \item{column.fontsize, row.fontsize, row.title.fontsize, legend.fontsize, legend.title.fontsize, features.fontsize}{Font size for figure and legend} 55 | 56 | \item{column.names.rotation}{Rotation for column names} 57 | 58 | \item{axis.text.hjust, axis.text.vjust}{Horizontal/vertical justification (in [0, 1]) for axis text (default: 0.5)} 59 | 60 | \item{colors}{The colors to fill the violin plot when \code{color.by} is set to "median.exp" or "mean.exp"} 61 | 62 | \item{random.annotation.col.seed}{Seed to generate random colors for feature annotations} 63 | } 64 | \value{ 65 | A \code{\link[ggplot2]{ggplot}} object 66 | } 67 | \description{ 68 | Main function to plot stacked violin plot 69 | } 70 | \references{ 71 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 72 | } 73 | \keyword{internal} 74 | -------------------------------------------------------------------------------- /man/SummarizedHeatmap.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/SummarizedHeatmap.R 3 | \name{SummarizedHeatmap} 4 | \alias{SummarizedHeatmap} 5 | \title{Summarized Heatmap for Seurat or post-integration (pi) object} 6 | \usage{ 7 | SummarizedHeatmap( 8 | object, 9 | features, 10 | assay = "RNA", 11 | split.by = NULL, 12 | heatmap.cols = NULL, 13 | clust.row = TRUE, 14 | clust.column = FALSE, 15 | row.annotation = NULL, 16 | row.annotation.cols = NULL, 17 | column.annotation = NULL, 18 | column.annotation.cols = NULL, 19 | show.row.names = TRUE, 20 | show.column.names = TRUE, 21 | min.exp = -2, 22 | max.exp = 2, 23 | column.names.rotation = 45, 24 | column.fontsize = 12, 25 | row.fontsize = 12, 26 | legend.label.fontsize = 13, 27 | legend.title.fontsize = 15, 28 | annotation.name.fontsize = 8, 29 | heatmap.width = 12, 30 | heatmap.height = 14, 31 | random.col.seed = 1, 32 | ... 33 | ) 34 | } 35 | \arguments{ 36 | \item{object}{A Seurat or pi object} 37 | 38 | \item{features}{A character vector of features} 39 | 40 | \item{assay}{Name of the assay to use (default: "RNA")} 41 | 42 | \item{split.by}{Factor to split the columns by} 43 | 44 | \item{heatmap.cols}{Colors for filling the heatmap} 45 | 46 | \item{clust.row, clust.column}{Whether to cluster the rows/columns (default: TRUE)} 47 | 48 | \item{row.annotation, column.annotation}{Data.frame for row and column annotation} 49 | 50 | \item{row.annotation.cols, column.annotation.cols}{Colors for row/Column annotations; If set to NULL, \code{link[randomcoloR]{distinctColorPalette}} will be used to generate random colors} 51 | 52 | \item{show.row.names, show.column.names}{Whether to show row/column names (default: TRUE)} 53 | 54 | \item{min.exp, max.exp}{Minimum/maximum scaled expression value to plot (default: -2/2)} 55 | 56 | \item{column.names.rotation}{Rotation for column names (default: 90)} 57 | 58 | \item{row.fontsize, column.fontsize}{Row/column font size (default: 10/8)} 59 | 60 | \item{legend.label.fontsize, legend.title.fontsize, annotation.name.fontsize}{Font sizes for legend label/title and annotation name (default: 10)} 61 | 62 | \item{heatmap.width, heatmap.height}{Width and height of heatmap (default: 12/10)} 63 | 64 | \item{random.col.seed}{Set seed to control row and column annotation colors (default: 1)} 65 | 66 | \item{...}{Extra parameters passed to \code{\link[ComplexHeatmap]{Heatmap}}} 67 | } 68 | \value{ 69 | A \code{\link[ComplexHeatmap]{Heatmap-class}} object 70 | } 71 | \description{ 72 | An internal function to plot heatmap that groups by identity class or additional meta data. Use its wrapper function \code{\link[Ragas]{RunSummarizedHeatmap}} for plotting. 73 | } 74 | \details{ 75 | SummarizedHeatmap takes data from the data slot of the Seurat object for the given features and split the cells 76 | and summarize their average expression per identity (or by identity and additional metadata as determined by the split.by argument) 77 | and scaled across all columns. 78 | } 79 | \references{ 80 | Hao and Hao et al. (2021). “Integrated analysis of multimodal single-cell data.” Cell. doi:10.1016/j.cell.2021.04.048 81 | 82 | Gu, Z. (2016) Complex heatmaps reveal patterns and correlations in multidimensional genomic data. Bioinformatics. 83 | } 84 | \keyword{internal} 85 | -------------------------------------------------------------------------------- /man/csle.bcell.pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.bcell.pi} 5 | \alias{csle.bcell.pi} 6 | \title{An example Pi object built from csle.bcell.small} 7 | \format{ 8 | A \code{\link[Ragas]{Pi}} object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.bcell.pi 15 | } 16 | \description{ 17 | This data contained down-sampled B cells from Nehar-Belaid et al., 2020. 18 | Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.bcell.small}}: 19 | } 20 | \examples{ 21 | \dontrun{ 22 | csle.bcell.pi <- csle.bcell.small \%>\% 23 | CreatePostIntegrationObject(parent.object = csle.pbmc.small) \%>\% 24 | CalculateExpFreqs(ident = "cluster.annotation") \%>\% 25 | RunFindAllMarkers(ident = "cluster.annotation") \%>\% 26 | RunPseudobulkAnalysis(ident.var = "cluster.annotation", 27 | group.var = "Groups", 28 | sample.var = "Names", 29 | group.1 = "cSLE", 30 | group.2 = "cHD") \%>\% 31 | RunProportionPlot(group.by = "Groups", 32 | ident = "cluster.annotation", 33 | method = "unpooled", 34 | unpool.by = "Names", 35 | use.parent.as.ref = TRUE 36 | ) 37 | } 38 | } 39 | \keyword{datasets} 40 | -------------------------------------------------------------------------------- /man/csle.bcell.small.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.bcell.small} 5 | \alias{csle.bcell.small} 6 | \title{A small example of B cell data from child SLE} 7 | \format{ 8 | A Seurat object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.bcell.small 15 | } 16 | \description{ 17 | This object contains down-sampled cells from Nehar-Belaid et al., 2020 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /man/csle.cd4.mem.pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.cd4.mem.pi} 5 | \alias{csle.cd4.mem.pi} 6 | \title{An example Pi object built from csle.cd4.mem.small} 7 | \format{ 8 | A \code{\link[Ragas]{Pi}} object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.cd4.mem.pi 15 | } 16 | \description{ 17 | This data contained down-sampled CD4+ memory T cells from Nehar-Belaid et al., 2020. 18 | Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.cd4.mem.small}}: 19 | } 20 | \examples{ 21 | \dontrun{ 22 | csle.cd4.mem.pi <- csle.cd4.mem.small \%>\% 23 | CreatePostIntegrationObject(parent.object = csle.tcell.small) \%>\% ## use total T cell as reference for later proportion analysis 24 | CalculateExpFreqs(ident = "cluster.annotation") \%>\% 25 | RunFindAllMarkers(ident = "cluster.annotation") \%>\% 26 | RunPseudobulkAnalysis(ident.var = "cluster.annotation", 27 | group.var = "Groups", 28 | sample.var = "Names", 29 | group.1 = "cSLE", 30 | group.2 = "cHD") \%>\% 31 | RunProportionPlot(group.by = "Groups", 32 | method = "unpooled", 33 | unpool.by = "Names", 34 | use.parent.as.ref = TRUE 35 | ) 36 | 37 | } 38 | } 39 | \keyword{datasets} 40 | -------------------------------------------------------------------------------- /man/csle.cd4.mem.small.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.cd4.mem.small} 5 | \alias{csle.cd4.mem.small} 6 | \title{A small example of CD4+ memory T cell data from child SLE} 7 | \format{ 8 | A Seurat object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.cd4.mem.small 15 | } 16 | \description{ 17 | This object contains down-sampled cells from Nehar-Belaid et al., 2020 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /man/csle.pbmc.pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.pbmc.pi} 5 | \alias{csle.pbmc.pi} 6 | \title{An example Pi object built from csle.pbmc.small} 7 | \format{ 8 | A \code{\link[Ragas]{Pi}} object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.pbmc.pi 15 | } 16 | \description{ 17 | This data contained 3000 down-sampled PBMC cells from Nehar-Belaid et al., 2020. 18 | Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.pbmc.small}}: 19 | } 20 | \examples{ 21 | \dontrun{ 22 | ## A list of subclusters to combine 23 | subclusters <- list("B cell" = "csle.bcell.small", "T cell" = "csle.tcell.pi") 24 | 25 | ## UMAP configuration 26 | sc.config <- ConfigureReprojection(type = "sc", "B cell") 27 | sc.config <- ConfigureReprojection(type = "sc", "T cell", umap.name = "rp", append.to = sc.config) 28 | 29 | ## select columns for cell identities 30 | sc.colnames <- c("B cell" = "cluster.annotation", "T cell" = "subcluster_idents") 31 | 32 | ## integrate subclusters 33 | library(dplyr) 34 | csle.pbmc.pi <- csle.pbmc.small \%>\% 35 | CreatePostIntegrationObject(child.object.list = subclusters, 36 | rp.subcluster.umap.config = sc.config, 37 | rp.main.cluster.anno = "cluster.annotation", 38 | rp.subcluster.colname = sc.colnames) \%>\% 39 | CalculateExpFreqs(ident = "subcluster_idents") \%>\% 40 | RunFindAllMarkers(ident = "subcluster_idents") \%>\% 41 | RunPseudobulkAnalysis(ident.var = "subcluster_idents", 42 | group.var = "Groups", 43 | sample.var = "Names", 44 | group.1 = "cSLE", 45 | group.2 = "cHD") \%>\% 46 | RunProportionPlot(group.by = "Groups", 47 | ident = "subcluster_idents", 48 | method = "unpooled", 49 | unpool.by = "Names" 50 | ) 51 | 52 | } 53 | } 54 | \keyword{datasets} 55 | -------------------------------------------------------------------------------- /man/csle.pbmc.small.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.pbmc.small} 5 | \alias{csle.pbmc.small} 6 | \title{A small example of PBMC data from child SLE} 7 | \format{ 8 | A Seurat object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.pbmc.small 15 | } 16 | \description{ 17 | This object contains 3000 down-sampled PBMC cells from Nehar-Belaid et al., 2020 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /man/csle.tcell.pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.tcell.pi} 5 | \alias{csle.tcell.pi} 6 | \title{An example Pi object built from csle.tcell.small} 7 | \format{ 8 | A \code{\link[Ragas]{Pi}} object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.tcell.pi 15 | } 16 | \description{ 17 | This data contained down-sampled T cells from Nehar-Belaid et al., 2020. 18 | Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.tcell.small}}: 19 | } 20 | \examples{ 21 | \dontrun{ 22 | ## A list of T cell subclusters to combine 23 | subclusters <- list("CD4mem" = "csle.cd4.mem.small", "Treg" = "csle.treg.small") 24 | 25 | csle.tcell.pi <- csle.tcell.small \%>\% 26 | CreatePostIntegrationObject(child.object.list = subclusters, 27 | rp.main.cluster.anno = "cluster.annotation", 28 | rp.subcluster.colname = "cluster.annotation", 29 | parent.object = csle.pbmc.small) \%>\% 30 | CalculateExpFreqs(ident = "subcluster_idents") \%>\% 31 | RunFindAllMarkers(ident = "subcluster_idents") \%>\% 32 | RunPseudobulkAnalysis(ident.var = "subcluster_idents", 33 | group.var = "Groups", 34 | sample.var = "Names", 35 | group.1 = "cSLE", 36 | group.2 = "cHD") \%>\% 37 | RunProportionPlot(ident = "subcluster_idents", 38 | group.by = "Groups", 39 | method = "unpooled", 40 | unpool.by = "Names", 41 | use.parent.as.ref = TRUE 42 | ) 43 | 44 | } 45 | } 46 | \keyword{datasets} 47 | -------------------------------------------------------------------------------- /man/csle.tcell.small.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.tcell.small} 5 | \alias{csle.tcell.small} 6 | \title{A small example of T cell data from child SLE} 7 | \format{ 8 | A Seurat object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.tcell.small 15 | } 16 | \description{ 17 | This object contains down-sampled cells from Nehar-Belaid et al., 2020 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /man/csle.treg.pi.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.treg.pi} 5 | \alias{csle.treg.pi} 6 | \title{An example Pi object built from csle.treg.small} 7 | \format{ 8 | A \code{\link[Ragas]{Pi}} object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.treg.pi 15 | } 16 | \description{ 17 | This data contained down-sampled Treg cells from Nehar-Belaid et al., 2020. 18 | Run the example code to re-produce the Pi object from Seurat object \code{\link[Ragas]{csle.treg.small}}: 19 | } 20 | \examples{ 21 | \dontrun{ 22 | csle.treg.pi <- csle.treg.small \%>\% 23 | CreatePostIntegrationObject(parent.object = csle.tcell.small) \%>\% ## use total T cell as reference for later proportion analysis 24 | CalculateExpFreqs(ident = "cluster.annotation") \%>\% 25 | RunFindAllMarkers(ident = "cluster.annotation") \%>\% 26 | RunPseudobulkAnalysis(ident.var = "cluster.annotation", 27 | group.var = "Groups", 28 | sample.var = "Names", 29 | group.1 = "cSLE", 30 | group.2 = "cHD") \%>\% 31 | RunProportionPlot(group.by = "Groups", 32 | method = "unpooled", 33 | unpool.by = "Names", 34 | use.parent.as.ref = TRUE 35 | ) 36 | 37 | } 38 | } 39 | \keyword{datasets} 40 | -------------------------------------------------------------------------------- /man/csle.treg.small.Rd: -------------------------------------------------------------------------------- 1 | % Generated by roxygen2: do not edit by hand 2 | % Please edit documentation in R/data.R 3 | \docType{data} 4 | \name{csle.treg.small} 5 | \alias{csle.treg.small} 6 | \title{A small example of Treg data from child SLE} 7 | \format{ 8 | A Seurat object 9 | } 10 | \source{ 11 | \url{https://www.nature.com/articles/s41590-020-0743-0} 12 | } 13 | \usage{ 14 | csle.treg.small 15 | } 16 | \description{ 17 | This object contains down-sampled cells from Nehar-Belaid et al., 2020 18 | } 19 | \keyword{datasets} 20 | -------------------------------------------------------------------------------- /man/figs/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /man/figs/Ragas.logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/man/figs/Ragas.logo.png -------------------------------------------------------------------------------- /man/figs/sc-parent-child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/man/figs/sc-parent-child.png -------------------------------------------------------------------------------- /vignettes/.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-15-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-15-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-21-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-21-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-23-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-23-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-24-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-24-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-26-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-26-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-28-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-28-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-61-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-61-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-64-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-64-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-65-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-65-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-67-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-67-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-68-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-68-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-70-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-70-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-72-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-72-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-74-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-74-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-76-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-76-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-78-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-78-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-8-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-8-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-80-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-80-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-81-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-81-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-83-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-83-1.png -------------------------------------------------------------------------------- /vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-85-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/CrossCompatibilityExamples_files/figure-gfm/unnamed-chunk-85-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-14-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-14-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-15-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-15-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-17-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-17-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-20-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-20-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-21-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-21-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-22-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-22-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-23-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-23-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-24-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-24-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /vignettes/QuickStart_files/figure-gfm/unnamed-chunk-8-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/QuickStart_files/figure-gfm/unnamed-chunk-8-1.png -------------------------------------------------------------------------------- /vignettes/parent-child-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/parent-child-example.png -------------------------------------------------------------------------------- /vignettes/reprojection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/reprojection.png -------------------------------------------------------------------------------- /vignettes/sc-parent-child.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/sc-parent-child.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-1-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-1-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-10-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-10-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-11-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-11-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-12-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-12-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-13-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-13-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-14-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-14-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-15-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-15-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-16-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-16-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-18-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-18-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-19-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-19-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-2-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-2-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-3-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-3-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-4-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-4-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-5-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-5-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-6-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-6-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-7-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-7-1.png -------------------------------------------------------------------------------- /vignettes/subcluster_files/figure-gfm/unnamed-chunk-9-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jig4003/Ragas/48e0ada8a8af81049ca5534c9358527d3806345d/vignettes/subcluster_files/figure-gfm/unnamed-chunk-9-1.png --------------------------------------------------------------------------------