This repository contains code for Bayesian parameter inference for Ca2+ pathway model using No-U-Turn Sampler (NUTS) and post-sampling analyses.
The project requires Python 3.6 or newer. The following packages are also required:
- PyStan 2.19
- NumPy
- SciPy
- statsmodels
- pandas
- scikit-learn
- ArviZ
- Matplotlib 3.4 or newer
- seaborn
- Jupyter notebook
stan_calcium_mdoel_analysis.ipynb
: post-sampling analysis for a single cell.cell_chain_analysis.ipynb
: analysis for a cell chain.
stan_helpers.py
: classes for sampling parameters for single cells and analyzing sampled cells, as well as helper functions.calcium_models.py
: ordinary differential equations (ODEs) of each Ca2+ model variant, which are used when simulating Ca2+ trajectories during post-sampling analysis, as well as parameter names in the models.
All Python scripts for generating data and results presented in our manuscript in preparation are in the root folder.
If a script has a main()
function, it is to be executed in command line. See
help using python [script_name].py -h
.
If a script has no main()
function, it is divided into code cells by # %%
.
In Visual Studio Code or PyCharm (or any editor/IDE that supports this
feature), each code cell can be executed separately.
stan_models
: folder for Stan model specifications. Each subfolder contains a model. Some models have associated prior specifications. If a model is compiled bycompile_stan_model.py
, the compiled model will also be saved in the same subfolder.canorm_trajectories.csv
: Ca2+ response trajectoriesvol_adjusted_genes.csv
: MERFISH data (comma delimited)vol_adjusted_genes_transpose.txt
: MERFISH data (tab delimited, transposed)cell_lists
: folder for cell lists generated according to different criteria.cell_chain_example
: folder used by code demos. Thesamples
subfolder stores posterior distribution and related NUTS information of 100 cells. Thecell_chain_analysis.ipynb
notebook will also create a subfolder calledmulti-sample-analysis
for its results.stan_run_meta.json
: metadata of sampled cell chains.stan_run_comparison_meta.json
: metadata for comparing sampled cell chains.soptsc.mat
: saved variables from SoptSC, which includes a cell-cell similarity matrix.
deprecated
: archive folder for outdated scripts.