Skip to content

Commit

Permalink
fixed mean_col specification for single sample
Browse files Browse the repository at this point in the history
  • Loading branch information
plger committed Jul 5, 2024
1 parent 7dbbfee commit 8382112
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: epiwraps
Type: Package
Title: epiwraps: Wrappers for plotting and dealing with epigenomics data
Version: 0.99.94
Version: 0.99.95
Date: 2024-05-20
Authors@R: c(
person("Pierre-Luc", "Germain", email="pierre-luc.germain@hest.ethz.ch",
Expand Down
19 changes: 10 additions & 9 deletions R/plotEnrichedHeatmaps.R
Original file line number Diff line number Diff line change
Expand Up @@ -148,19 +148,20 @@ plotEnrichedHeatmaps <- function(ml, trim=c(0.02,0.98), assay=1L,
ml <- lapply(ml, FUN=function(x) t(scale(t(x))))
}
}
mean_gp <- gpar(col="red")

if(is.null(row_split)){
rs <- rep(1L, nrow(ml[[1]]))
}else{
rs <- row_split <- as.factor(row_split)
if(is(mean_color, "gpar")){
mean_gp <- mean_color
}else if(length(mean_color)>1){
if(is.null(names(mean_color)))
stop("When clustering rows, provide the names of the clusters in `mean_color`.")
stopifnot(all(levels(row_split) %in% names(mean_color)))
mean_gp <- gpar(col=mean_color[levels(row_split)])
}
}
mean_gp <- gpar(col="red")
if(is(mean_color, "gpar")){
mean_gp <- mean_color
}else if(length(mean_color)>1){
if(is.null(names(mean_color)))
stop("When clustering rows, provide the names of the clusters in `mean_color`.")
stopifnot(all(levels(row_split) %in% names(mean_color)))
mean_gp <- gpar(col=mean_color[levels(row_split)])
}

if(is.null(multiScale)) multiScale <- is.list(colors)
Expand Down

0 comments on commit 8382112

Please sign in to comment.