-
Notifications
You must be signed in to change notification settings - Fork 26
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
Post clustering functionality #658
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
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.
Mostly small comments.
|
||
`cell_segmentation`: This file contains the predicted segmentation for each cell in the image, and allows mantis to identify individual cells. | ||
|
||
`population_pixel_mask`: This file maps the individual pixel clusters generated by Pixie in the [pixel clustering notebook](link) to the image data. |
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.
Add the link to the pixel clustering notebook.
# generate unique numeric value for each population | ||
unique_pops = small_table[pop_col].unique() | ||
small_table['pop_vals'] = small_table[pop_col].replace(to_replace=unique_pops, | ||
value=list( | ||
range(1, len(unique_pops) + 1))) |
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.
# generate unique numeric value for each population | |
unique_pops = small_table[pop_col].unique() | |
small_table['pop_vals'] = small_table[pop_col].replace(to_replace=unique_pops, | |
value=list( | |
range(1, len(unique_pops) + 1))) | |
small_table['pop_vals'] = pd.factorize(small_table[pop_col].tolist())[0] + 1 |
|
||
|
||
def create_mantis_project(cell_table, fovs, seg_dir, pop_col, mask_dir, image_dir, mantis_dir): | ||
"""Creates masks with the updated cell labels""" |
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.
Needs a more descriptive docstring defining the Args.
@@ -0,0 +1,395 @@ | |||
{ |
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.
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.
Yeah agreed
@@ -0,0 +1,395 @@ | |||
{ |
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.
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.
They're in the PR
@cliu72 @efrancis28 let me know if this makes sense for a post-clustering workflow, any other changes, etc |
This looks good to me. |
If you haven't already, please read through our contributing guidelines before opening your PR
What is the purpose of this PR?
Adds in logic to annotate the cell table following pixel clustering, as well as detailed instructions for how to use Mantis.
How did you implement your changes
A notebook with two parts. The first allows the user to select subsets of cells, give them new names, and then create a mantis directory to examine them. The second allows the user to identify specific thresholds for functional markers.
Remaining issues
For people who haven't used Mantis, is this clear enough guidance for what they need to do? Are there places where the bare code in the notebook is going to lead to problems? Given that the user is directly manipulating the pandas df there are some inelegant lines still in there, but I couldn't think of a way to avoid it that wasn't super over-engineered.