jokergoo / ComplexHeatmap

Make Complex Heatmaps
https://jokergoo.github.io/ComplexHeatmap-reference/book/
Other
1.25k stars 220 forks source link

Segfaults caused when plotting a series of Heatmaps #811

Closed RodrigoGM closed 2 years ago

RodrigoGM commented 2 years ago

Hi @jokergoo,

I'm plotting a relatively fair number of matrices with genome-wide copy number data. I can only get one, maybe two heatmaps out, and then get a segfault (example below). Once I quit, restart, load the objects again, and go straight to where I left off, I can generate the plot. The segfault is produced when creating a series of heatmaps with minor variations e.g. tracks, subsets, annotations, etc. Segfault is also independent of exporting to pdf, png, or to a graphics device. It also occurs in the same fashion in R weather on a Linux server and on my Mac.

Any idea on what could be happening? The issues began with the upgrade to R ≥4.0 and have not gone away with newer versions. Error and session info (at the start of the script prior to segfault) below.

Since the data is heavily reliant on heatmap visualization, I'm finding it difficult to have reproducible images across all samples and data sets.

Any support would be useful, thank you

R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> > if (identical(getOption('pager'), file.path(R.home('bin'), 'pager'))) options(pager='cat') # rather take the ESS one 
> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE)
> source("vignettes/joint_main.R")
✔ Setting active project to '~/project_cnv/'

clusterProfiler v3.18.1  For help: https://guangchuangyu.github.io/software/clusterProfiler

If you use clusterProfiler in published research, please cite:
Guangchuang Yu, Li-Gen Wang, Yanyan Han, Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology. 2012, 16(5):284-287.

Attaching package: ‘clusterProfiler’

The following object is masked from ‘package:lattice’:

    dotplot

The following object is masked from ‘package:purrr’:

    simplify

The following object is masked from ‘package:stats’:

    filter

##############################################################################
Pathview is an open source software package distributed under GNU General
Public License version 3 (GPLv3). Details of GPLv3 is available at
http://www.gnu.org/licenses/gpl-3.0.html. Particullary, users are required to
formally cite the original Pathview paper (not just mention it) in publications
or products. For details, do citation("pathview") within R.

The pathview downloads and uses KEGG data. Non-academic uses may require a KEGG
license agreement (details at http://www.kegg.jp/kegg/legal.html).
########################################<######################################
> tmpDir <- file.path(tmpDir, "TM1")
> figDir <- file.path("case_specific", "TM1", "figures")
> panelDir <- file.path(figDir, "panels")
> sapply(list(tmpDir, figDir, panelDir), usethis::use_directory)
[1] TRUE TRUE TRUE
> data(TM1a)
> ## cnr summary
> summaryCNR(TM1a)
total: 2477
vdj:   1010
number of phenotypes:30
number of bins: 20000
number of genes in index: 33576
number of genes in use: 33576
> data(TM1t)
> gene.tumor.early <- mark.genes(TM1t, gene.tumor.early)
> ##
> gene.tumor.mid <- TM1t$gene.index %>%
+     filter(!seqnames %in% c("X", "Y"),
+            altFQ >= 0.4, altFQ < 0.8,
+            !is.na(oncoKB)) %>%
+     pull(hgnc.symbol)
> gene.tumor.mid <- mark.genes(TM1t, gene.tumor.mid)
> cf <- factor(TM1a$chromInfo$chrom)
> grs <- c("#404040", "#BABABA")
> rp <- ceiling(length(unique(cf))/2)
> chl <- rep(grs, rp)
> chl <- chl[1:length(unique(cf))]
> names(chl) <- unique(cf)
> chrBreaks <- cumsum(table(TM1a$chromInfo$chrom))
> midChr <- chrBreaks - floor((chrBreaks - c(1, chrBreaks[1:(length(chrBreaks) - 1)]))/2)
> ##  Top Chromosome Annotation
> chrTopAnno <- HeatmapAnnotation(
+     labs = anno_mark(at = midChr, side = "top",
+                      labels = unique(cf), labels_rot = 0,
+                      labels_gp = grid::gpar(fontsize = 10)), 
+     chr = cf, col = list(chr = chl), show_legend = FALSE)
> order <- c("U1", paste0("T", c(1, 2, 13, 4, 6,
+                                      7, 3, 16, 14, 11,
+                                      10, 9, 8, 12)))
> all(order %in% colnames(TM1a$DDRC.df))
[1] TRUE
> ##
> TM1_Gene_Mark_Bottom<- HeatmapAnnotation(
+     early.genes = anno_mark(at = gene.tumor.early, side = "bottom",
+                             labels = names(gene.tumor.early),
+                             labels_gp = gpar(fontsize = 8)),
+     mid.genes = anno_mark(at = gene.tumor.mid, side = "bottom",
+                           labels = names(gene.tumor.mid),
+                           labels_gp = gpar(fontsize = 5, fontface = "italic"))
+     )
> ## build top annotation 
> cf <- factor(TM1a$chromInfo$chrom)
> grs <- c("#404040", "#BABABA")
> rp <- ceiling(length(unique(cf))/2)
> chl <- rep(grs, rp)
> chl <- chl[1:length(unique(cf))]
> names(chl) <- unique(cf)
> chrBreaks <- cumsum(table(TM1a$chromInfo$chrom))
> midChr <- chrBreaks - floor((chrBreaks - c(1, chrBreaks[1:(length(chrBreaks) - 1)]))/2)
> ##  Top Chromosome Annotation
> chrTopAnno <- HeatmapAnnotation(
+     labs = anno_mark(at = midChr, side = "top",
+                      labels = unique(cf), labels_rot = 0,
+                      labels_gp = grid::gpar(fontsize = 10)), 
+     chr = cf, col = list(chr = chl), show_legend = FALSE)
> order <- c("U1", paste0("T", c(1, 2, 13, 4, 6,
+                                      7, 3, 16, 14, 11,
+                                      10, 9, 8, 12)))
> all(order %in% colnames(TM1a$DDRC.df))
[1] TRUE
> ##
> TM1_DDRC_Hm <- Heatmap(
+     t(TM1a$DDRC.df[, -c(1:3, ncol(TM1a$DDRC.df))]),
+     row_order = order,
+     border = TRUE,
+     row_title = NULL,
+     row_names_side = "left",
+     top_annotation = chrTopAnno,
+     bottom_annotation = TM1_Gene_Mark_Bottom,
+     col = segCol,
+     cluster_rows = FALSE,
+     cluster_columns = FALSE,
+     show_heatmap_legend = FALSE)
`use_raster` is automatically set to TRUE for a matrix with more than
2000 columns You can control `use_raster` argument by explicitly
setting TRUE/FALSE to it.

Set `ht_opt$message = FALSE` to turn off this message.
> ## here
> pdf(file.path(panelDir, "TM1_DDRC.pdf"),
+     width = 298/25.4, height = 210/25.4)
> draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))
> dev.off()
quartz 
     2 
> pdf(file.path(panelDir, "TM1_DDRC_Heatmap_002.pdf"),
+     width = 224/25.4, height = 210/25.4)
> draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))

 *** caught segfault ***
address 0x0, cause 'unknown'

Traceback:
 1: getOption("topLevelEnvironment")
 2: topenv(cntxt$env$env)
 3: getInlineInfo(name, cntxt, guardOK = TRUE)
 4: tryInline(call, cb, cntxt)
 5: cmpCall(e, cb, cntxt)
 6: cmp(value, cb, ncntxt)
 7: cmpComplexAssign(symbol, lhs, value, superAssign, cb, cntxt)
 8: h(e, cb, cntxt)
 9: tryInline(call, cb, cntxt)
10: cmpCall(e, cb, cntxt)
11: cmp(subexp, cb, ncntxt, setloc = FALSE)
12: h(e, cb, cntxt)
13: tryInline(call, cb, cntxt)
14: cmpCall(e, cb, cntxt)
15: cmp(then.expr, cb, cntxt)
16: h(e, cb, cntxt)
17: tryInline(call, cb, cntxt)
18: cmpCall(e, cb, cntxt)
19: cmp(subexp, cb, cntxt, setloc = FALSE)
20: h(e, cb, cntxt)
21: tryInline(call, cb, cntxt)
22: cmpCall(e, cb, cntxt)
23: cmp(then.expr, cb, cntxt)
24: h(e, cb, cntxt)
25: tryInline(call, cb, cntxt)
26: cmpCall(e, cb, cntxt)
27: cmp(subexp, cb, cntxt, setloc = FALSE)
28: h(e, cb, cntxt)
29: tryInline(call, cb, cntxt)
30: cmpCall(e, cb, cntxt)
31: cmp(then.expr, cb, cntxt)
32: h(e, cb, cntxt)
33: tryInline(call, cb, cntxt)
34: cmpCall(e, cb, cntxt)
35: cmp(subexp, cb, cntxt, setloc = FALSE)
36: h(e, cb, cntxt)
37: tryInline(call, cb, cntxt)
38: cmpCall(e, cb, cntxt)
39: cmp(body, cb, lcntxt)
40: cmpForBody(callidx, body, ci, cb, cntxt)
41: h(e, cb, cntxt)
42: tryInline(call, cb, cntxt)
43: cmpCall(e, cb, cntxt)
44: cmp(subexp, cb, ncntxt, setloc = FALSE)
45: h(e, cb, cntxt)
46: tryInline(call, cb, cntxt)
47: cmpCall(e, cb, cntxt)
48: cmp(e, cb, cntxt, setloc = FALSE)
49: genCode(body(f), ncntxt, loc = loc)
50: cmpfun(f)
51: doTryCatch(return(expr), name, parentenv, handler)
52: tryCatchOne(expr, names, parentenv, handlers[[1L]])
53: tryCatchList(expr, classes, parentenv, handlers)
54: tryCatch(cmpfun(f), error = function(e) {    notifyCompilerError(paste(e$message, "at", deparse(e$call)))    f})
55: compiler:::tryCmpfun(function (object, row_title = character(0),     row_title_side = c("left", "right"), row_title_gp = gpar(fontsize = 14),     column_title = character(0), column_title_side = c("top",         "bottom"), column_title_gp = gpar(fontsize = 14), heatmap_legend_side = c("right",         "left", "bottom", "top"), merge_legends = FALSE, show_heatmap_legend = TRUE,     heatmap_legend_list = list(), annotation_legend_side = c("right",         "left", "bottom", "top"), show_annotation_legend = TRUE,     annotation_legend_list = list(), align_heatmap_legend = NULL,     align_annotation_legend = NULL, legend_grouping = c("adjusted",         "original"), ht_gap = unit(2, "mm"), main_heatmap = which(sapply(object@ht_list,         inherits, "Heatmap"))[1], padding = GLOBAL_PADDING, auto_adjust = TRUE,     row_dend_side = c("original", "left", "right"), row_sub_title_side = c("original",         "left", "right"), column_dend_side = c("original", "top",         "bottom"), column_sub_title_side = c("original", "top",         "bottom"), row_gap = NULL, cluster_rows = NULL, cluster_row_slices = NULL,     clustering_distance_rows = NULL, clustering_method_rows = NULL,     row_dend_width = NULL, show_row_dend = NULL, row_dend_reorder = NULL,     row_dend_gp = NULL, row_order = NULL, row_km = NULL, row_km_repeats = NULL,     row_split = NULL, height = NULL, heatmap_height = NULL, column_gap = NULL,     cluster_columns = NULL, cluster_column_slices = NULL, clustering_distance_columns = NULL,     clustering_method_columns = NULL, column_dend_width = NULL,     show_column_dend = NULL, column_dend_reorder = NULL, column_dend_gp = NULL,     column_order = NULL, column_km = NULL, column_km_repeats = NULL,     column_split = NULL, width = NULL, heatmap_width = NULL,     use_raster = NULL, raster_device = NULL, raster_quality = NULL,     raster_device_param = NULL, raster_resize = NULL) {    verbose = ht_opt("verbose")    if (object@layout$initialized) {        if (verbose)             qqcat("heatmap list is already initialized\n")        return(object)    }    current_vp = current.viewport()$name    if (current_vp == "ROOT") {        page_size = unit(par("din"), "in")    }    else {        grid::upViewport()        page_size = unit.c(convertWidth(unit(1, "npc"), "mm"),             convertHeight(unit(1, "npc"), "mm"))        grid::downViewport(current_vp)    }    n_ht = length(object@ht_list)    i_main = main_heatmap[1]    direction = object@direction    if (is.character(i_main)) {        i_main = which(names(object@ht_list) == i_main)[1]        if (length(i_main) == 0) {            stop_wrap(qq("cannot find heatmap '@{main_heatmap}'"))        }    }    if (verbose)         qqcat("@{n_ht} heatmaps/annotations, main heatmap: @{i_main}th\n")    if (inherits(object@ht_list[[i_main]], "HeatmapAnnotation")) {        stop_wrap("the main heatmap can only be the heatmap.")    }    nr = nrow(object@ht_list[[i_main]]@matrix)    nc = ncol(object@ht_list[[i_main]]@matrix)    if (n_ht > 1) {        if (length(ht_gap) == 1) {            if (inherits(ht_gap, "unit")) {                ht_gap = rep(ht_gap, n_ht)            }        }        else if (length(ht_gap) == n_ht - 1) {            ht_gap = unit.c(ht_gap, unit(0, "mm"))        }        else if (length(ht_gap) > n_ht) {            stop_wrap(paste0("length of `ht_gap` can only be 1 or ",                 n_ht - 1, "."))        }    }    else {        if (!is.unit(ht_gap)) {            warning_wrap("`ht_gap` should be a unit object, reset it to unit(0, 'mm').")            ht_gap = unit(rep(0, n_ht), "mm")        }    }    object@ht_list_param$ht_gap = ht_gap    for (i in seq_len(n_ht)) {        if (inherits(object@ht_list[[i]], "Heatmap")) {            if (direction == "horizontal") {                if (i == 1 && ncol(object@ht_list[[1]]@matrix) ==                   0) {                  ht_gap[1] = unit(0, "mm")                  if (verbose)                     qqcat("The first heatmap has zero column, set the first gap to unit(0, 'mm')\n")                }                else if (i == n_ht && ncol(object@ht_list[[n_ht]]@matrix) ==                   0) {                  ht_gap[n_ht - 1] = unit(0, "mm")                  if (verbose)                     qqcat("The last heatmap has zero column, set the last gap to unit(0, 'mm')\n")                }                else if (ncol(object@ht_list[[i]]@matrix) ==                   0) {                  ht_gap[i] = unit(0, "mm")                  if (verbose)                     qqcat("The @{i}th heatmap has zero column, set the @{i}th gap to unit(0, 'mm')\n")                }            }            else {                if (i == 1 && nrow(object@ht_list[[1]]@matrix) ==                   0) {                  ht_gap[1] = unit(0, "mm")                  if (verbose)                     qqcat("The first heatmap has zero row, set the first gap to unit(0, 'mm')\n")                }                else if (i == n_ht && nrow(object@ht_list[[n_ht]]@matrix) ==                   0) {                  ht_gap[n_ht - 1] = unit(0, "mm")                  if (verbose)                     qqcat("The last heatmap has zero row, set the last gap to unit(0, 'mm')\n")                }                else if (nrow(object@ht_list[[i]]@matrix) ==                   0) {                  ht_gap[i] = unit(0, "mm")                  if (verbose)                     qqcat("The @{i}th heatmap has zero row, set the @{i}th gap to unit(0, 'mm')\n")                }            }        }    }    ht_nr = nrow(object@ht_list[[i_main]]@matrix)    ht_nc = ncol(object@ht_list[[i_main]]@matrix)    if (direction == "horizontal") {        if (!is.null(row_split)) {            object@ht_list[[i_main]]@matrix_param$row_split = row_split            if (verbose)                 qqcat("set row_split to main heatmap\n")            if (is.data.frame(row_split)) {                if (nrow(row_split) != ht_nr) {                  stop_wrap("`row_split` should have same nrow as the main matrix.")                }            }            else if (is.atomic(row_split)) {                if (length(row_split) > 1 && length(row_split) !=                   ht_nr) {                  stop_wrap("`row_split` should have same length as nrow of the main matrix.")                }                if (length(row_split) == 1 && !object@ht_list[[i_main]]@row_dend_param$cluster) {                  stop_wrap("Since there is no row clustering for the main heatmap, `row_split` is not allowed to set as a single number.")                }            }        }        if (!is.null(row_km)) {            object@ht_list[[i_main]]@matrix_param$row_km = row_km            if (verbose)                 qqcat("set row_km to main heatmap\n")        }        if (!is.null(row_km_repeats)) {            object@ht_list[[i_main]]@matrix_param$row_km_repeats = row_km_repeats            if (verbose)                 qqcat("set row_km_repeats to main heatmap\n")        }        if (!is.null(row_gap)) {            object@ht_list[[i_main]]@matrix_param$row_gap = row_gap            if (verbose)                 qqcat("set row_gap to main heatmap\n")        }        if (!is.null(cluster_rows)) {            if (is.null(show_row_dend) && identical(cluster_rows,                 TRUE)) {                show_row_dend = TRUE            }            if (inherits(cluster_rows, c("dendrogram", "hclust"))) {                object@ht_list[[i_main]]@row_dend_param$obj = cluster_rows                object@ht_list[[i_main]]@row_dend_param$cluster = TRUE                if (verbose)                   qqcat("set cluster_rows to main heatmap\n")            }            else if (inherits(cluster_rows, "function")) {                object@ht_list[[i_main]]@row_dend_param$fun = cluster_rows                object@ht_list[[i_main]]@row_dend_param$cluster = TRUE                if (verbose)                   qqcat("set cluster_rows to main heatmap\n")            }            else {                object@ht_list[[i_main]]@row_dend_param$cluster = cluster_rows                if (verbose)                   qqcat("set cluster_rows to main heatmap\n")                if (!cluster_rows) {                  row_dend_width = unit(0, "mm")                  show_row_dend = FALSE                }                else {                  row_dend_width = unit(10, "mm")                }            }        }        if (!is.null(cluster_row_slices)) {            object@ht_list[[i_main]]@row_dend_param$cluster_slices = cluster_row_slices            if (verbose)                 qqcat("set cluster_row_slices to main heatmap\n")        }        if (!is.null(show_row_dend)) {            if (!show_row_dend) {                row_dend_width = unit(0, "mm")            }        }        if (!is.null(clustering_distance_rows)) {            object@ht_list[[i_main]]@row_dend_param$distance = clustering_distance_rows            if (verbose)                 qqcat("set clustering_distance_rows to main heatmap\n")        }        if (!is.null(clustering_method_rows)) {            object@ht_list[[i_main]]@row_dend_param$method = clustering_method_rows            if (verbose)                 qqcat("set clustering_method_rows to main heatmap\n")        }        if (!is.null(row_dend_width)) {            if (unclass(row_dend_width)[[1]] == 0) {                object@ht_list[[i_main]]@row_dend_param$width = unit(0,                   "mm")            }            else {                object@ht_list[[i_main]]@row_dend_param$width = row_dend_width +                   ht_opt$DENDROGRAM_PADDING            }        }        if (!is.null(show_row_dend)) {            object@ht_list[[i_main]]@row_dend_param$show = show_row_dend        }        if (!is.null(row_dend_gp)) {            object@ht_list[[i_main]]@row_dend_param$gp = check_gp(row_dend_gp)            if (verbose)                 qqcat("set row_dend_gp to main heatmap\n")        }        if (!is.null(row_dend_reorder)) {            object@ht_list[[i_main]]@row_dend_param$reorder = row_dend_reorder            if (verbose)                 qqcat("set row_dend_reorder to main heatmap\n")        }        if (!is.null(row_order)) {            if (any(is.na(row_order))) {                stop_wrap("`row_order` should not contain NA values.")            }            if (length(row_order) != nrow(object@ht_list[[i_main]]@matrix)) {                stop_wrap("length of `row_order` should be same as the number of main marix rows.")            }            if (is.character(row_order)) {                row_order = structure(seq_len(nrow(object@ht_list[[i_main]]@matrix)),                   names = rownames(object@ht_list[[i_main]]@matrix))[row_order]            }            object@ht_list[[i_main]]@row_order = row_order            if (verbose)                 qqcat("set row_order to main heatmap\n")        }        if (!is.null(height) && !is.null(heatmap_height)) {            stop_wrap("You can only specify one of `height` and `heatmap_height` in draw().")        }        if (!is.null(height)) {            if (!inherits(height, "unit")) {                stop_wrap("`height` specified in `draw()` should be a unit.")            }            if (!is_abs_unit(height)) {                stop_wrap("`height` specified in `draw()` should be an absolute unit.")            }        }        if (!is.null(heatmap_height)) {            if (!inherits(heatmap_height, "unit")) {                stop_wrap("`heatmap_height` specified in `draw()` should be a unit.")            }            if (!is_abs_unit(heatmap_height)) {                stop_wrap("`heatmap_height` specified in `draw()` should be an absolute unit.")            }        }        if (!is.null(height) && is.null(heatmap_height)) {            object@ht_list[[i_main]]@matrix_param$height = height            object@ht_list[[i_main]]@heatmap_param$height = unit(1,                 "npc")        }        else if (is.null(height) && !is.null(heatmap_height)) {            object@ht_list[[i_main]]@matrix_param$height = unit(1,                 "npc")            object@ht_list[[i_main]]@heatmap_param$height = heatmap_height        }        for (obj_nm in c("column_split", "column_km", "column_gap",             "cluster_columns", "show_column_dend", "clustering_distance_columns",             "clustering_method_columns", "column_dend_width",             "show_column_dend", "column_dend_gp", "column_dend_reorder",             "column_order", "width", "heatmap_width")) {            if (!is.null(get(obj_nm))) {                message_wrap(paste0("'", obj_nm, "' should not be set in draw() for horizontal heatmap list (Note a single heatmap is a horizontal heatmap list). Please directly set it in `Heatmap()`."))            }        }    }    else {        if (!is.null(column_split)) {            object@ht_list[[i_main]]@matrix_param$column_split = column_split            if (verbose)                 qqcat("set column_split to main heatmap\n")            if (is.data.frame(column_split)) {                if (nrow(column_split) != ht_nc) {                  stop_wrap("`column_split` should have same ncol as the main matrix.")                }            }            else if (is.atomic(column_split)) {                if (length(column_split) > 1 && length(column_split) !=                   ht_nr) {                  stop_wrap("`column_split` should have same length as ncol of the main matrix.")                }                if (length(column_split) == 1 && !object@ht_list[[i_main]]@column_dend_param$cluster) {                  stop_wrap("Since there is no column clustering for the main heatmap, `column_split` is not allowed to set as a single number.")                }            }        }        if (!is.null(column_km)) {            object@ht_list[[i_main]]@matrix_param$column_km = column_km            if (verbose)                 qqcat("set column_km to main heatmap\n")        }        if (!is.null(column_km_repeats)) {            object@ht_list[[i_main]]@matrix_param$column_km_repeats = column_km_repeats            if (verbose)                 qqcat("set column_km_repeats to main heatmap\n")        }        if (!is.null(column_gap)) {            object@ht_list[[i_main]]@matrix_param$column_gap = column_gap            if (verbose)                 qqcat("set column_gap to main heatmap\n")        }        if (!is.null(cluster_columns)) {            if (is.null(show_column_dend) && identical(cluster_columns,                 TRUE)) {                show_column_dend = TRUE            }            if (inherits(cluster_columns, c("dendrogram", "hclust"))) {                object@ht_list[[i_main]]@column_dend_param$obj = cluster_columns                object@ht_list[[i_main]]@column_dend_param$cluster = TRUE                if (verbose)                   qqcat("set cluster_columns to main heatmap\n")            }            else if (inherits(cluster_columns, "function")) {                object@ht_list[[i_main]]@column_dend_param$fun = cluster_columns                object@ht_list[[i_main]]@column_dend_param$cluster = TRUE                if (verbose)                   qqcat("set cluster_columns to main heatmap\n")            }            else {                object@ht_list[[i_main]]@column_dend_param$cluster = cluster_columns                if (verbose)                   qqcat("set cluster_columns to main heatmap\n")                if (!cluster_columns) {                  column_dend_width = unit(0, "mm")                  show_column_dend = FALSE                }                else {                  column_dend_width = unit(10, "mm")                }            }        }        if (!is.null(cluster_column_slices)) {            object@ht_list[[i_main]]@column_dend_param$cluster_slices = cluster_column_slices            if (verbose)                 qqcat("set cluster_column_slices to main heatmap\n")        }        if (!is.null(show_column_dend)) {            if (!show_column_dend) {                column_dend_width = unit(0, "mm")            }        }        if (!is.null(clustering_distance_columns)) {            object@ht_list[[i_main]]@column_dend_param$distance = clustering_distance_columns            if (verbose)                 qqcat("set clustering_distance_columns to main heatmap\n")        }        if (!is.null(clustering_method_columns)) {            object@ht_list[[i_main]]@column_dend_param$method = clustering_method_columns            if (verbose)                 qqcat("set clustering_method_columns to main heatmap\n")        }        if (!is.null(column_dend_width)) {            if (unclass(column_dend_width)[[1]] == 0) {                object@ht_list[[i_main]]@column_dend_param$width = unit(0,                   "mm")            }            else {                object@ht_list[[i_main]]@column_dend_param$width = column_dend_width +                   ht_opt$DENDROGRAM_PADDING            }        }        if (!is.null(show_column_dend)) {            object@ht_list[[i_main]]@column_dend_param$show = show_column_dend        }        if (!is.null(column_dend_gp)) {            object@ht_list[[i_main]]@column_dend_param$gp = check_gp(column_dend_gp)            if (verbose)                 qqcat("set column_dend_gp to main heatmap\n")        }        if (!is.null(column_dend_reorder)) {            object@ht_list[[i_main]]@column_dend_param$reorder = column_dend_reorder            if (verbose)                 qqcat("set column_dend_reorder to main heatmap\n")        }        if (!is.null(column_order)) {            if (any(is.na(column_order))) {                stop_wrap("`column_order` should not contain NA values.")            }            if (length(column_order) != ncol(object@ht_list[[i_main]]@matrix)) {                stop_wrap("length of `column_order` should be same as the number of main marix columns.")            }            if (is.character(column_order)) {                column_order = structure(seq_len(ncol(object@ht_list[[i_main]]@matrix)),                   names = colnames(object@ht_list[[i_main]]@matrix))[column_order]            }            object@ht_list[[i_main]]@column_order = column_order            if (verbose)                 qqcat("set column_order to main heatmap\n")        }        if (!is.null(width) && !is.null(heatmap_width)) {            stop_wrap("You can only specify one of `width` and `heatmap_width` in draw().")        }        if (!is.null(width)) {            if (!inherits(width, "unit")) {                stop_wrap("`width` specified in `draw()` should be a unit.")            }            if (!is_abs_unit(width)) {                stop_wrap("`width` specified in `draw()` should be an absolute unit.")            }        }        if (!is.null(heatmap_width)) {            if (!inherits(heatmap_width, "unit")) {                stop_wrap("`heatmap_width` specified in `draw()` should be a unit.")            }            if (!is_abs_unit(heatmap_width)) {                stop_wrap("`heatmap_width` specified in `draw()` should be an absolute unit.")            }        }        if (!is.null(width) && is.null(heatmap_width)) {            object@ht_list[[i_main]]@matrix_param$width = width            object@ht_list[[i_main]]@heatmap_param$width = unit(1,                 "npc")        }        else if (is.null(width) && !is.null(heatmap_width)) {            object@ht_list[[i_main]]@matrix_param$width = unit(1,                 "npc")            object@ht_list[[i_main]]@heatmap_param$width = heatmap_width        }        for (obj_nm in c("row_split", "row_km", "row_gap", "cluster_rows",             "show_row_dend", "clustering_distance_rows", "clustering_method_rows",             "row_dend_width", "show_row_dend", "row_dend_gp",             "row_dend_reorder", "row_order", "height", "heatmap_height")) {            if (!is.null(get(obj_nm))) {                message_wrap(paste0("'", obj_nm, "' should not be set in draw() for vertical heatmap list. Please directly set it in `Heatmap()`."))            }        }    }    for (i in seq_len(n_ht)) {        if (!is.null(use_raster)) {            object@ht_list[[i]]@heatmap_param$use_raster = use_raster        }        if (!is.null(raster_device)) {            object@ht_list[[i]]@heatmap_param$raster_device = raster_device        }        if (!is.null(raster_quality)) {            object@ht_list[[i]]@heatmap_param$raster_quality = raster_quality        }        if (!is.null(raster_device_param)) {            object@ht_list[[i]]@heatmap_param$raster_device_param = raster_device_param        }        if (!is.null(raster_resize)) {            object@ht_list[[i]]@heatmap_param$raster_resize = raster_resize        }    }    if (verbose)         qqcat("auto adjust all heatmap/annotations by the main heatmap\n")    ht_main = object@ht_list[[i_main]]    if (direction == "horizontal") {        ht_main = make_row_cluster(ht_main)        if (verbose)             qqcat("perform row clustering on the main heatmap\n")    }    else {        ht_main = make_column_cluster(ht_main)        if (verbose)             qqcat("perform column clustering on the main heatmap\n")    }    object@ht_list[[i_main]] = ht_main    if (direction == "horizontal") {        row_dend_side = match.arg(row_dend_side)[1]        row_sub_title_side = match.arg(row_sub_title_side)[1]        if (row_dend_side == "left" || row_sub_title_side ==             "left") {            if (inherits(object@ht_list[[1]], "HeatmapAnnotation")) {                object@ht_list = c(list(Heatmap(matrix(nrow = nr,                   ncol = 0))), object@ht_list)                ht_gap = unit.c(unit(0, "mm"), ht_gap)                i_main = i_main + 1                n_ht = n_ht + 1                if (verbose)                   qqcat("add a zero-column heatmap for row dend/title on the very left\n")            }        }        if (row_dend_side == "right" || row_sub_title_side ==             "right") {            if (inherits(object@ht_list[[length(object@ht_list)]],                 "HeatmapAnnotation")) {                object@ht_list = c(object@ht_list, list(Heatmap(matrix(nrow = nr,                   ncol = 0))))                ht_gap = unit.c(ht_gap, unit(0, "mm"))                n_ht = n_ht + 1                if (verbose)                   qqcat("add a zero-column heatmap for row dend/title on the very right\n")            }        }    }    else {        column_dend_side = match.arg(column_dend_side)[1]        column_sub_title_side = match.arg(column_sub_title_side)[1]        if (column_dend_side == "top" || column_sub_title_side ==             "top") {            if (inherits(object@ht_list[[1]], "HeatmapAnnotation")) {                object@ht_list = c(list(Heatmap(matrix(nrow = 0,                   ncol = nc))), object@ht_list)                ht_gap = unit.c(unit(0, "mm"), ht_gap)                i_main = i_main + 1                n_ht = n_ht + 1                if (verbose)                   qqcat("add a zero-row heatmap for column dend/title on the very top\n")            }        }        if (column_dend_side == "bottom" || column_sub_title_side ==             "bottom") {            if (inherits(object@ht_list[[length(object@ht_list)]],                 "HeatmapAnnotation")) {                object@ht_list = c(object@ht_list, list(Heatmap(matrix(nrow = 0,                   ncol = nc))))                ht_gap = unit.c(ht_gap, unit(0, "mm"))                n_ht = n_ht + 1                if (verbose)                   qqcat("add a zero-column heatmap for row dend/title on the very bottom\n")            }        }    }    object@ht_list_param$main_heatmap = i_main    object@ht_list_param$ht_gap = ht_gap    object@ht_list_param$merge_legends = merge_legends    if (!is.null(padding)) {        if (length(padding) == 1) {            padding = rep(padding, 4)        }        else if (length(padding) == 2) {            padding = rep(padding, 2)        }        else if (length(padding) != 4) {            stop_wrap("`padding` can only have length of 1, 2, 4")        }    }    object@ht_list_param$padding = padding    object@ht_list_param$auto_adjust = auto_adjust    if (direction == "horizontal") {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap") & i !=                 i_main) {                object@ht_list[[i]]@row_order_list = ht_main@row_order_list                object@ht_list[[i]]@row_order = ht_main@row_order                object@ht_list[[i]]@row_dend_param$show = FALSE                object@ht_list[[i]]@row_dend_param$cluster = FALSE            }        }        if (verbose)             qqcat("adjust row order for all other heatmaps\n")    }    else {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap") & i !=                 i_main) {                object@ht_list[[i]]@column_order_list = ht_main@column_order_list                object@ht_list[[i]]@column_order = ht_main@column_order                object@ht_list[[i]]@column_dend_param$show = FALSE                object@ht_list[[i]]@column_dend_param$cluster = FALSE            }        }        if (verbose)             qqcat("adjust column order for all other heatmaps\n")    }    if (direction == "horizontal") {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap") & i !=                 i_main) {                object@ht_list[[i]]@matrix_param$height = object@ht_list[[i_main]]@matrix_param$height                object@ht_list[[i]]@heatmap_param$height = object@ht_list[[i_main]]@heatmap_param$height            }        }        if (verbose)             qqcat("adjust heights for all other heatmaps\n")    }    else {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap") & i !=                 i_main) {                object@ht_list[[i]]@matrix_param$width = object@ht_list[[i_main]]@matrix_param$width                object@ht_list[[i]]@heatmap_param$width = object@ht_list[[i_main]]@heatmap_param$width            }        }        if (verbose)             qqcat("adjust width for all other heatmaps\n")    }    if (auto_adjust) {        if (direction == "horizontal") {            for (i in seq_len(n_ht)) {                if (inherits(object@ht_list[[i]], "Heatmap")) {                  if (i == 1 && !is.null(object@ht_list[[i]]@row_names_param$anno) &&                     object@ht_list[[i]]@row_names_param$side ==                       "left") {                  }                  else if (i == n_ht && !is.null(object@ht_list[[i]]@row_names_param$anno) &&                     object@ht_list[[i]]@row_names_param$side ==                       "right") {                  }                  else {                    object@ht_list[[i]]@row_names_param$anno = NULL                    object@ht_list[[i]]@row_names_param$show = FALSE                  }                }            }        }        else {            for (i in seq_len(n_ht)) {                if (inherits(object@ht_list[[i]], "Heatmap")) {                  if (i == 1 && !is.null(object@ht_list[[i]]@column_names_param$anno) &&                     object@ht_list[[i]]@column_names_param$side ==                       "top") {                  }                  else if (i == n_ht && !is.null(object@ht_list[[i]]@column_names_param$anno) &&                     object@ht_list[[i]]@column_names_param$side ==                       "bottom") {                  }                  else {                    object@ht_list[[i]]@column_names_param$anno = NULL                    object@ht_list[[i]]@column_names_param$show = FALSE                  }                }            }        }    }    if (direction == "horizontal") {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap") && i !=                 i_main) {                object@ht_list[[i]]@row_title = character(0)            }        }        if (verbose)             qqcat("remove row titles for all other heatmaps\n")    }    else {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap") && i !=                 i_main) {                object@ht_list[[i]]@column_title = character(0)            }        }        if (verbose)             qqcat("remove column titles for all other heatmaps\n")    }    if (direction == "horizontal") {        if (row_dend_side == "left") {            object@ht_list[[i_main]]@row_dend_param$show = FALSE            object@ht_list[[1]]@row_dend_list = ht_main@row_dend_list            object@ht_list[[1]]@row_dend_slice = ht_main@row_dend_slice            object@ht_list[[1]]@row_dend_param = ht_main@row_dend_param            object@ht_list[[1]]@row_dend_param$side = "left"            if (verbose)                 qqcat("add dendrogram of the main heatmap to the left of the first heatmap\n")        }        else if (row_dend_side == "right") {            object@ht_list[[i_main]]@row_dend_param$show = FALSE            object@ht_list[[n_ht]]@row_dend_list = ht_main@row_dend_list            object@ht_list[[n_ht]]@row_dend_slice = ht_main@row_dend_slice            object@ht_list[[n_ht]]@row_dend_param = ht_main@row_dend_param            object@ht_list[[n_ht]]@row_dend_param$side = "right"            if (verbose)                 qqcat("add dendrogram of the main heatmap to the right of the last heatmap\n")        }        if (row_sub_title_side == "left") {            object@ht_list[[i_main]]@row_title = character(0)            object@ht_list[[1]]@row_title = ht_main@row_title            object@ht_list[[1]]@row_title_param = ht_main@row_title_param            object@ht_list[[1]]@row_title_param$side = "left"            object@ht_list[[1]]@row_title_param$just = get_text_just(ht_main@row_title_param$rot,                 "left")            if (verbose)                 qqcat("add row title of the main heatmap to the left of the first heatmap\n")        }        else if (row_sub_title_side == "right") {            object@ht_list[[i_main]]@row_title = character(0)            object@ht_list[[n_ht]]@row_title = ht_main@row_title            object@ht_list[[n_ht]]@row_title_param = ht_main@row_title_param            object@ht_list[[n_ht]]@row_title_param$side = "right"            object@ht_list[[n_ht]]@row_title_param$just = get_text_just(ht_main@row_title_param$rot,                 "right")            if (verbose)                 qqcat("add row title of the main heatmap to the right of the last heatmap\n")        }    }    else {        if (column_dend_side == "top") {            object@ht_list[[i_main]]@column_dend_param$show = FALSE            object@ht_list[[1]]@column_dend_list = ht_main@column_dend_list            object@ht_list[[1]]@column_dend_slice = ht_main@column_dend_slice            object@ht_list[[1]]@column_dend_param = ht_main@column_dend_param            object@ht_list[[1]]@column_dend_param$side = "top"            if (verbose)                 qqcat("add dendrogram of the main heatmap to the top of the first heatmap\n")        }        else if (column_dend_side == "bottom") {            object@ht_list[[i_main]]@column_dend_param$show = FALSE            object@ht_list[[n_ht]]@column_dend_list = ht_main@column_dend_list            object@ht_list[[n_ht]]@column_dend_slice = ht_main@column_dend_slice            object@ht_list[[n_ht]]@column_dend_param = ht_main@column_dend_param            object@ht_list[[n_ht]]@column_dend_param$side = "bottom"            if (verbose)                 qqcat("add dendrogram of the main heatmap to the bottom of the last heatmap\n")        }        if (column_sub_title_side == "top") {            object@ht_list[[i_main]]@column_title = character(0)            object@ht_list[[1]]@column_title = ht_main@column_title            object@ht_list[[1]]@column_title_param = ht_main@column_title_param            object@ht_list[[1]]@column_title_param$side = "top"            object@ht_list[[1]]@column_title_param$just = get_text_just(ht_main@column_title_param$rot,                 "top")            if (verbose)                 qqcat("add column title of the main heatmap to the top of the first heatmap\n")        }        else if (column_sub_title_side == "bottom") {            object@ht_list[[i_main]]@column_title = character(0)            object@ht_list[[n_ht]]@column_title = ht_main@column_title            object@ht_list[[n_ht]]@column_title_param = ht_main@column_title_param            object@ht_list[[n_ht]]@column_title_param$side = "bottom"            object@ht_list[[n_ht]]@column_title_param$just = get_text_just(ht_main@row_title_param$rot,                 "bottom")            if (verbose)                 qqcat("add column title of the main heatmap to the bottom of the last heatmap\n")        }    }    if (direction == "horizontal") {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap")) {                object@ht_list[[i]]@matrix_param$row_gap = ht_main@matrix_param$row_gap            }        }        if (verbose)             qqcat("adjust row_gap for all other heatmaps\n")    }    else {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap")) {                object@ht_list[[i]]@matrix_param$column_gap = ht_main@matrix_param$column_gap            }        }        if (verbose)             qqcat("adjust column_gap for all other heatmaps\n")    }    if (direction == "horizontal") {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap")) {                if (verbose)                   qqcat("prepare layout for heatmap: @{object@ht_list[[i]]@name}\n")                object@ht_list[[i]] = prepare(object@ht_list[[i]],                   process_rows = FALSE)            }        }    }    else {        for (i in seq_len(n_ht)) {            if (inherits(object@ht_list[[i]], "Heatmap")) {                if (verbose)                   qqcat("prepare layout for heatmap: @{object@ht_list[[i]]@name}\n")                object@ht_list[[i]] = prepare(object@ht_list[[i]],                   process_columns = FALSE)            }        }    }    if (!is.null(ht_opt$TITLE_PADDING)) {        title_padding = ht_opt$TITLE_PADDING    }    else {        title_padding = unit(c(0, 0), "points")        title_padding[1] = title_padding[1] + unit(5.5, "points") +             convertHeight(grobDescent(textGrob(label = "jA",                 gp = column_title_gp)), "inches")    }    column_title_side = match.arg(column_title_side)[1]    if (length(column_title) == 0) {        column_title = character(0)    }    else if (!inherits(column_title, c("expression", "call"))) {        if (is.na(column_title)) {            column_title = character(0)        }        else if (column_title == "") {            column_title = character(0)        }    }    object@column_title = column_title    object@column_title_param$gp = check_gp(column_title_gp)    object@column_title_param$side = column_title_side    if (length(column_title) > 0) {        if (column_title_side == "top") {            object@layout$layout_column_title_top_height = grobHeight(textGrob(column_title,                 gp = column_title_gp)) + sum(title_padding)            object@layout$layout_index = rbind(object@layout$layout_index,                 column_title_top = heatmap_list_layout_index("column_title_top"))        }        else {            object@layout$layout_column_title_bottom_height = grobHeight(textGrob(column_title,                 gp = column_title_gp)) + sum(title_padding)            object@layout$layout_index = rbind(object@layout$layout_index,                 column_title_bottom = heatmap_list_layout_index("column_title_bottom"))        }        object@layout$graphic_fun_list = c(object@layout$graphic_fun_list,             function(object) draw_title(object, which = "column"))    }    if (!is.null(ht_opt$TITLE_PADDING)) {        title_padding = ht_opt$TITLE_PADDING    }    else {        title_padding = unit(c(0, 0), "points")        title_padding[1] = title_padding[1] + unit(5.5, "points") +             convertHeight(grobDescent(textGrob(label = "jA",                 gp = row_title_gp)), "inches")    }    row_title_side = match.arg(row_title_side)[1]    if (length(row_title) == 0) {        row_title = character(0)    }    else if (!inherits(row_title, c("expression", "call"))) {        if (is.na(row_title)) {            row_title = character(0)        }        else if (row_title == "") {            row_title = character(0)        }    }    object@row_title = row_title    object@row_title_param$gp = check_gp(row_title_gp)    object@row_title_param$side = row_title_side    if (length(row_title) > 0) {        if (row_title_side == "left") {            object@layout$layout_row_title_left_width = grobHeight(textGrob(row_title,                 gp = row_title_gp)) + sum(title_padding)            object@layout$layout_index = rbind(object@layout$layout_index,                 row_title_left = heatmap_list_layout_index("row_title_left"))        }        else {            object@layout$layout_row_title_right_width = grobHeight(textGrob(row_title,                 gp = row_title_gp)) + sum(title_padding)            object@layout$layout_index = rbind(object@layout$layout_index,                 row_title_right = heatmap_list_layout_index("row_title_right"))        }        object@layout$graphic_fun_list = c(object@layout$graphic_fun_list,             function(object) draw_title(object, which = "row"))    }    legend_grouping = match.arg(legend_grouping)[1]    object@ht_list_param$legend_grouping = legend_grouping    ColorMappingList = list()    for (i in seq_along(object@ht_list)) {        ht = object@ht_list[[i]]        if (direction == "horizontal") {            if (inherits(object@ht_list[[i]], "Heatmap")) {                if (!is.null(ht@left_annotation)) {                  if (object@ht_list_param$merge_legends || legend_grouping ==                     "adjusted") {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@left_annotation))                  }                }                if (!is.null(ht@top_annotation)) {                  if (object@ht_list_param$merge_legends) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@top_annotation))                  }                }                if (object@ht_list[[i]]@heatmap_param$show_heatmap_legend) {                  ColorMappingList = c.list(ColorMappingList,                     object@ht_list[[i]]@matrix_color_mapping)                }                if (!is.null(ht@bottom_annotation)) {                  if (object@ht_list_param$merge_legends) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@bottom_annotation))                  }                }                if (!is.null(ht@right_annotation)) {                  if (object@ht_list_param$merge_legends || legend_grouping ==                     "adjusted") {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@right_annotation))                  }                }            }            else if (inherits(object@ht_list[[i]], "HeatmapAnnotation")) {                if (object@ht_list_param$merge_legends || legend_grouping ==                   "adjusted") {                  ColorMappingList = c.list(ColorMappingList,                     list = get_color_mapping_list(object@ht_list[[i]]))                }            }        }        else {            if (inherits(object@ht_list[[i]], "Heatmap")) {                if (!is.null(ht@left_annotation)) {                  if (object@ht_list_param$merge_legends) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@left_annotation))                  }                }                if (!is.null(ht@top_annotation)) {                  if (object@ht_list_param$merge_legends || legend_grouping ==                     "adjusted") {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@top_annotation))                  }                }                if (object@ht_list[[i]]@heatmap_param$show_heatmap_legend) {                  ColorMappingList = c.list(ColorMappingList,                     object@ht_list[[i]]@matrix_color_mapping)                }                if (!is.null(ht@bottom_annotation)) {                  if (object@ht_list_param$merge_legends || legend_grouping ==                     "adjusted") {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@bottom_annotation))                  }                }                if (!is.null(ht@right_annotation)) {                  if (object@ht_list_param$merge_legends) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@right_annotation))                  }                }            }            else if (inherits(object@ht_list[[i]], "HeatmapAnnotation")) {                if (object@ht_list_param$merge_legends || legend_grouping ==                   "adjusted") {                  ColorMappingList = c.list(ColorMappingList,                     list = get_color_mapping_list(object@ht_list[[i]]))                }            }        }    }    if (length(heatmap_legend_list) != 0) {        if (inherits(heatmap_legend_list, c("Legends", "grob"))) {            heatmap_legend_list = list(heatmap_legend_list)        }    }    if (length(annotation_legend_list) != 0) {        if (inherits(annotation_legend_list, c("Legends", "grob"))) {            annotation_legend_list = list(annotation_legend_list)        }    }    if (merge_legends) {        heatmap_legend_list = c(heatmap_legend_list, annotation_legend_list)    }    if (length(ColorMappingList) == 0 && length(heatmap_legend_list) ==         0) {        show_heatmap_legend = FALSE    }    object@heatmap_legend_param$show = show_heatmap_legend    heatmap_legend_side = match.arg(heatmap_legend_side)[1]    object@heatmap_legend_param$side = heatmap_legend_side    object@heatmap_legend_param$list = heatmap_legend_list    if (show_heatmap_legend) {        if (heatmap_legend_side == "top") {            object@heatmap_legend_param$padding = unit.c(ht_opt$HEATMAP_LEGEND_PADDING,                 unit(c(0, 0, 0), "mm"))            size = heatmap_legend_size(object, legend_list = heatmap_legend_list,                 max_width = calc_legends_max_width(object, page_size))            object@heatmap_legend_param$size = size            object@layout$layout_heatmap_legend_top_height = size[2]            object@layout$layout_index = rbind(object@layout$layout_index,                 heatmap_legend_top = heatmap_list_layout_index("heatmap_legend_top"))        }        else if (heatmap_legend_side == "bottom") {            object@heatmap_legend_param$padding = unit.c(unit(c(0,                 0), "mm"), ht_opt$HEATMAP_LEGEND_PADDING, unit(0,                 "mm"))            size = heatmap_legend_size(object, legend_list = heatmap_legend_list,                 max_width = calc_legends_max_width(object, page_size))            object@heatmap_legend_param$size = size            object@layout$layout_heatmap_legend_bottom_height = size[2]            object@layout$layout_index = rbind(object@layout$layout_index,                 heatmap_legend_bottom = heatmap_list_layout_index("heatmap_legend_bottom"))        }        else if (heatmap_legend_side == "left") {            object@heatmap_legend_param$padding = unit.c(unit(c(0,                 0, 0), "mm"), ht_opt$HEATMAP_LEGEND_PADDING)            size = heatmap_legend_size(object, legend_list = heatmap_legend_list,                 max_height = calc_legends_max_height(object,                   page_size))            object@heatmap_legend_param$size = size            object@layout$layout_heatmap_legend_left_width = size[1]            object@layout$layout_index = rbind(object@layout$layout_index,                 heatmap_legend_left = heatmap_list_layout_index("heatmap_legend_left"))        }        else if (heatmap_legend_side == "right") {            object@heatmap_legend_param$padding = unit.c(unit(0,                 "mm"), ht_opt$HEATMAP_LEGEND_PADDING, unit(c(0,                 0), "mm"))            size = heatmap_legend_size(object, legend_list = heatmap_legend_list,                 max_height = calc_legends_max_height(object,                   page_size))            object@heatmap_legend_param$size = size            object@layout$layout_heatmap_legend_right_width = size[1]            object@layout$layout_index = rbind(object@layout$layout_index,                 heatmap_legend_right = heatmap_list_layout_index("heatmap_legend_right"))        }        if (heatmap_legend_side %in% c("top", "bottom")) {            object@layout$graphic_fun_list = c(object@layout$graphic_fun_list,                 function(object) draw_heatmap_legend(object,                   legend_list = heatmap_legend_list, max_width = calc_legends_max_width(object,                     page_size)))        }        else {            object@layout$graphic_fun_list = c(object@layout$graphic_fun_list,                 function(object) draw_heatmap_legend(object,                   legend_list = heatmap_legend_list, max_height = calc_legends_max_height(object,                     page_size)))        }    }    else {        object@heatmap_legend_param$size = unit(c(0, 0), "mm")    }    ColorMappingList = list()    if (!merge_legends) {        for (i in seq_along(object@ht_list)) {            ht = object@ht_list[[i]]            if (direction == "horizontal") {                if (inherits(ht, "Heatmap")) {                  if (!is.null(ht@left_annotation)) {                    if (legend_grouping == "original") {                      ColorMappingList = c.list(ColorMappingList,                         list = get_color_mapping_list(ht@left_annotation))                    }                  }                  if (!is.null(ht@top_annotation)) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@top_annotation))                  }                  if (!is.null(ht@bottom_annotation)) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@bottom_annotation))                  }                  if (!is.null(ht@right_annotation)) {                    if (legend_grouping == "original") {                      ColorMappingList = c.list(ColorMappingList,                         list = get_color_mapping_list(ht@right_annotation))                    }                  }                }                else if (inherits(ht, "HeatmapAnnotation")) {                  if (legend_grouping == "original") {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht))                  }                }            }            else {                if (inherits(ht, "Heatmap")) {                  if (!is.null(ht@left_annotation)) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@left_annotation))                  }                  if (!is.null(ht@top_annotation)) {                    if (legend_grouping == "original") {                      ColorMappingList = c.list(ColorMappingList,                         list = get_color_mapping_list(ht@top_annotation))                    }                  }                  if (!is.null(ht@bottom_annotation)) {                    if (legend_grouping == "original") {                      ColorMappingList = c.list(ColorMappingList,                         list = get_color_mapping_list(ht@bottom_annotation))                    }                  }                  if (!is.null(ht@top_annotation)) {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht@top_annotation))                  }                }                else if (inherits(ht, "HeatmapAnnotation")) {                  if (legend_grouping == "original") {                    ColorMappingList = c.list(ColorMappingList,                       list = get_color_mapping_list(ht))                  }                }            }        }    }    else {        annotation_legend_list = list()    }    if (length(ColorMappingList) == 0 && length(annotation_legend_list) ==         0) {        show_annotation_legend = FALSE    }    object@annotation_legend_param$show = show_annotation_legend    annotation_legend_side = match.arg(annotation_legend_side)[1]    object@annotation_legend_param$side = annotation_legend_side    object@annotation_legend_param$list = annotation_legend_list    if (show_annotation_legend) {        if (annotation_legend_side == "top") {            object@annotation_legend_param$padding = unit.c(ht_opt$ANNOTATION_LEGEND_PADDING,                 unit(c(0, 0, 0), "mm"))            size = annotation_legend_size(object, legend_list = annotation_legend_list,                 max_width = calc_legends_max_width(object, page_size))            object@annotation_legend_param$size = size            object@layout$layout_annotation_legend_top_height = size[2]            object@layout$layout_index = rbind(object@layout$layout_index,                 annotation_legend_top = heatmap_list_layout_index("annotation_legend_top"))        }        else if (annotation_legend_side == "bottom") {            object@annotation_legend_param$padding = unit.c(unit(c(0,                 0), "mm"), ht_opt$ANNOTATION_LEGEND_PADDING,                 unit(0, "mm"))            size = annotation_legend_size(object, legend_list = annotation_legend_list,                 max_width = calc_legends_max_width(object, page_size))            object@annotation_legend_param$size = size            object@layout$layout_annotation_legend_bottom_height = size[2]            object@layout$layout_index = rbind(object@layout$layout_index,                 annotation_legend_bottom = heatmap_list_layout_index("annotation_legend_bottom"))        }        else if (annotation_legend_side == "left") {            object@annotation_legend_param$padding = unit.c(unit(c(0,                 0, 0), "mm"), ht_opt$ANNOTATION_LEGEND_PADDING)            size = annotation_legend_size(object, legend_list = annotation_legend_list,                 max_height = calc_legends_max_height(object,                   page_size))            object@annotation_legend_param$size = size            object@layout$layout_annotation_legend_left_width = size[1]            object@layout$layout_index = rbind(object@layout$layout_index,                 annotation_legend_left = heatmap_list_layout_index("annotation_legend_left"))        }        else if (annotation_legend_side == "right") {            object@annotation_legend_param$padding = unit.c(unit(0,                 "mm"), ht_opt$ANNOTATION_LEGEND_PADDING, unit(c(0,                 0), "mm"))            size = annotation_legend_size(object, legend_list = annotation_legend_list,                 max_height = calc_legends_max_height(object,                   page_size))            object@annotation_legend_param$size = size            object@layout$layout_annotation_legend_right_width = size[1]            object@layout$layout_index = rbind(object@layout$layout_index,                 annotation_legend_right = heatmap_list_layout_index("annotation_legend_right"))        }        if (annotation_legend_side %in% c("top", "bottom")) {            object@layout$graphic_fun_list = c(object@layout$graphic_fun_list,                 function(object) draw_annotation_legend(object,                   legend_list = annotation_legend_list, max_width = calc_legends_max_width(object,                     page_size)))        }        else {            object@layout$graphic_fun_list = c(object@layout$graphic_fun_list,                 function(object) draw_annotation_legend(object,                   legend_list = annotation_legend_list, max_height = calc_legends_max_height(object,                     page_size)))        }    }    else {        object@annotation_legend_param$size = unit(c(0, 0), "null")    }    object@heatmap_legend_param$align_legend = align_heatmap_legend    object@annotation_legend_param$align_legend = align_annotation_legend    object = adjust_heatmap_list(object)    object@layout$layout_index = rbind(heatmaplist = heatmap_list_layout_index("heatmap_list"),         object@layout$layout_index)    object@layout$graphic_fun_list = c(function(object) draw_heatmap_list(object),         object@layout$graphic_fun_list)    if (direction == "horizontal") {        main_matrix_rn = rownames(object@ht_list[[i_main]]@matrix)        if (!is.null(main_matrix_rn)) {            for (i in seq_len(n_ht)) {                if (i == i_main)                   next                if (inherits(object@ht_list[[i]], "Heatmap")) {                  matrix_rn = rownames(object@ht_list[[i]]@matrix)                  if (!is.null(matrix_rn)) {                    if (setequal(main_matrix_rn, matrix_rn)) {                      if (!identical(main_matrix_rn, matrix_rn)) {                        warning_wrap("Row names of heatmap ",                           i, " is not consistent as the main heatmap (",                           i_main, ")", sep = "")                      }                    }                  }                }            }        }    }    else {        main_matrix_cn = colnames(object@ht_list[[i_main]]@matrix)        if (!is.null(main_matrix_cn)) {            for (i in seq_len(n_ht)) {                if (i == i_main)                   next                if (inherits(object@ht_list[[i]], "Heatmap")) {                  matrix_cn = colnames(object@ht_list[[i]]@matrix)                  if (!is.null(matrix_cn)) {                    if (setequal(main_matrix_cn, matrix_cn)) {                      if (!identical(main_matrix_cn, matrix_cn)) {                        warning_wrap("Column names of heatmap ",                           i, " is not consistent as the main heatmap (",                           i_main, ")", sep = "")                      }                    }                  }                }            }        }    }    object@layout$initialized = TRUE    return(object)})
56: .local(object, ...)
57: make_layout(object, row_title = row_title, row_title_side = row_title_side,     row_title_gp = row_title_gp, column_title = column_title,     column_title_side = column_title_side, column_title_gp = column_title_gp,     heatmap_legend_side = heatmap_legend_side, merge_legends = merge_legends,     show_heatmap_legend = show_heatmap_legend, heatmap_legend_list = heatmap_legend_list,     annotation_legend_side = annotation_legend_side, show_annotation_legend = show_annotation_legend,     annotation_legend_list = annotation_legend_list, align_heatmap_legend = align_heatmap_legend,     align_annotation_legend = align_annotation_legend, legend_grouping = legend_grouping,     ht_gap = ht_gap, main_heatmap = main_heatmap, padding = padding,     auto_adjust = auto_adjust, row_dend_side = row_dend_side,     row_sub_title_side = row_sub_title_side, column_dend_side = column_dend_side,     column_sub_title_side = column_sub_title_side, row_gap = row_gap,     cluster_rows = cluster_rows, cluster_row_slices = cluster_row_slices,     clustering_distance_rows = clustering_distance_rows, clustering_method_rows = clustering_method_rows,     row_dend_width = row_dend_width, show_row_dend = show_row_dend,     row_dend_reorder = row_dend_reorder, row_dend_gp = row_dend_gp,     row_order = row_order, row_km = row_km, row_km_repeats = row_km_repeats,     row_split = row_split, height = height, heatmap_height = heatmap_height,     column_gap = column_gap, cluster_columns = cluster_columns,     cluster_column_slices = cluster_column_slices, clustering_distance_columns = clustering_distance_columns,     clustering_method_columns = clustering_method_columns, column_dend_width = column_dend_width,     show_column_dend = show_column_dend, column_dend_reorder = column_dend_reorder,     column_dend_gp = column_dend_gp, column_order = column_order,     column_km = column_km, column_km_repeats = column_km_repeats,     column_split = column_split, width = width, heatmap_width = heatmap_width,     use_raster = use_raster, raster_device = raster_device, raster_quality = raster_quality,     raster_device_param = raster_device_param, raster_resize = raster_resize)
58: make_layout(object, row_title = row_title, row_title_side = row_title_side,     row_title_gp = row_title_gp, column_title = column_title,     column_title_side = column_title_side, column_title_gp = column_title_gp,     heatmap_legend_side = heatmap_legend_side, merge_legends = merge_legends,     show_heatmap_legend = show_heatmap_legend, heatmap_legend_list = heatmap_legend_list,     annotation_legend_side = annotation_legend_side, show_annotation_legend = show_annotation_legend,     annotation_legend_list = annotation_legend_list, align_heatmap_legend = align_heatmap_legend,     align_annotation_legend = align_annotation_legend, legend_grouping = legend_grouping,     ht_gap = ht_gap, main_heatmap = main_heatmap, padding = padding,     auto_adjust = auto_adjust, row_dend_side = row_dend_side,     row_sub_title_side = row_sub_title_side, column_dend_side = column_dend_side,     column_sub_title_side = column_sub_title_side, row_gap = row_gap,     cluster_rows = cluster_rows, cluster_row_slices = cluster_row_slices,     clustering_distance_rows = clustering_distance_rows, clustering_method_rows = clustering_method_rows,     row_dend_width = row_dend_width, show_row_dend = show_row_dend,     row_dend_reorder = row_dend_reorder, row_dend_gp = row_dend_gp,     row_order = row_order, row_km = row_km, row_km_repeats = row_km_repeats,     row_split = row_split, height = height, heatmap_height = heatmap_height,     column_gap = column_gap, cluster_columns = cluster_columns,     cluster_column_slices = cluster_column_slices, clustering_distance_columns = clustering_distance_columns,     clustering_method_columns = clustering_method_columns, column_dend_width = column_dend_width,     show_column_dend = show_column_dend, column_dend_reorder = column_dend_reorder,     column_dend_gp = column_dend_gp, column_order = column_order,     column_km = column_km, column_km_repeats = column_km_repeats,     column_split = column_split, width = width, heatmap_width = heatmap_width,     use_raster = use_raster, raster_device = raster_device, raster_quality = raster_quality,     raster_device_param = raster_device_param, raster_resize = raster_resize)
59: .local(object, ...)
60: draw(ht_list, ...)
61: draw(ht_list, ...)
62: .local(object, ...)
63: draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))
64: draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))

Possible actions:
1: abort (with core dump, if enabled)
2: normal R exit
3: exit R without saving workspace
4: exit R saving workspace
Selection: 

R version 4.0.5 (2021-03-31) -- "Shake and Throw"
Copyright (C) 2021 The R Foundation for Statistical Computing
Platform: x86_64-apple-darwin17.0 (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> > if (identical(getOption('pager'), file.path(R.home('bin'), 'pager'))) options(pager='cat') # rather take the ESS one 
> options(STERM='iESS', str.dendrogram.last="'", editor='emacsclient', show.error.locations=TRUE)
> source("vignettes/joint_sc_main.R")
✔ Setting active project to '/Users/gularter/mskcc/singer/single-cell_cnv/joint_wd_dd'

clusterProfiler v3.18.1  For help: https://guangchuangyu.github.io/software/clusterProfiler

If you use clusterProfiler in published research, please cite:
Guangchuang Yu, Li-Gen Wang, Yanyan Han, Qing-Yu He. clusterProfiler: an R package for comparing biological themes among gene clusters. OMICS: A Journal of Integrative Biology. 2012, 16(5):284-287.

Attaching package: ‘clusterProfiler’

The following object is masked from ‘package:lattice’:

    dotplot

The following object is masked from ‘package:purrr’:

    simplify

The following object is masked from ‘package:stats’:

    filter

##############################################################################
Pathview is an open source software package distributed under GNU General
Public License version 3 (GPLv3). Details of GPLv3 is available at
http://www.gnu.org/licenses/gpl-3.0.html. Particullary, users are required to
formally cite the original Pathview paper (not just mention it) in publications
or products. For details, do citation("pathview") within R.

The pathview downloads and uses KEGG data. Non-academic uses may require a KEGG
license agreement (details at http://www.kegg.jp/kegg/legal.html).
##############################################################################
> tmpDir <- file.path(tmpDir, "TM1")
> figDir <- file.path("case_specific", "TM1", "figures")
> panelDir <- file.path(figDir, "panels")
> sapply(list(tmpDir, figDir, panelDir), usethis::use_directory)
[1] TRUE TRUE TRUE
> sessionInfo()
R version 4.0.5 (2021-03-31)
Platform: x86_64-apple-darwin17.0 (64-bit)
Running under: macOS Mojave 10.14.6

Matrix products: default
BLAS:   /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRblas.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/4.0/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods  
[8] base     

other attached packages:
 [1] pathview_1.30.1            clusterProfiler_3.18.1    
 [3] msigdbr_7.4.1              patchwork_1.1.1           
 [5] ape_5.5                    gac_0.0.90022             
 [7] vegan_2.5-7                lattice_0.20-44           
 [9] permute_0.9-5              ComplexHeatmap_2.7.10.9002
[11] forcats_0.5.1              stringr_1.4.0             
[13] dplyr_1.0.7                purrr_0.3.4               
[15] readr_2.0.1                tidyr_1.1.3               
[17] tibble_3.1.4               ggplot2_3.3.5             
[19] tidyverse_1.3.1           

loaded via a namespace (and not attached):
  [1] shadowtext_0.0.8            readxl_1.3.1               
  [3] backports_1.2.1             circlize_0.4.13            
  [5] fastmatch_1.1-3             plyr_1.8.6                 
  [7] igraph_1.2.6                ConsensusClusterPlus_1.54.0
  [9] splines_4.0.5               entropy_1.3.0              
 [11] BiocParallel_1.24.1         usethis_2.0.1              
 [13] GenomeInfoDb_1.26.7         digest_0.6.27              
 [15] foreach_1.5.1               GOSemSim_2.16.1            
 [17] viridis_0.6.1               GO.db_3.12.1               
 [19] fansi_0.5.0                 magrittr_2.0.1             
 [21] memoise_2.0.0               cluster_2.1.2              
 [23] doParallel_1.0.16           tzdb_0.1.2                 
 [25] Biostrings_2.58.0           graphlayouts_0.7.1         
 [27] modelr_0.1.8                matrixStats_0.60.1         
 [29] enrichplot_1.10.2           colorspace_2.0-2           
 [31] blob_1.2.2                  rvest_1.0.1                
 [33] ggrepel_0.9.1               haven_2.4.3                
 [35] xfun_0.25                   crayon_1.4.1               
 [37] RCurl_1.98-1.4              jsonlite_1.7.2             
 [39] graph_1.68.0                scatterpie_0.1.7           
 [41] SCclust_1.0.0               iterators_1.0.13           
 [43] glue_1.4.2                  polyclip_1.10-0            
 [45] gtable_0.3.0                zlibbioc_1.36.0            
 [47] XVector_0.30.0              GetoptLong_1.0.5           
 [49] Rgraphviz_2.34.0            shape_1.4.6                
 [51] BiocGenerics_0.36.1         scales_1.1.1               
 [53] DOSE_3.16.0                 DBI_1.1.1                  
 [55] Rcpp_1.0.7                  viridisLite_0.4.0          
 [57] clue_0.3-59                 bit_4.0.4                  
 [59] stats4_4.0.5                httr_1.4.2                 
 [61] fgsea_1.16.0                RColorBrewer_1.1-2         
 [63] ellipsis_0.3.2              XML_3.99-0.7               
 [65] pkgconfig_2.0.3             farver_2.1.0               
 [67] dbplyr_2.1.1                utf8_1.2.2                 
 [69] tidyselect_1.1.1            rlang_0.4.11               
 [71] reshape2_1.4.4              AnnotationDbi_1.52.0       
 [73] munsell_0.5.0               cellranger_1.1.0           
 [75] tools_4.0.5                 cachem_1.0.6               
 [77] downloader_0.4              cli_3.0.1                  
 [79] generics_0.1.0              RSQLite_2.2.8              
 [81] broom_0.7.9                 fastmap_1.1.0              
 [83] org.Hs.eg.db_3.12.0         babelgene_21.4             
 [85] knitr_1.33                  bit64_4.0.5                
 [87] fs_1.5.0                    tidygraph_1.2.0            
 [89] KEGGREST_1.30.1             ggraph_2.0.5               
 [91] nlme_3.1-152                KEGGgraph_1.50.0           
 [93] DO.db_2.9                   xml2_1.3.2                 
 [95] compiler_4.0.5              rstudioapi_0.13            
 [97] png_0.1-7                   reprex_2.0.1               
 [99] tweenr_1.0.2                stringi_1.7.4              
[101] Matrix_1.3-4                vctrs_0.3.8                
[103] pillar_1.6.2                lifecycle_1.0.0            
[105] BiocManager_1.30.16         GlobalOptions_0.1.2        
[107] cowplot_1.1.1               data.table_1.14.0          
[109] bitops_1.0-7                GenomicRanges_1.42.0       
[111] qvalue_2.22.0               R6_2.5.1                   
[113] gridExtra_2.3               IRanges_2.24.1             
[115] codetools_0.2-18            MASS_7.3-54                
[117] assertthat_0.2.1            rprojroot_2.0.2            
[119] rjson_0.2.20                withr_2.4.2                
[121] S4Vectors_0.28.1            GenomeInfoDbData_1.2.4     
[123] mgcv_1.8-36                 parallel_4.0.5             
[125] hms_1.1.0                   ggfun_0.0.3                
[127] rvcheck_0.1.8               Cairo_1.5-12.2             
[129] ggforce_0.3.3               Biobase_2.50.0             
[131] lubridate_1.7.10           
> 
jokergoo commented 2 years ago

Can you try the version on GitHub (2.9.4)? I think the problem is from plotting the dendrogram which is calculated from a matrix containing identical rows (or rows of all zeros). I remember it has been fixed in recent versions. If the error is still there, then I will have a deep look.

RodrigoGM commented 2 years ago

Hi ! thanks for the prompt response. I've installed the GitHub version (2.9.4), and had no segfaults during the test run from above. However, there was a different error (below), note that I'm plotting the same object TM1_DDRC_Hm and only changing the pdf dimensions for e.g. from a square-sized, to an A4. When I reload TM1_DDRC_Hm from an .rda, and plot only the A4, the plot goes through. The different sizes are to facilitate combining the plots on Inkscape

thanks again,

2473 >  ## Plot as Square + legend
2474 > pdf(file.path(panelDir, "TM1_DDRC_Heatmap_002.pdf"),                                                                                                                    
2475 +     width = 224/25.4, height = 210/25.4)                                                                                                                                   
2476 > draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))                                                                                                          
2477 > dev.off()                                                                                                                                                                  
2478 quartz
2479      2
2480 > ## Plot in A4                                                                                                                                                                    
2481 > pdf(file.path(panelDir, "TM1_DDRC.pdf"),                                                                                                                                
2482 +     width = 298/25.4, height = 210/25.4)                                                                                                                                   
2483 > draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))                                                                                                          
2484 Error in serialize(object, connection = NULL, ascii = ascii, version = serializeVersion) :
2485   bad version value
2486 invalid option "error"
2487 > dev.off()  
2488 > save(TM1_DDRC_Hm, file = "TM1_DDRC_Hm.rda")
... ## load libraries

2559 > load("TM1_DDRC_Hm.rda")
2560 > 
2561 > data(legSeg) ## legend
2562 > ## Plot in A4                                                                                                                                                                    
2563 > pdf(file.path(panelDir, "TM1_DDRC.pdf"),                                                                                                                                
2564 +     width = 298/25.4, height = 210/25.4)                                                                                                                                   
2565 > draw(TM1_DDRC_Hm, annotation_legend_list = packLegend(legSeg))                                                                                                          
2566 Loading required namespace: Cairo
2567 Loading required namespace: magick
2568 > dev.off()                                                                                                                                                                  
2569 null device
2570           1
jokergoo commented 2 years ago

Is data(legSeg) (I mean the legSeg.rda file) generated under R 3. and you are working under R 4.?

RodrigoGM commented 2 years ago

No, both are under R 4.x. The last update of the legend object was on Nov. 11 2020, I had v4.0.3 at the time. I'm now on v4.0.5. I'll regenerate them now see if that works. Thanks for the support

14 bash-3.2$ ls -l data/legSeg.rda 
15 -rw-r--r--  1 gularter  MSKCC\Domain Users  1096 Nov 11  2020 data/legSeg.rda