-
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
Open
cornhundred
wants to merge
25
commits into
main
Choose a base branch
from
DEGA-106-Segmentation-Metrics
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
7d4e472
setting up boiler plate
cornhundred d9a7241
metrics addition + pre-process nb corrections
jaspreetishar 9158935
remove comments
jaspreetishar 03b913a
column name fix
jaspreetishar 7e85a6c
clean up
jaspreetishar 1d4459a
added extra metrics info as comments
jaspreetishar 4e39919
included gene specific metrics
jaspreetishar 95956a1
remove image intensity calc, clean up segmentation_qc.ipynb
jaspreetishar 4e8f4ae
qc module name update
jaspreetishar 172a1fa
xenium-default support, remove cells per um2 metric, concise metric n…
jaspreetishar 9fd6060
output address fix, notebook changes
jaspreetishar f95d06b
working on custom segmentation
jaspreetishar de4ca6e
Merge branch 'main' into DEGA-106-Segmentation-Metrics
jaspreetishar cf5a68e
disjoint marker script addition in qc
jaspreetishar 8eb29bf
segmentation_qc notebook clean up
jaspreetishar 92bf616
more qc functions for default xenium results
jaspreetishar 5bdd4bc
pulling changes from main to segmentation metrics branch
jaspreetishar 2767e74
update branch with main
jaspreetishar 57ec0bb
remove redundant functions
jaspreetishar af66df4
notebook check run
jaspreetishar c4f6b91
update with main
jaspreetishar 82d95cc
remove algorithm specific, cell type specific lines
jaspreetishar 3b65e0e
changes after review
jaspreetishar 31a8709
notebook changes
jaspreetishar 066a6ac
more review changes
jaspreetishar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
655 changes: 87 additions & 568 deletions
655
notebooks/Pre-process_Xenium_Prime_Human_Lymph_Node_Reactive_FFPE_outs.ipynb
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jaspreetishar marked this conversation as resolved.
Show resolved
Hide resolved
|
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 These are minor but can enhance readability, simplicity, and mostly important, reproducibility.
For the string that needs to be repeated multiple times (say more than 2-3 times),it is better to make it a variable so you only need to change one place later if needed. 2. Additionally, use for loop if possible.
For example:
cell_polygon_metadata_files = [f"data/segmentation_metrics_data/inputs/{directories[0]}/cell_metadata.parquet", f"data/segmentation_metrics_data/inputs/{directories[1]}/cell_metadata.parquet", f"data/segmentation_metrics_data/inputs/{directories[2]}/cell_metadata.parquet", None]
and
paths_output_cell_metrics = [f"data/segmentation_metrics_data/outputs/cell_specific_metrics_{dataset_name}-{segmentation_approaches[0]}.csv", f"data/segmentation_metrics_data/outputs/cell_specific_metrics_{dataset_name}-{segmentation_approaches[1]}.csv", f"data/segmentation_metrics_data/outputs/cell_specific_metrics_{dataset_name}-{segmentation_approaches[2]}.csv", f"data/segmentation_metrics_data/outputs/cell_specific_metrics_{dataset_name}-{segmentation_approaches[3]}.csv"]
can be simplified as:
cell_polygon_metadata_files = [ f'{seg_qc_dir}/inputs/{d}/cell_metadata.parquet' for d in directories[:3] ] + [None]
paths_output_cell_metrics = cell_polygon_metadata_files = [ f'{seg_qc_dir}/outputs/cell_specific_metrics_{dataset_name}-{sa}.csv' for sa in segmentation_approaches ]
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.
Thanks for providing the example data. I am getting an error during the 4th iteration of the for loop, presumably, it is from skin_xenium_default. Do you have any idea?
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.
The error was due to a faulty transformation matrix. I have fixed it and will share it shortly.
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.
Thanks for making the effort to simplify the code. In lines with reproducibility, the variable
directories
can be calculated as following so you don't need to spell them out and next person on a different dataset only need to change the value of variabledataset_name
instead of 4 strings:directories = [f"{dataset_name.lower()}_{d.lower().replace('-','_')}" for d in segmentation_approaches]
. This one is minor you don't have to change the code but it will be good to get familiar with.