Skip to content
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

Allow for a subset of FOVs in k-means clustering notebook #1122

Open
cliu72 opened this issue Mar 7, 2024 · 1 comment
Open

Allow for a subset of FOVs in k-means clustering notebook #1122

cliu72 opened this issue Mar 7, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@cliu72
Copy link
Contributor

cliu72 commented Mar 7, 2024

Describe the bug
There is no option to choose a subset of FOVs in the k-means neighborhood notebook. Discovered by Avery.

Currently, the notebook gets all FOVs in the cell table (all_fovs = all_data[settings.FOV_ID].unique() in the notebook), then uses all FOVs in the segmentation directory to calculate the distance matrix (https://github.com/angelolab/ark-analysis/blob/main/src/ark/analysis/spatial_analysis_utils.py#L37). If you manually change all_fovs in the notebook to try to run k-means only on a subset of FOVs, it errors out.

Expected behavior
Allow users to choose a subset of FOVs to run k-means on.

To Reproduce
Change all_fovs in the kmeans notebook to be a subset of FOVs.

@cliu72 cliu72 added the bug Something isn't working label Mar 7, 2024
@camisowers
Copy link
Contributor

camisowers commented Mar 7, 2024

If we do this, a neighbors matrix will be generated and saved based on the provided subset of cells, which could potentially cause issues in other spatial scripts. It likely makes more sense to generate the distance matrices and neighbors matrix for the full data, and then just subset the neighbors data to input to k-means!

@camisowers camisowers self-assigned this Mar 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants