Skip to content

This repo contains code for EMT deliverable data analysis and has dependencies associated with output from EMT_image_analysis repo.

License

Notifications You must be signed in to change notification settings

AllenCell/EMT_data_analysis

Repository files navigation

EMT data analysis

This repository contains code for reproducing the plots shown in our manuscript [1]. This repository uses outputs generated by the EMT_image_analysis repository, such as image segmentations and 3D meshes.

[1] - A human induced pluripotent stem (hiPS) cell model for the holistic study of epithelial to mesenchymal transitions (EMTs)

Note

This code has been tested on Ubuntu 18.04.2 LTS and Windows 10 using Python 3.11.

Installation

  1. Install python 3.11 and pip>=24.0.0.
  2. Install the dependencies for lxml. On Ubuntu or Debian:
sudo apt-get install libxml2-dev libxslt-dev python-dev
  1. Create a new virtual environment.
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt

(Alternatively, if you have pdm, you can run pdm sync.)

How to run:

1 - Feature extraction

Run: python EMT_data_analysis/analysis_scripts/Feature_extraction.py

This will generate one CSV for each movie with the extracted features. CSVs are stored in the folder EMT_data_analysis/results/feature_extraction

2 - Metric computation

Run: python EMT_data_analysis/analysis_scripts/Metric_computation.py

This will generate a single CSV containing information about all the movies to be used for analysis. The manifest is saved as EMT_data_analysis/results/metric_computation/Image_analysis_extracted_features.csv.

3 - Nuclei localization

Run: python EMT_data_analysis/analysis_scripts/Nuclei_localization.py

This will generate CSV for individual nuclei classified as inside the basement memebrane or not over the course of the timelapse for EOMES and H2B movies. The manifest is saved as EMT_data_analysis/results/nuclei_localization/Migration_timing_trough_mesh_extracted_feature.csv.

4 - Analysis Plots

Run: python EMT_data_analysis/analysis_scripts/Analysis_tools.py

This will generate the plots in the manuscript and store them in results/figures folder. The manifests used as inputs in this workflow are automatically downloaded from AWS by default.

5 - [Optional] 3D Example Rendering

The functions in EMT_data_analysis/figure_generation can be used to generate 3D renderings shown in the paper. Functions have only been tested on Ubuntu 18.04/22.04

On Ubuntu or Debian:

sudo apt-get install xvfb libgl1-mesa-glx

On Windows: Comment out any instance of pv.start_xvfb() in the code before running.

All Cells Mask

Run

python EMT_data_analysis/figure_generation/colony_mask.py --data_id [Optional] --output_directory [Optional]

If no input arguments are provided, the code will default to the data shown in the paper and output results to EMT_data_analysis/results/3D_all_cells_mask. Data ID values are only valid inputs if they have a none-empty value for All Cells Mask File Download in the image_and_segmentation_data.csv manifest on AWS

Inside-Outside Classification

Run

python EMT_data_analysis/figure_generation/inside-outside_classification.py --data_id [Optional] --output_directory [Optional]

If no input arguments are provided, the code will default to the data shown in the paper and output results to EMT_data_analysis/results/Inside-Outside/mesh-figures. Data ID values are only valid inputs if they have a none-empty value for CollagenIV Segmentation Mesh Folder in the image_and_segmentation_data.csv manifest on AWS

Contact

If you have questions about this code, please reach out to us at [email protected].

Licensing

All code in this repository is provided to you under the Allen Institute Software License.

About

This repo contains code for EMT deliverable data analysis and has dependencies associated with output from EMT_image_analysis repo.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 6