Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion R/RNAIntegration.R
Original file line number Diff line number Diff line change
Expand Up @@ -478,7 +478,7 @@ addGeneIntegrationMatrix <- function(
colnames(mat) <- as.character(colnames(mat))
#Log-Normalize
mat <- log(mat + 1) #use natural log
seuratATAC <- supressWarninggs(Seurat::CreateSeuratObject(counts = as.matrix(mat[head(seq_len(nrow(mat)), 5), , drop = FALSE])))
seuratATAC <- suppressWarnings(Seurat::CreateSeuratObject(counts = as.matrix(mat[head(seq_len(nrow(mat)), 5), , drop = FALSE])))
seuratATAC[["GeneScore"]] <- Seurat::CreateAssayObject(counts = mat)

#Clean Memory
Expand Down
7 changes: 5 additions & 2 deletions R/VisualizeData.R
Original file line number Diff line number Diff line change
Expand Up @@ -882,11 +882,14 @@ plotGroups <- function(

#adapted from https://github.com/jwdink/egg/blob/master/R/set_panel_size.r
g <- ggplotGrob(p)

legend_indices <- grep("guide-box", g$layout$name)
# ggplot versions > 3.5 can have multiple guide boxes, and are non automatically removed if is a "zeroGrob"
# Do filtering wrt only non "zeroGrob" legends
legend <- legend_indices[sapply(legend_indices, function(idx) class(g$grobs[[idx]])[1] != "zeroGrob")]
if (length(legend_indices) != 0) {
legend <- legend_indices[unlist(lapply(legend_indices, function(idx) class(g$grobs[[idx]])[1] != "zeroGrob"))]
} else {
legend <- legend_indices
}
# add correct ones to legend
if(length(legend)!=0){
gl <- g$grobs[[legend]]
Expand Down