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

DEGA-106-Segmentation-Metrics #36

Open
wants to merge 32 commits into
base: main
Choose a base branch
from

Conversation

cornhundred
Copy link
Collaborator

Adding a qc module that will contain a iST segmentation metrics method.

@jaspreetishar jaspreetishar marked this pull request as ready for review November 19, 2024 17:12
@jaspreetishar jaspreetishar force-pushed the DEGA-106-Segmentation-Metrics branch from 27e9e5a to 95956a1 Compare November 20, 2024 21:39
@jaspreetishar jaspreetishar marked this pull request as draft December 18, 2024 21:13
@cornhundred cornhundred marked this pull request as ready for review January 17, 2025 02:03
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/pre/boundary_tile.py Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
@jaspreetishar jaspreetishar marked this pull request as draft January 17, 2025 17:14
@jaspreetishar jaspreetishar marked this pull request as ready for review January 17, 2025 17:14
@jaspreetishar jaspreetishar self-assigned this Jan 17, 2025
Copy link
Contributor

@huanlity huanlity left a comment

Choose a reason for hiding this comment

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

Hi @jaspreetishar, great work! I had some minor comments that is focusing on readability, simplicity, and reproducibility of our codebase. Other than that, can share the data dir data/segmentation_metrics_data so I can do a quick test of the QC notebook? Thanks!

notebooks/Segmentation_QC.ipynb Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
src/celldega/qc/__init__.py Outdated Show resolved Hide resolved
notebooks/Segmentation_QC.ipynb Outdated Show resolved Hide resolved
@huanlity
Copy link
Contributor

huanlity commented Jan 27, 2025

As long as you change this line in the notebook:

directories = [f"{dataset_name.lower()}_{d.lower().replace('-','_')}" for d in segmentation_approaches]

to this to prevent a file existence error:

directories = [
    f"{dataset_name.lower().replace('-','_')}_{d.lower().replace('-','_')}" for d in segmentation_approaches
    ]

I tested, everything LGTM! Great job! ✅

@jaspreetishar
Copy link
Contributor

As long as you change this line in the notebook:

directories = [f"{dataset_name.lower()}_{d.lower().replace('-','_')}" for d in segmentation_approaches]

to this to prevent a file existence error:

directories = [
    f"{dataset_name.lower().replace('-','_')}_{d.lower().replace('-','_')}" for d in segmentation_approaches
    ]

I tested, everything LGTM! Great job! ✅

I have made the changes - thanks so much for the helpful review!!

@jaspreetishar
Copy link
Contributor

Hi @cornhundred, the branch has been reviewed. If everything looks good on your end as well, could we go ahead and merge it? Thanks!

pyproject.toml Outdated Show resolved Hide resolved
@cornhundred
Copy link
Collaborator Author

Possibly rename "mixed_expression_calc" to something like "orthogonal_expression_calc". Also, add quantification to this method. Calculate proportion of cell-type-A cells that express cell-type-B genes above some threshold and vice versa. We can also sanity check that a cell expressing an orthogonal marker from a different cell type is actually neighboring a cell from the orthogonal cell type.

segmentation_approach : str
Description of the segmentation method used.

subset_interval_y_x : tuple
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@jaspreetishar we can drop the subset_interval_y_x from the docstring

dataset_name="Dataset1",
segmentation_approach="MethodA",
subset_interval_y_x=(0, 1000, 0, 1000),
transform_file="path/to/transform.mat",
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I do not think we need to transform transcripts or cell polygons to image coordinates for segmentation QC. We also need to have a version of the STP segmentation data in micron coordinates.

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.

3 participants