davismcc / archive-scater

An archived version of the scater repository, see https://github.com/davismcc/scater for the active version.
64 stars 18 forks source link

plotReducedDim.SCESet: colour by exprs/norm_exprs/... ? #97

Closed kevinrue closed 7 years ago

kevinrue commented 7 years ago

Dear Davis,

I just realised that the plotReducedDim.SCESet function uses values stored in exprs(object) when overlaying gene expression data on reduced dimensions plot: See https://github.com/Bioconductor-mirror/scater/blob/master/R/plotting.R#L1591

From your separate message on my pull request, I know you're swamped in work at the moment, but do you agree that it would be nice to let users pick the assayData slot from which to use gene expression data in this function? Something like the exprs_values argument of the plotSCESet function for instance:

plotPCASCESet <- function(object, ntop=500, ncomponents=2,
                      exprs_values = "exprs", colour_by = NULL,
                      shape_by = NULL, size_by = NULL, feature_set = NULL,
                      return_SCESet = FALSE, scale_features = TRUE,
                      draw_plot = TRUE, pca_data_input = "exprs",
                      selected_variables = NULL, detect_outliers = FALSE,
                      theme_size = 10, legend = "auto")

All the best, Kevin

davismcc commented 7 years ago

Yes, this makes good sense - thanks for the suggestion/catch. Hoping to get back to some scater devel next week!

davismcc commented 7 years ago

Hi Kevin

This should be working as desired in the current version of scater. I don't know off the top of my head exactly when this was changed/added, but it should be fine now.

e.g.

plotReducedDim(example_sceset, colour_by = "Gene_0001")
plotReducedDim(example_sceset, colour_by = "Gene_0001", exprs_values = "counts")

both work for me in version 1.3.39. Do let me know if you're not getting the expected behaviour.

Best Davis

kevinrue commented 7 years ago

Yep, all good on my end (installed with devtools::install_github). Thanks !