-
Notifications
You must be signed in to change notification settings - Fork 0
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
base: main
Are you sure you want to change the base?
Conversation
27e9e5a
to
95956a1
Compare
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.
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!
As long as you change this line in the notebook:
to this to prevent a file existence error:
I tested, everything LGTM! Great job! ✅ |
I have made the changes - thanks so much for the helpful review!! |
Hi @cornhundred, the branch has been reviewed. If everything looks good on your end as well, could we go ahead and merge it? Thanks! |
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. |
src/celldega/qc/__init__.py
Outdated
segmentation_approach : str | ||
Description of the segmentation method used. | ||
|
||
subset_interval_y_x : tuple |
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.
@jaspreetishar we can drop the subset_interval_y_x from the docstring
src/celldega/qc/__init__.py
Outdated
dataset_name="Dataset1", | ||
segmentation_approach="MethodA", | ||
subset_interval_y_x=(0, 1000, 0, 1000), | ||
transform_file="path/to/transform.mat", |
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.
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.
|
||
if technology_name == 'STP': | ||
|
||
with open(os.path.join(base_path, "segmentation_parameters.json"), 'r') as parameter_file: |
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.
This seems like a critical file, I suggest adding a line to check the existence of this file to avoid error. Also, it does not seems right to store segmentation_parameters.json
in current working directory which is notebooks
. Please consider moving it to a data folder or somewhere that makes more sense. You can always gitignore a folder (in this case, data/
) that you don't want to push to Github.
src/celldega/qc/__init__.py
Outdated
|
||
print("segmentation metrics calculation completed") | ||
|
||
def mixed_expression_calc(default_segmentation_segmentation_name, default_segmentation_cell_feature_matrix_path, algorithm_names, algorithm_specific_cbg_files, cell_type_A_specific_genes, cell_type_B_specific_genes, cell_A_name, cell_B_name, cmap='cividis'): | ||
def mixed_expression_calc(base_paths, cell_type_A_specific_genes, |
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.
Please consider renaming the function to orthogonal_expression_calc()
or something else that is more informative as we mentioned earlier.
Adding a qc module that will contain a iST segmentation metrics method.