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.
- 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
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.
campa_ana
: useful python functionsfigure_notebooks
: ipython notebooks generating figuresfigures
: empty folder in which figures will be placedjterator
: param files needed for tissuemapsparams
: param files needed for campaR
: useful R functions and R notebooks generating figuresscripts
: executable scripts for running campa on HPCworkflow
: notebooks explaining how to reproduce datasets, models, and clustering
Notebooks in workflow
reproduce our results.
00_setup_and_download_data
: start here for setup and downloading provided data01_prepare_data
: download data from TissueMaps and preprocess metadata files02_create_dataset
: create datasets for training and validation of cVAE models03_train
: train cVAE models04_cluster
: cluster latent representation into CSLs and annotate (manually).05_extract_features_all
and05_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.
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
- d:
-
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
- a:
-
Figure 3
- a:
R/fit_mixed_models.R
andR/make_bubble_plots.R
- b-e:
R/plot_example_184A1_meayamycin_cell.R
- g,h:
R/plot_co_occurrence_184A1.R
- a:
-
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
- a-f:
-
Figure 5
- a,c:
R/plot_example_SBF2_cells.R
- b:
R/cluster_loadings_SBF2.R
- d:
R/fit_mixed_models_SBF2.R
andR/make_bubble_plots_SBF2.R
- e-h:
R/plot_object_stats_SBF2.R
- a,c:
-
Figure 6
- b-c:
R/plot_trends_and_examples_EU_heterogeneity.R
- b-c:
-
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
andR/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
- a:
- 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
- a:
- 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
andR/make_bubble_plots.R
- a,b:
- 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
- a:
- Figure 9 (supplements to Figure 6)
- a-c:
R/fit_mixed_model_EU_bin.R
andR/make_bubble_plots_EU_bin.R
- d:
figure_notebooks/fig6_pml_umap.ipynb
- a-c:
-
Supplements:
- Figure 1 (noise robustness)
- a,d:
figure_notebooks/fig1_suppl_noise_robustness.ipynb
- b,c:
figure_notebooks/fig1_suppl_cluster_subsampling.ipynb
- a,d:
- Figure 2 (bubble-plots)
R/fit_mixed_models.R
andR/make_bubble_plots.R
R/fit_mixed_models_DMSO.R
andR/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
andR/make_bubble_plots_SBF2.R
R/fit_mixed_models_SBF2_raw_csl.R
andR/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
- Figure 1 (noise robustness)