Hi jma1991
In the current version of the code it's not possible to set the aspect ratio. However it's entirely possible - and rather straightforward - to add a UI input to relevant panels and generate the corresponding coord_fixed(ratio = 1)
bit of code in the code tracker. Can you please open an issue with the feature request? We'll get on it as soon as time allows.
It is possible to provide custom colormaps to the iSEE app using the ExperimentColorMap
Using the example in the ?iSEE
man page, as a brute force example, I'm setting a symmetric colormap that will be applied exclusively to the "PCT_RIBOSOMAL_BASES"
colData column, while all other covariates will use the default continuous colormap. See the ExperimentColorMap vignette and man pages for more details.
library(scRNAseq)
# Example data ----
sce <- ReprocessedAllenData(assays="tophat_counts")
class(sce)
library(scater)
sce <- logNormCounts(sce, exprs_values="tophat_counts")
sce <- runPCA(sce, ncomponents=4)
sce <- runTSNE(sce)
rowData(sce)$ave_count <- rowMeans(assay(sce, "tophat_counts"))
rowData(sce)$n_cells <- rowSums(assay(sce, "tophat_counts") > 0)
sce
# ExperimentColorMap ----
rwb <- colorRampPalette(colors = c("red", "grey", "blue"))
ecm <- ExperimentColorMap(
colData = list(
PCT_RIBOSOMAL_BASES = rwb
)
)
# launch the app itself ----
app <- iSEE(sce, colormap = ecm)
if (interactive()) {
shiny::runApp(app, port=1234)
}
In the future, please open one post per question that you have, so that we can mark them answered separately.
Thank you for your feedback!
Kevin
Thank you for replying Kevin, I will open a feature request on GitHub regarding the aspect ratio. Regarding the colour scale, I've realised what I actually want is to have the limits of the scale equidistant from zero. For example, if I generate a new column with a hypothetical z-score and one extreme positive value, white is no longer the middle colour (i.e. at zero).
Indeed, I just checked and our current framework will return the same vector of colors irrespective or what the values are (neither the plotted, nor the full range of values if the panel only shows a subset
If you look at the code tracker in the example iSEE app, colored by
"TOTAL_DUP"
colData, you'll something like:This bit fetches the colormap function:
And it is used to fetch a vector of 21 colors without being told anything about the values (e.g. their range)
I'd encourage you to open another issue for feature request, though that one would require a bit (a lot?) more thinking than your other questions, because it wouldn't just be another user-controlled UI input, but rather another of the iSEE features that is a combination of user input and automagical adaptation to the data at hand.
Best Kevin