Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update UMAP_plot_wrapper() function #550

Open
sjspielman opened this issue Sep 22, 2022 · 1 comment
Open

Update UMAP_plot_wrapper() function #550

sjspielman opened this issue Sep 22, 2022 · 1 comment

Comments

@sjspielman
Copy link
Member

The sce argument needs to be documented in this function:

```{r UMAP-function}
UMAP_plot_wrapper <- function(sce = normalized_sce, nn_param = 15) {
# Purpose: Run UMAP and plot the output
# Args: nn_param: a single numeric argument that will change the
# n_neighbors variable in the calculateUMAP() function.
# Output: a scatterplot with the two UMAP coordinates plotted and
# cell-types labeled with data point colors.
# Run UMAP with a specified n_neighbors parameter
sce_umap <- scater::runUMAP(sce, dimred = "PCA", n_neighbors = nn_param)
scater::plotReducedDim(sce_umap, "UMAP", colour_by = "detected") +
# make the legend label more informative (this is ggplot2 code!)
guides(color = guide_colourbar(title="genes\nexpressed"))
}
```

Noting also that during training, @jashapiro wondered if we should change guides() to labs(colour = ...), but then a bit later during training when we made another UMAP plot, that approach didn't play well with scater's function, so sticking with guides() here is probably the thing to do.

@jashapiro
Copy link
Member

Thank you for filing this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants