CellPhe: Toolkit for cell phenotyping from time-lapse videos
Project description
CellPhe
CellPhe provides functions to phenotype cells from time-lapse videos and accompanies the paper:
Wiggins, L., Lord, A., Murphy, K.L. et al.
The CellPhe toolkit for cell phenotyping using time-lapse imaging and pattern recognition.
Nat Commun 14, 1854 (2023).
https://doi.org/10.1038/s41467-023-37447-3
The Python package is a port of the original R implementation.
Installation
You can install the latest version of CellPhe from PyPi with:
pip install cellphe
Example
An example dataset to demonstrate CellPhe’s capabilities is hosted on Dryad in the archive example_data.zip
and comprises 3 parts:
- The time-lapse stills as TIFF images (
05062019_B3_3_imagedata
) - Existing pre-extracted features
(
05062019_B3_3_Phase-FullFeatureTable.csv
) - Region-of-interest (ROI) boundaries already demarked in ImageJ
format (
05062019_B3_3_Phase
)
These should be extracted into a suitable location before proceeding with the rest of the tutorial.
from cellphe import copy_features, extract_features, time_series_features
The first step is to prepare a dataframe containing metadata and any
pre-existing attributes. If PhaseFocus Livecyte or Trackmate software
has been used to generate the region-of-interest (ROI) files, then a
helper function is available to create the required metadata format:
copy_features
. The dataframe format comprises each row corresponding to
a cell tracked in a given frame, indexed by columns FrameID
and
CellID
which contain numerical identifiers (NB: FrameID
must be in
ascending chronological order). The only other required field is
ROI_filename
, which specifies the filename of the ROI file
corresponding to the frame-cell combination. Any features can be
provided in additional columns, copyFeatures
returns volume and
sphericity from PhaseFocus software.
The example below creates the metadata dataframe from a PhaseFocus experimental setup, only including cells that were tracked for at least 50 frames.
min_frames = 50
input_feature_table = "05062019_B3_3_Phase-FullFeatureTable.csv"
feature_table = copy_features(input_feature_table, min_frames, source="Phase")
In addition to any pre-calculated features, the extract_features()
function generates 74 descriptive features for each cell on every frame
using the frame images and pre-generated cell boundaries, based on size,
shape, texture, and the local cell density. The output is a dataframe
comprising the FrameID
, CellID
, and ROI_filename
identifying
columns, the 74 features as columns, and any additional features that
may be present (such as from copy_features()
) in further columns. The
program expects frames to be named according to the scheme
<experiment name>-<frameid>.tif
, where <frameid>
is a 4 digit
zero-padded integer corresponding to the FrameID
column, and located
in the frame_folder
directory, while ROI files are named according to
the ROI_filename
column and located in the roi_folder
directory.
roi_folder = "05062019_B3_3_Phase"
image_folder = "05062019_B3_3_imagedata"
new_features = extract_features(feature_table, roi_folder, image_folder, framerate=0.0028)
Variables are calculated from the time series for any pre-existing
features as well as the output of extract_features()
, providing both
summary statistics and indicators of time-series behaviour at different
levels of detail obtained via wavelet analysis. 15 summary scores are
calculated for each feature, in addition to the cell trajectory, thereby
resulting in a default output of 1081 features (15x72 + 1). These are
output in the form of a dataframe with the first column being the
CellID
used previously.
tsvariables = time_series_features(new_features)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file cellphe-0.0.3.tar.gz
.
File metadata
- Download URL: cellphe-0.0.3.tar.gz
- Upload date:
- Size: 95.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d2fd34eee79b0c4868f72bff90690dedb8b9a73e92de1a295776f5398a06fc9 |
|
MD5 | 52eb9e35edb6a3a98d1cbc35accc81da |
|
BLAKE2b-256 | df197ac0db4393c9a96b076e57740234823be79595ff6b3de3959d0ffc1cef9b |
File details
Details for the file cellphe-0.0.3-py3-none-any.whl
.
File metadata
- Download URL: cellphe-0.0.3-py3-none-any.whl
- Upload date:
- Size: 28.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: python-requests/2.32.3
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ff5272e17b6098f46b1f94c4e0231e8d3fb1b6fa72c9075f7b430849a59b13c2 |
|
MD5 | 9599b9716435c09b4d2df713e620e471 |
|
BLAKE2b-256 | d2cb5418ff0ea5499e2ff70a0eb319b3b4c6202cffb5a70a178a182aab00c8bd |