Skip to content

theislab/campa_ana

Repository files navigation

Analysis of 4i data using CAMPA

This repository contains scripts to recreate the models, results, and figures described in our preprint "Learning consistent subcellular landmarks to quantify changes in multiplexed protein maps" (Spitzer, Berry et al. (2022). For the main documentation and tutorials, see the official CAMPA documentation.

Setup

  • install and setup campa
  • install campa_ana:
    git clone https://github.com/theislab/campa_ana
    cd campa_ana
    pip install .
    
  • update campa.ini and download data by executing 00_setup_and_download_data.ipynb

Data

CSL-derived features from the 184A1 and the HeLa datasets are available here. Data and pre-trained models will be available upon acceptance of our manuscript here: - Data: https://doi.org/10.5281/zenodo.7299516 - Pre-trained models: https://doi.org/10.5281/zenodo.7299750

See 00_setup_and_download_data for more information on the provided data.

Structure of this repository

  • campa_ana: useful python functions
  • figure_notebooks: ipython notebooks generating figures
  • figures: empty folder in which figures will be placed
  • jterator: param files needed for tissuemaps
  • params: param files needed for campa
  • R: useful R functions and R notebooks generating figures
  • scripts: executable scripts for running campa on HPC
  • workflow: notebooks explaining how to reproduce datasets, models, and clustering

Reproducing results

Notebooks in workflow reproduce our results.

  • 00_setup_and_download_data: start here for setup and downloading provided data
  • 01_prepare_data: download data from TissueMaps and preprocess metadata files
  • 02_create_dataset: create datasets for training and validation of cVAE models
  • 03_train: train cVAE models
  • 04_cluster: cluster latent representation into CSLs and annotate (manually).
  • 05_extract_features_all and 05_extract_features_SBF2: extract intensity and spatial features from cells using CSLs

For more information on how to use CAMPA and different configuration options for each step, also have a look at the CAMPA documentation.

Reproducing figures

Notebooks in figure_notebooks and R reproduce figure panels for the CAMPA paper.

  • Figure 1

    • d: R/whole_nucleus_fold_change.R
    • f,g,h,i: figure_notebooks/fig1_umap_linear_classifier.ipynb
  • Figure 2

    • a: figure_notebooks/fig1_umap_linear_classifier.ipynb
    • b,d-i: R/plot_example_184A1_control_cells.R
    • c: R/cluster_loadings_184A1.R
  • Figure 3

    • a: R/fit_mixed_models.R and R/make_bubble_plots.R
    • b-e: R/plot_example_184A1_meayamycin_cell.R
    • g,h: R/plot_co_occurrence_184A1.R
  • Figure 4

    • a-f: figure_notebooks/fig4_perturbation_comparison.ipynb
    • g,h: R/plot_co_occurrence_184A1.R
    • i: figure_notebooks/fig4_object_features_CX4561.ipynb
    • j: R/plot_example_184A1_cx5461_cell.R
  • Figure 5

    • a,c: R/plot_example_SBF2_cells.R
    • b: R/cluster_loadings_SBF2.R
    • d: R/fit_mixed_models_SBF2.R and R/make_bubble_plots_SBF2.R
    • e-h: R/plot_object_stats_SBF2.R
  • Figure 6

    • b-c: R/plot_trends_and_examples_EU_heterogeneity.R
  • Extended Data Figures:

    • Figure 1: N/A
    • Figure 2 (perturbation dependent pixel clustering)
      • figure_notebooks/fig1_umap_linear_classifier.ipynb
    • Figure 3 (cell-cycle dependent pixel clustering)
      • a: R/fit_mixed_models_cell_cycle.R and R/make_bubble_plots_cell_cycle.R
      • b-c: R/plot_example_184A1_control_cells.R
      • d-i: figure_notebooks/fig1_suppl_umap_cluster_size_cell_cycle.ipynb
    • Figure 4 (details of cVAE clustering)
      • a: R/cluster_loadings_184A1.R
      • b: figure_notebooks/fig2_fig5_suppl_annotation_HPA.ipynb
      • c: figure_notebooks/fig1_distribution_of_clusters_in_perturbation.ipynb
      • d-e: figure_notebooks/fig1_suppl_saliency_to_latent.ipynb
    • Figure 5 (ilastik comparison)
      • R/compare_CSL_with_ilastik.R
    • Figure 6 (comparison with direct clustering)
      • a,b: R/cluster_loadings_direct_184A1.R
      • c: R/plot_example_184A1_TSA_cell_direct.R
      • d: R/plot_example_184A1_TSA_cell.R
      • e: R/fit_mixed_models.R and R/make_bubble_plots.R
    • Figure 7 (co-occurrence 184A1)
      • R/plot_co_occurrence_184A1.R
    • Figure 8 (cluster loadings SBF2)
      • a: R/cluster_loadings_SBF2.R
      • b: R/plot_example_SBF2_cells_raw_csl.R
      • c: figure_notebooks/fig2_fig5_suppl_annotation_HPA.ipynb
      • d-e: figure_notebooks/fig5_suppl_184A1-model-on-HeLa-data.ipynb
    • Figure 9 (supplements to Figure 6)
      • a-c: R/fit_mixed_model_EU_bin.R and R/make_bubble_plots_EU_bin.R
      • d: figure_notebooks/fig6_pml_umap.ipynb
  • Supplements:

    • Figure 1 (noise robustness)
      • a,d: figure_notebooks/fig1_suppl_noise_robustness.ipynb
      • b,c: figure_notebooks/fig1_suppl_cluster_subsampling.ipynb
    • Figure 2 (bubble-plots)
      • R/fit_mixed_models.R and R/make_bubble_plots.R
      • R/fit_mixed_models_DMSO.R and R/make_bubble_plots_DMSO.R
    • Figure 3 (co-occurrence 184A1)
      • R/plot_co_occurrence_184A1.R
    • Figure 4 (UMAP outliers)
      • figure_notebooks/fig4_suppl_UMAP_outliers.ipynb
    • Figure 5 (intensity changes in HeLa cells)
      • R/fit_mixed_models_SBF2.R and R/make_bubble_plots_SBF2.R
      • R/fit_mixed_models_SBF2_raw_csl.R and R/make_bubble_plots_SBF2_raw_csl.R
      • R/plot_object_stats_SBF2.R
    • Figure 6 (object filtering: scatter plots)
      • figure_notebooks/fig5_object_features_SBF2.ipynb
    • Figure 7 (object filtering: example cells)
      • figure_notebooks/fig5_object_features_SBF2.ipynb

About

Analysis of 4i data from CAMPA manuscript

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages