Open johnyaku opened 2 years ago
... and in a similar vein it would be helpful to add the dot-dot-dot operator (...
) to the function signature as follows:
visImportance <- function(
sce,
plot = c("boxplot", "heatmap"),
altExp_name = "ADT",
exprs_value = "logcounts",
...
)
and then pass this into the pheatmap
call like this ...
pheatmap::pheatmap(
corMat_adt,
clustering_method = "ward.D2",
annotation_col = anno_col,
breaks = seq(-0.8, 0.8, 1.6/100),
...
)
... so that users can pass through additional tweaks to pheatmap
, such as legend = FALSE
or fontsize = 6
etc.
The
boxplot
option forvisImportance()
constructs aggplot
object (g
) in lines 191~203 ofimportanceADT.R
, which is then printed on line 204. The function would be more flexible if it returnedg
rather than printing it. This would allow the user to add their own themes, labels, titles, etc via the+
operator provided byggplot
and then print it. (Actually, RStudio will print it to thePlots
panel automatically and Rmarkdown documents will print plots by default, but callingprint()
in other contexts is not too painful.) As it is, the text for the ADT names tends to overlap if there are a large number of ADT probes, which would not be a problem if I could adjust the font size, for example. Thanks for a great package :)