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

Remove Spatial Enrichment + Bootstrapping Cython #1161

Closed
Tracked by #1160
srivarra opened this issue Oct 4, 2024 · 0 comments · Fixed by #1163
Closed
Tracked by #1160

Remove Spatial Enrichment + Bootstrapping Cython #1161

srivarra opened this issue Oct 4, 2024 · 0 comments · Fixed by #1163
Assignees
Labels
design_doc Detailed implementation plan

Comments

@srivarra
Copy link
Contributor

srivarra commented Oct 4, 2024

This is for internal use only; if you'd like to open an issue or request a new feature, please open a bug or enhancement issue

Spatial enrichment has been issue prone and difficult to use. For now it would be ideal to remove it.

We can remove _bootstrapping.pyx. And the functions used by it downstream.

Here is a visual representation:

---
title: Bootstrapping
---
flowchart TB

    subgraph src/ark [src/ark]
        subgraph _bootstrapping.pyx [_bootstrapping.pyx]
        compute_close_num_rand
        end

        subgraph spatial_analysis_utils.py [spatial_analysis_utils.py]
        compute_close_cell_num_random
        end

        subgraph spatial_enrichment.py [spatial_enrichment.py]
        calculate_channel_spatial_enrichment --> generate_channel_spatial_enrichment_stats
        calculate_cluster_spatial_enrichment --> generate_cluster_spatial_enrichment_stats
        end
    end


    subgraph Tests [Tests]

        subgraph spatial_enrichment_test.py [spatial_enrichment_test.py]
        test_calculate_channel_spatial_enrichment
        test_calculate_cluster_spatial_enrichment
        test_generate_channel_spatial_enrichment_stats
        test_generate_cluster_spatial_enrichment_stats
        end

        subgraph spatial_analysis_utils_test.py [spatial_analysis_utils_test.py]
        test_compute_close_cell_num_random
        end

    end

    %% code dependency links
    _bootstrapping.pyx --> spatial_analysis_utils.py
    spatial_analysis_utils.py --> spatial_enrichment.py

    %% test dependency links
    compute_close_cell_num_random --> test_compute_close_cell_num_random
    calculate_channel_spatial_enrichment --> test_calculate_channel_spatial_enrichment
    calculate_cluster_spatial_enrichment --> test_calculate_cluster_spatial_enrichment
    generate_channel_spatial_enrichment_stats --> test_generate_channel_spatial_enrichment_stats
    generate_cluster_spatial_enrichment_stats --> test_generate_cluster_spatial_enrichment_stats


    %% hrefs
    click compute_close_num_rand href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/src/ark/utils/_bootstrapping.pyx#L248"
    click compute_close_cell_num_random href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/src/ark/analysis/spatial_analysis_utils.py#L287"
    click calculate_channel_spatial_enrichment href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/src/ark/analysis/spatial_enrichment.py#L102"
    click calculate_cluster_spatial_enrichment href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/src/ark/analysis/spatial_enrichment.py#L325"
    click generate_channel_spatial_enrichment_stats href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/src/ark/analysis/spatial_enrichment.py#L13"
    click generate_cluster_spatial_enrichment_stats href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/src/ark/analysis/spatial_enrichment.py#L243"
    
    click test_compute_close_cell_num_random href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/tests/analysis/spatial_analysis_utils_test.py#L201"
    click test_calculate_channel_spatial_enrichment href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/tests/analysis/spatial_enrichment_test.py#L111"
    click test_calculate_cluster_spatial_enrichment href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/tests/analysis/spatial_enrichment_test.py#L247"
    click test_generate_channel_spatial_enrichment_stats href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/tests/analysis/spatial_enrichment_test.py#L37"
    click test_generate_cluster_spatial_enrichment_stats href "https://github.com/angelolab/ark-analysis/blob/301e344f0ffbedafaad282c52c801e7713272f85/tests/analysis/spatial_enrichment_test.py#L76"
Loading

In addition this will allow the following:

  • Removal of the setup.py file
  • Simplified build system on CI
    • only need one OS for building
    • No need for cibuildwheel
  • Simplified user experience (no need for Visual Studio toolchains on Windows)
@srivarra srivarra added the design_doc Detailed implementation plan label Oct 4, 2024
@srivarra srivarra added this to the v0.8.0 Release milestone Oct 4, 2024
@srivarra srivarra self-assigned this Oct 4, 2024
@srivarra srivarra linked a pull request Oct 5, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design_doc Detailed implementation plan
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant