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

Spatial-LDA viz and preprocessing notebook #468

Merged
merged 45 commits into from
Sep 29, 2021
Merged

Conversation

bcollica
Copy link
Contributor

What is the purpose of this PR?

This PR creates the notebook and associated functions/visualizations for preprocessing data for spatial-LDA.

How did you implement your changes

The LDA_Preprocessing notebook is similar to the other example notebooks in the sense that it walks the user through the steps of loading, formatting, and visualizing cell data for use in spatial-LDA analysis. processing.py is the main module with the formatting and processing functions. Some visualization functions were added to analysis/visualize.py, and a few random helper functions were added to utils/spatial_lda_utils.py.

The notebook uses an example dataset with two FOVs to show how the functions work. This dataset is included in example_dataset/spatial_lda_input_data. There are also directories with examples of the different visualizations as well as the processed output data which will get passed to the training/inference functions in the next step.

Remaining issues

A few points here:

  1. The example dataset is kinda wonky because the centroids are pulled from a different cell table, and having only two FOVs doesn't really produce anything super interesting anyway. This will be resolved when an official example dataset has been decided on.
  2. The bootstrapping in topic_eda() can be a bit slow, especially for larger sets of FOVs and also larger topic numbers. One thought is to add support for parallel processing either across topics or across bootstrap iterations.
  3. All visualizations use default parameters for color and style, but this can be adjusted depending on preferences.
  4. There is currently a function for writing/saving the different data components, but not a function for reading/loading them which will be useful in the training/inference notebook but also for other potential exploratory analysis.
  5. The notebook contains a “table of contents” with internal links to the different sections, but these might not actually function properly depending on how the user is viewing the notebook (i.e. in a browser, in an IDE, etc.).

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Member

@ngreenwald ngreenwald left a comment

Choose a reason for hiding this comment

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

Looking good. You added a ton of files in this PR. I think it makes sense to have the input data, but I don't think we need to check in the outputs, especially the plots that are generated.

ark/analysis/visualize.py Show resolved Hide resolved
ark/analysis/visualize.py Show resolved Hide resolved
ark/utils/spatial_lda_utils.py Outdated Show resolved Hide resolved
ark/utils/spatial_lda_utils.py Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
templates/LDA_Preprocessing.ipynb Show resolved Hide resolved
Copy link
Contributor

@alex-l-kong alex-l-kong left a comment

Choose a reason for hiding this comment

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

Just a few minor things to add.

ark/analysis/visualize.py Show resolved Hide resolved
requirements.txt Outdated Show resolved Hide resolved
setup.py Outdated Show resolved Hide resolved
Copy link
Member

@ngreenwald ngreenwald left a comment

Choose a reason for hiding this comment

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

Looks good!

@bcollica bcollica merged commit 97acdad into spatial_LDA Sep 29, 2021
@bcollica bcollica deleted the spatial_LDA_viz branch September 29, 2021 21:46
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.

3 participants