Skip to content

FlowSOM#59

Merged
mbuttner merged 11 commits into
mainfrom
clustering-algorithms
Nov 7, 2023
Merged

FlowSOM#59
mbuttner merged 11 commits into
mainfrom
clustering-algorithms

Conversation

@burtonrj
Copy link
Copy Markdown
Collaborator

I've introduced FlowSOM under the tools.clustering module. The FlowSOM implementation is as a a function flowsom_clustering and is similar to scanpy functions. Dependency on consensusclustering a package I've put together to implement consensus cluster in Python. Other things to note:

  • flowsom_clustering returns an annotated dataframe with the labels introduced under a new key (which the user can specify)
  • flowsom_clustering can optionally return the SOM and ConsensusClustering objects for inspection (see tutorial for an example)
  • FlowSOM tutorial added as a jupyter notebook - please review for a general overview of usage
  • Minor refactors to plotting functions to allow for Axes object to be passed - fixed minor bugs and missing docs

…ing to multiple samples (after batch correction) and it would be helpful to have a utility function to read multiple FCS files, generage a sample ID column, and merge - implemented in accordance with the pytometry examples
* FlowSOM clustering moved to tools
* FlowSOM tutorial added to docs
* Some minor refactors to FlowSOM to allow modification of consensus clustering params
* Some minor refactors to plotting
@burtonrj burtonrj requested a review from mbuttner October 14, 2023 18:14
@burtonrj burtonrj linked an issue Oct 14, 2023 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@mbuttner mbuttner left a comment

Choose a reason for hiding this comment

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

Looks pretty good overall! I commented on a few occasions that need to be changed. Also, consider to run pre-commit to get past the code checks. Thanks!

Comment thread pytometry/tools/clustering/_flowsom.py Outdated
Comment thread pytometry/tools/clustering/_flowsom.py Outdated
Comment thread pytometry/read_write/_readfcs.py Outdated
Comment thread docs/tutorials/flowsom.ipynb Outdated
@burtonrj
Copy link
Copy Markdown
Collaborator Author

An issue I've noticed with the pre-commit config. Flake8 fails because I've used TypedDict in _flowsom.py and TypedDict is not supported pre python 3.8, however according to the pyproject.toml file pytometry only supports Python 3.9 or greater anyway.

I've updated the pre-commit yaml to ignore TYP001, let me know if this is okay.

@mbuttner
Copy link
Copy Markdown
Collaborator

An issue I've noticed with the pre-commit config. Flake8 fails because I've used TypedDict in _flowsom.py and TypedDict is not supported pre python 3.8, however according to the pyproject.toml file pytometry only supports Python 3.9 or greater anyway.

I've updated the pre-commit yaml to ignore TYP001, let me know if this is okay.

Sounds good to me.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Oct 31, 2023

@github-actions github-actions Bot temporarily deployed to pull request October 31, 2023 19:18 Inactive
@burtonrj burtonrj requested a review from mbuttner October 31, 2023 19:53
Copy link
Copy Markdown
Collaborator

@mbuttner mbuttner left a comment

Choose a reason for hiding this comment

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

Looks all good to me!

Copy link
Copy Markdown
Collaborator

@mbuttner mbuttner left a comment

Choose a reason for hiding this comment

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

One minor thing - please execute the 03_flowsom notebook to display the plots (see netlify page).

Comment thread docs/examples/03_flowsom.ipynb
@github-actions github-actions Bot temporarily deployed to pull request November 7, 2023 09:06 Inactive
Copy link
Copy Markdown
Collaborator

@mbuttner mbuttner left a comment

Choose a reason for hiding this comment

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

All very good.

@mbuttner mbuttner merged commit a1e59b2 into main Nov 7, 2023
@mbuttner mbuttner deleted the clustering-algorithms branch November 7, 2023 16:47
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.

Implement FlowSOM type of clustering

2 participants