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

Add nuclear filtering functionality to pixel clustering pipeline #653

Merged
merged 6 commits into from
Aug 17, 2022

Conversation

alex-l-kong
Copy link
Contributor

What is the purpose of this PR?

Closes #619. Prior to pixel clustering, users may need to filter out non-nuclear marker signal from the nucleus and vice-versa for nuclear marker signal.

How did you implement your changes

Add a function filter_with_nuclear_mask to som_utils which runs this process. The code in #619 provides most of the functionality, however we'll need to make two modifications:

  • Ensure seg_dir is not None prior to running. Users may run pixel clustering without segmentation labels, however they will not be able to run this function if that's the case because it relies on the _feature_1.tiff files.
  • Ensure channel defaults to None in the notebook and function. This is the easiest guard against errors caused by running all the cells at once in the notebook.

The cell that calls this function in example_pixel_clustering will be placed after the smoothing process.

This PR also solidifies some of the notebook testing, as it was not using the renamed channels after smoothing. This should also apply for the nuclear filtering tests too.

@alex-l-kong alex-l-kong self-assigned this Aug 13, 2022
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@@ -174,7 +174,7 @@
"cell_type": "markdown",
Copy link
Member

@ngreenwald ngreenwald Aug 16, 2022

Choose a reason for hiding this comment

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

Rather than having this as None, we should tell the user to skip the cell if they don't want to run it


Reply via ReviewNB

Copy link
Member

@ngreenwald ngreenwald left a comment

Choose a reason for hiding this comment

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

Looks good, just a minor tweak

ark/phenotyping/som_utils.py Show resolved Hide resolved
ark/phenotyping/som_utils.py Outdated Show resolved Hide resolved
Co-authored-by: Noah F. Greenwald <noahfgreenwald@gmail.com>
@ngreenwald ngreenwald merged commit 65f2086 into master Aug 17, 2022
@ngreenwald ngreenwald deleted the nuc_filter branch August 17, 2022 05:46
srivarra pushed a commit that referenced this pull request Aug 18, 2022
* Add nuclear mask filtering to som_utils

* Add nuclear filtering method to pixel clustering notebook

* Print informative message instead of error if seg_dir is None, and check for valid seg_dir if provided

* Remove extra print statement

* Update ark/phenotyping/som_utils.py

Co-authored-by: Noah F. Greenwald <noahfgreenwald@gmail.com>

Co-authored-by: Noah F. Greenwald <noahfgreenwald@gmail.com>
@srivarra srivarra added bug Something isn't working enhancement New feature or request and removed bug Something isn't working labels Aug 18, 2022
ngreenwald added a commit that referenced this pull request Aug 23, 2022
* change notebook names

* Update README.md

* Text changes for clustering description

* testbook fix

* Readme adjustements, waiting for Pixie preprint

* Add PIxie preprint

* added pixie to citation section

* added years to citation links

* overview fix

* bolding fix

* Add nuclear filtering functionality to pixel clustering pipeline (#653)

* Add nuclear mask filtering to som_utils

* Add nuclear filtering method to pixel clustering notebook

* Print informative message instead of error if seg_dir is None, and check for valid seg_dir if provided

* Remove extra print statement

* Update ark/phenotyping/som_utils.py

Co-authored-by: Noah F. Greenwald <noahfgreenwald@gmail.com>

Co-authored-by: Noah F. Greenwald <noahfgreenwald@gmail.com>

* Ensure channel norm and pixel norm files get re-computed if a new set of channels are provided (#654)

* Initial commit of normalization updates

* Remove capsys call

* Provide more robust support by resetting entire pixel_output_dir if new set of channels provided

* readme updates

* readme updates

* improved pairwise spatial enrichment analysis notebook name

* fixed mantis-link in readme

Co-authored-by: Candace Liu <candace.liu94@gmail.com>
Co-authored-by: Sricharan Reddy Varra <srivarra@stanford.edu>
Co-authored-by: alex-l-kong <31424707+alex-l-kong@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add nuclear pixel filtering to clustering pipeline
3 participants