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

hello-clusters sweep notebook #982

Merged
merged 18 commits into from
Jan 14, 2025

Conversation

sjspielman
Copy link
Member

Closes #797

This PR adds the next hello-clusters notebook to sweep parameters.
In the first section, I sweep across nn=seq(10,30,10), plot UMAPs, and calculate & plot metrics with a brief sentence interpreting. In the second section, I sweep across nn=seq(10,30,10) and res=seq(5,15,5)/10 and show code to assess the results but I do not interpret. Currently I don't export anything. It didn't seem to me that anything was super necessary to export to communicate the main notebook points, but I suppose we can export a TSV or PNG or so if something is really wanted.

I also updated the module README and added this next notebook to the module bash script.

Please let me know where I can expand, shorten, or reframe! Here's the notebook:
02_compare-clustering-parameters.nb.html.zip

@sjspielman sjspielman requested review from jashapiro and removed request for jaclyn-taroni January 13, 2025 16:01
@sjspielman sjspielman removed the request for review from jashapiro January 13, 2025 16:05
@sjspielman sjspielman marked this pull request as draft January 13, 2025 16:40
@sjspielman sjspielman marked this pull request as ready for review January 13, 2025 16:46
@sjspielman
Copy link
Member Author

Ready for review, now using the Docker image in CI!

@sjspielman sjspielman requested a review from jashapiro January 13, 2025 16:47
Copy link
Member

@jashapiro jashapiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good overall. Most of my comments are pretty minor, so I don't think I need to see this again.

* `resolution`: The resolution parameter (1; used only with Louvain and Leiden clustering)
* `objective_function`: The objective function to optimize clusters (CPM; used only with Leiden clustering)

`rOpenScPCA::sweep_clusters()` does allow you to specify values for any other parameters.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you are trying to say here? Can you clarify this?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was in fact trying to say "doesn't", which is a rather different interpretation!

# Plot the UMAP, colored by the new cluster variable
ggplot(umap_df_plot, aes(x = UMAP1, y = UMAP2, color = cluster)) +
geom_point(alpha = 0.6) +
labs(title = glue::glue("nearest neighbors: {clustering_name}")) +
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had a thought that you might instead show this by getting the value from the table rather than the list name, but either way is fine. I might say when you name the list that you will use it for labeling plots, rather than just saying it is optional.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Update, I see you do this later, so I think it is fine to show both ways. I'd still add the comment when you add the names though!

@sjspielman sjspielman merged commit 109720d into AlexsLemonade:main Jan 14, 2025
3 checks passed
@sjspielman sjspielman deleted the sjspielman/797-hello-sweep branch January 14, 2025 20:23
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

Successfully merging this pull request may close these issues.

Add notebook to demonstrate sweeping cluster parameters with rOpenScPCA
2 participants