-
Notifications
You must be signed in to change notification settings - Fork 25
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
Ensure interactive visualization can be run iteratively #541
Conversation
Removed the code review request to discuss one remaining issue with setting the As the notebooks are written now, we set
|
Can you post a screenshot of before/after?
…On Tue, May 10, 2022, 1:19 PM alex-l-kong ***@***.***> wrote:
Removed the code review request to address one remaining issue with
setting the matplotlib backends. Running %matplotlib inline multiple
times will cause %matplotlib widget to fail.
Currently, we set %matplotlib inline in all non-interactive cells, which
won't do. There are 2 fixes, let me know which one is preferable:
1. *Don't change the backend to inline for the pixel and cell cluster
overlays (or the weighted channel heatmaps for cells)*: the preferable
one in my opinion. this will leave the backend as widget for all of
these. These figures can be interacted with, zoomed in. Only downside is
they may appear a bit larger than with inline with a bit more padding
on the sides.
2. *Have one call to %matplotlib inline but have a note to the user to
run it just once*: I don't like this solution personally, it's leads
to a very awkward workflow. Only advantage I see is it does allow the
figures to display statically, like they were.
—
Reply to this email directly, view it on GitHub
<#541 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJB47IZ5647KSNFMB54IHDVJLADXANCNFSM5VJMO34Q>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
I think that's fine, if people are going to use those plots for anything they'll export them as PDFs anyway, so as long as it shows up well enough in the cells to see I think it's okay |
Tried it out on pixel and cell clustering, didn't run into any issues |
Tested it a bit and also didn't run into issues. I agree with Noah, it looks fine (so option 1, not including |
Also, this isn't related to this pull request but it came up when I was testing just now, so I thought it'd be easier to put it here. In this code chunk in section 3.2:
I think The way it is now was causing errors for me. |
Oh crud, seems like I uploaded a notebook containing an older version of this cell with incorrect path specification. I'll be sure to fix that. |
Yup I ran into the same issue, I think this was fixed before
…On Thu, May 12, 2022 at 12:43 AM alex-l-kong ***@***.***> wrote:
Also, this isn't related to this pull request but it came up when I was
testing just now, so I thought it'd be easier to put it here. In this code
chunk in section 3.2:
# define the path to the channel file
if img_sub_folder is None:
chan_file = os.path.join(
fovs[0], io_utils.list_files(os.path.join(tiff_dir, fovs[0]), substrs=['.tif', '.tiff'])[0]
)
else:
chan_file = os.path.join(
fovs[0], img_sub_folder, io_utils.list_files(os.path.join(tiff_dir, img_sub_folder, fovs[0]), substrs=['.tif', '.tiff'])[0]
)
I think fovs[0], img_sub_folder,
io_utils.list_files(os.path.join(tiff_dir, img_sub_folder, fovs[0]),
substrs=['.tif', '.tiff'])[0] in the else statement should be replaced
with fovs[0], img_sub_folder, io_utils.list_files(os.path.join(tiff_dir,
fovs[0], img_sub_folder), substrs=['.tif', '.tiff'])[0] (seems as if
img_sub_folder is in the wrong place).
The way it is now was causing errors for me.
Oh crud, seems like I uploaded a notebook containing an older version of
this cell with incorrect path specification. I'll be sure to fix that.
—
Reply to this email directly, view it on GitHub
<#541 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ADJB47NCDH6AVGKE3PQUH7LVJSZDFANCNFSM5VJMO34Q>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Oh yeah that works too. I'll make this change and push the changes. |
So while this solution will work with the meta cluster heatmap, it's better to have this heatmap for the SOM clusters. Unfortunately, |
Was able to play around with some of the GridSpec features of
The main problem with |
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.
Tested it and didn't run into issues, but what is the reason for "NOTE: after running or re-running the remapping widget, only run the following cell below ONCE. Do NOT run it more than once after a remapping session or it will break the interactivity of the widget on future runs." in the cell clustering notebook? Why can't that heatmap be generated more than once - I thought you had outlined solutions for this above? What would be the solution for someone who does make that heatmap and then decide they want to go back and change clusters - re-run the whole notebook?
Forgot to remove this comment, it was a leftover from my previous version including |
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.
OK this should do the trick. |
What is the purpose of this PR?
Closes #520. Users may want to run the interactive visualization in the same session multiple times if they determine the original meta cluster remapping needs changes. Currently, there is no way to do this.
metacluster
values are integersHow did you implement your changes
Flexibility has been added to account for the additional
rename
problem which solves both issues 1 and 2 listed above:metacluster_from_files
infile_reader.py
now handles the renaming of the{pixel/cell}_meta_cluster_rename
column tometacluster_rename
. This provides a backbone that we can work off of inmetaclusterdata.py
._metacluster_displaynames_map
inMetaClusterData
gets prepopulated to ensure that the axes labels contain the renamed meta clusters where applicable.clusters_from_metaclusters
property inMetaClusterData
also takes into account themetacluster_rename
column when reindexing with_marker_order
. Previously, it was assumed that there would just be themetacluster
column.clusters
property inMetaClusterData
also drops themetacluster_rename
column if necessary to prevent clashes (for example, with computinglinkage_matrix
).Remaining issues
The visualization has not been tested on a variety of datasets as I have only 1 on hand.