signac icon indicating copy to clipboard operation
signac copied to clipboard

Options for ncol and keeping order of idents in RegionHeatmap

Open mossconfuse opened this issue 8 months ago • 0 comments

Thanks for the useful tools, as always.

I was toying with the RegionHeatmap function, but ultimately had to copy and modify it to produce my own version. Based on that, I recommend adding arguments for ncol, so the user can specify the number of columns the individual facets are arranged in. Also, rearranging the facets by idents, as they keep getting reshuffled (1,2,3,10 ->1,10,2,3):

data.use <- all.assay[all.assay$assay == assay[[i]], 
      ]
data.use$group <- factor(x = data.use$group, levels = idents)

    pp <- ggplot(data = data.use, mapping = aes_string(x = "bin", 
      y = "name", fill = "value")) + facet_wrap(facets = ~group, 
      scales = "free_y", nrow = nrow, ncol = ncol) + geom_raster() + 

I also kept getting "Error in colors_all[[assay[[i]]]] : subscript out of bounds" when I tried to supply a single custom cols and a singular assay ("peaks"), so I had to overwrite with

names(x = colors_all) <- assay

mossconfuse avatar Jun 21 '24 06:06 mossconfuse