Skip to content

Commit

Permalink
averageHeatmap on Seurat V5
Browse files Browse the repository at this point in the history
  • Loading branch information
junjunlab committed Jun 5, 2024
1 parent 0d1c188 commit 50d5344
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 230 deletions.
29 changes: 21 additions & 8 deletions R/averageHeatmap.R
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,29 @@ averageHeatmap <- function(
gene.order = NULL,
...) {
# get cells mean gene expression
mean_gene_exp <- as.matrix(
data.frame(
Seurat::AverageExpression(object,
features = markerGene,
group.by = group.by,
assays = assays,
slot = slot
if(utils::packageVersion("Seurat") > 4){
mean_gene_exp <- as.matrix(
data.frame(
Seurat::AverageExpression(object,
features = markerGene,
group.by = group.by,
assays = assays,
layer = slot
)
)
)
)
}else{
mean_gene_exp <- as.matrix(
data.frame(
Seurat::AverageExpression(object,
features = markerGene,
group.by = group.by,
assays = assays,
slot = slot
)
)
)
}

# add colnames
# name1 <- gsub(
Expand Down
10 changes: 5 additions & 5 deletions R/jjDotPlot.R
Original file line number Diff line number Diff line change
Expand Up @@ -502,13 +502,13 @@ jjDotPlot <- function(
annoPos = "top",
aesGroup = TRUE,
aesGroName = "celltype",
segWidth = 0.8,
lwd = 3, addBranch = TRUE, branDirection = -1,
segWidth = segWidth,
lwd = lwd, addBranch = TRUE, branDirection = -1,
pCol = rep("black", length(unique(celltype_info$cluster))),
addText = TRUE, textRot = 90,
addText = TRUE, textRot = textRot,
textCol = rep("black", length(unique(celltype_info$cluster))),
textSize = 14,
hjust = 0,
textSize = textSize,
hjust = hjust,
...
)
} else {
Expand Down
122 changes: 0 additions & 122 deletions man/AverageHeatmap.Rd

This file was deleted.

95 changes: 0 additions & 95 deletions man/FeatureCornerAxes.Rd

This file was deleted.

0 comments on commit 50d5344

Please sign in to comment.