Skip to content
New issue

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

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

Already on GitHub? # to your account

generic cell cluster notebook for nimbus #1068

Open
HPiyadasa opened this issue Sep 28, 2023 · 3 comments
Open

generic cell cluster notebook for nimbus #1068

HPiyadasa opened this issue Sep 28, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@HPiyadasa
Copy link

Currently in the generic cell clustering notebook, the heatmap widget shows valued that is scaled/Z scored. This is not informative when working with nimbus output that generates a probability score from 0-1 for each marker.

Describe the solution you'd like
Remove any data transformation from the heatmap widget used for nimbus.

@alex-l-kong

@HPiyadasa HPiyadasa added the enhancement New feature or request label Sep 28, 2023
@ngreenwald
Copy link
Member

I thought there was already the option to do this? Maybe it's not turned on by default in the notebook? Pretty sure @JLrumberger added this in.

@HPiyadasa
Copy link
Author

HPiyadasa commented Oct 2, 2023

I am not sure. The only way I got this to work was by altering the ZscoreNormalize and update_gui functions to do nothing

`
class ZScoreNormalize(Normalize):
def init(self, vmin=None, vcenter=None, vmax=None):
super().init(vmin, vmax) # Retain superclass initialization

def inverse(self, value):
    return value  # Return the value as-is

def calibrate(self, values):
    pass  # Do nothing

def __call__(self, value: np.ndarray, clip=None):
    return value  # Return the value as-is

`

and

`
def update_gui(self):
"""Update and redraw any updated GUI elements"""
self.im_cs.set_data(self.selection_mask)
self.im_cs.set_extent((0, self.mcd.cluster_count, 0, 1))

    if not self._heatmaps_stale:
        print("skipping other repaints")
        self.fig.canvas.draw()
        return

    # def _preplot(df):
    #     return df.apply(zscore).clip(upper=self.zscore_clamp_slider.value).T
    
    def _preplot(df):
        return df.T  # Avoiding z-score normalization and clipping

`

@JLrumberger
Copy link

We only added the option to make normalization optional for cell_som_clustering in issue #1000. But we didn't touch the GUI widget yet.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants