-
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
Append cell meta cluster labels to cell table #567
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
…t appending of meta cluster 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.
Looks good to me
Sorry I already approved the changes, but I just thought of a possible use case that might cause an error with this implementation. For very small cells (or weird cells), it's possible they're not included in the cell clustering (if there are no pixel clusters in there). In that case, the cell table and the cell clustering output wouldn't have the same entries. It would probably best to have those say "Unassigned" or something like that in the metacluster column in the cell table. |
What is the purpose of this PR?
Closes #551 and closes #523. The cell table is a requirement for several downstream analysis scripts, not just pixel clustering. To ensure analysis can be performed based on the cell meta cluster labels, these will need to be appended to the cell table as well.
How did you implement your changes
A function
add_consensus_labels_cell_table
will run this appending process, with the call inexample_cell_clustering.ipynb
placed at the end of the notebook. The originalcell_table_name
will be overwritten with the same data including the'cell_meta_cluster_rename'
column incell_consensus_name
(simply'cell_meta_cluster'
in the cell table).Users will be able to save multiple times and can also re-run the cell SOM training with the newly-saved cell table if desired.
Additionally, we now allow more flexible locations for the cell table. Initially, it was forced to be in
base_dir
. Now, we default the location tosegmentation_dir
, with options to change the root. Note that the updated cell table will be saved in the same root directory as the original cell table.