-
Notifications
You must be signed in to change notification settings - Fork 30
Fix cell cluster visualization in Mantis #1083
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
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a few small things:
- The size of the actual plots look much better, but the font is now weirdly big. Are you seeing this on your machine too?
- Maybe this doesn't belong here (and could be it's own issue), but I noticed it while I was reviewing this.
post_cluster_utils.create_mantis_project
isn't ever used for pixel clustering (seems like it's only used in 4_Post_Clustering.ipynb to look at cell clusters). I think it's confusing to havecluster_type
as a parameter (since it will never be set topixel
). Actually, I don't think it would work ifcluster_type
were ever set to pixel, because"pop_vals"
would be changed tocluster_id
(line 159), which is not the right nomenclature for the pixel clustering table. I think it'd be better to just removecluster_type
at all and assume this function will only be used for cells. Also in thecreate_mantis_project
function, I don't understand whysmall_table
is needed (line 119), since it's going to be fed intoClusterMaskData
, which is able to be created directly from the cell table.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good to me! I was actually using a Linux machine to look at the image before, but I just tried on my windows machine and it also looks weird. I wonder if it's a screen resolution thing.
Can you try if dpi=150 and figsize=(5,5) looks okay on your machine? If it looks like not too crazy, maybe we can set that as the default. That looks good for both Linux and Windows for me.
Also, I think it would be good to add dpi as a parameter in the notebook so people easily know they change it, and also add text telling them to change these values if it looks weird. So like to the pixel clustering notebook, after "Load a subset of the pixel cluster masks that you would like to preview." add "If the dimensions or text size of the plot need to be adjusted for optimal viewing, change the dpi
and figsize
parameters." And same thing to the cell clustering notebook.
@cliu72 5x5 with dpi=150 looks great on my end! Once you approve I can merge it in. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
If you haven't already, please read through our contributing guidelines before opening your PR
What is the purpose of this PR?
Closes Erosion and size of
plot_pixel_cell_cluster
output #1075.Make minor tweaks to Pixie notebooks regarding plotting output.
Closes Incorrect cell cluster mapping in mantis #1082.
Ensure that the correct integer IDs are mapped to each cell cluster name in Mantis viewer.
How did you implement your changes
The
erode
parameter inplot_utils.plot_pixel_cell_cluster()
is defaulted to True. Since it is also explicitly set to True in both the pixie cell clustering and generic cell clustering notebooks, we can just set the default to False to remove it from the pixel clustering output.Adjust the
data_utils.generate_and_save_cell_cluster_masks()
function to update the cell_meta_cluster_mapping.csv at the same time it generates new integer IDs for the cell cluster masks. The new 'cluster_id' column is then read intoplot_utils.create_mantis_dir()
instead of the outdated 'cell_meta_cluster' values; this allows an accurate cell cluster mapping file to be generated and uploaded into mantis viewer.Remaining issues
None. This bug had no effect on the cell table, since only the cluster name (not the integer ID) is stored there. Post-clustering is also not an issue, since a custom integer mapping is created in the
create_mantis_project()
function.