Skip to content

Commit

Permalink
Add scale_within_batch parameter for Integration_SCP
Browse files Browse the repository at this point in the history
  • Loading branch information
zhanghao-njmu committed Nov 20, 2023
1 parent 29371be commit 048e784
Show file tree
Hide file tree
Showing 11 changed files with 215 additions and 72 deletions.
15 changes: 14 additions & 1 deletion R/SCP-plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -10084,6 +10084,7 @@ CellCorHeatmap <- function(srt_query, srt_ref = NULL, bulk_ref = NULL,
check_R("magick")
}

ref_legend <- TRUE
simil_method <- c(
"cosine", "pearson", "spearman", "correlation", "jaccard", "ejaccard", "dice", "edice",
"hamman", "simple matching", "faith"
Expand All @@ -10104,7 +10105,7 @@ CellCorHeatmap <- function(srt_query, srt_ref = NULL, bulk_ref = NULL,
ref_cell_annotation <- query_cell_annotation
ref_cell_annotation_palette <- query_cell_annotation_palette
ref_cell_annotation_palcolor <- query_cell_annotation_palcolor
ref_cell_annotation_params <- query_cell_annotation_params
ref_legend <- FALSE
}
if (!is.null(bulk_ref)) {
srt_ref <- CreateSeuratObject(counts = bulk_ref, meta.data = data.frame(celltype = colnames(bulk_ref)), assay = "RNA")
Expand Down Expand Up @@ -10257,6 +10258,8 @@ CellCorHeatmap <- function(srt_query, srt_ref = NULL, bulk_ref = NULL,
if (query_group != "All.groups") {
if (isFALSE(query_collapsing) && ((isFALSE(flip) & isTRUE(cluster_rows)) || (isTRUE(flip) & isTRUE(cluster_columns)))) {
query_cell_annotation <- c(query_group, query_cell_annotation)
query_cell_annotation_palette <- c(query_group_palette, query_cell_annotation_palette)
query_cell_annotation_palcolor <- c(list(query_group_palcolor), query_cell_annotation_palcolor %||% list(NULL))
} else {
funbody <- paste0(
"
Expand Down Expand Up @@ -10295,6 +10298,8 @@ CellCorHeatmap <- function(srt_query, srt_ref = NULL, bulk_ref = NULL,
if (ref_group != "All.groups") {
if (isFALSE(ref_collapsing) && ((isFALSE(flip) & isTRUE(cluster_columns)) || (isTRUE(flip) & isTRUE(cluster_rows)))) {
ref_cell_annotation <- c(ref_group, ref_cell_annotation)
ref_cell_annotation_palette <- c(ref_group_palette, ref_cell_annotation_palette)
ref_cell_annotation_palcolor <- c(list(ref_group_palcolor), ref_cell_annotation_palcolor %||% list(NULL))
} else {
funbody <- paste0(
"
Expand Down Expand Up @@ -10675,6 +10680,10 @@ CellCorHeatmap <- function(srt_query, srt_ref = NULL, bulk_ref = NULL,
}
}

if (!isTRUE(ref_legend)) {
lgd <- lgd[grep("Ref", names(lgd), invert = TRUE)]
}

layer_fun <- function(j, i, x, y, w, h, fill) {
if (nlabel > 0) {
if (flip) {
Expand Down Expand Up @@ -12406,6 +12415,10 @@ DynamicPlot <- function(srt, lineages, features, group.by = NULL, cells = NULL,
}
}

GroupTreePlot <- function() {

}

#' Projection Plot
#'
#' This function generates a projection plot, which can be used to compare two groups of cells in a dimensionality reduction space.
Expand Down
228 changes: 160 additions & 68 deletions R/SCP-workflow.R

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions man/BBKNN_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/CSS_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/ComBat_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/Harmony_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 17 additions & 0 deletions man/Integration_SCP.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/MNN_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/Seurat_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions man/Standard_SCP.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/Uncorrected_integrate.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 048e784

Please sign in to comment.