Skip to main content

Score cells for centrioles in IF data

Project description

CenFind

A command line interface to score cells for centrioles.

Introduction

cenfind is a command line interface to detect and assign centrioles in immunofluorescence images of human cells. Specifically, it orchestrates:

  • the z-max projection of the raw files;
  • the detection of centrioles;
  • the detection of the nuclei;
  • the assignment of the centrioles to the nearest nucleus.

Installation

  1. Install python via pyenv
  2. Download and set up 3.9.5 as local version
  3. Set up Python interpreter
pyenv local 3.9.5
pyenv global 3.9.5
  1. Create a virtual environment for CenFind
python -m venv venv-cenfind
source venv-cenfind/bin/activate
  1. Check that cenfind's programs are correctly installed by running:
squash --help

Basic usage

Before scoring the cells, you need to prepare the dataset folder. cenfind assumes a fixed folder structure. In the following we will assume that the .ome.tif files are all immediately in raw/. Each field of view is a z-stack containing 4 channels (0, 1, 2, 3). The channel 0 contains the nuclei and the channels 1-3 contains centriolar markers.

<project_name>/
└── raw/
  1. Run prepare to initialise the folder with a list of fields and output folders:
prepare /path/to/dataset <list channels of centrioles, like 1 2 3, (if 0 is the nucleus channel)>
  1. Run squash with the argument of the path to the project folder and the suffix of the raw files. projections/ is populated with the max-projections *_max.tif files.
squash path/to/dataset
  1. Run score with the arguments source, the index of the nuclei channel (usually 0 or 3), the channel to score and the path to the model. You need to download it from https://figshare.com/articles/software/Cenfind_model_weights/21724421
score /path/to/dataset 0 1 2 3 /path/to/model/ --projection_suffix '_max'

For reference:

score -h
CENFIND: Automatic centriole scoring

positional arguments:
  path                  Path to the dataset
  model                 Absolute path to the model folder
  channel_nuclei        Channel index for nuclei segmentation, e.g., 0 or 3
  channels              Channel indices to analyse, e.g., 1 2 3

optional arguments:
  -h, --help            show this help message and exit
  --vicinity VICINITY   Distance threshold in micrometer (default: -5 um)
  --factor FACTOR       Factor to use: given a 2048x2048 image, 256 if 63x; 2048 if 20x:
  --projection_suffix PROJECTION_SUFFIX
                        Projection suffix (`_max` (default) or `_Projected`
  1. Check that the predictions are satisfactory by looking at the folders visualisation/ and statistics/

API

cenfind consists of two core classes: Dataset and Field.

A Dataset represents a collection of related fields, i.e., same pixel size, same channels, same cell type.

It should:

  • return the name
  • iterate over the fields,
  • construct the file name for the projections and the z-stacks
  • read the fields.txt
  • write the fields.txt file
  • set up the folders projections, predictions, visualisations and statistics
  • set and get the splits

A Field represents a field of view and should:

  • construct file names for projections, annotation
  • get Dataset
  • load the projection as np.ndarray
  • load the channel as np.ndarray
  • load annotation as np.ndarray
  • load mask as np.ndarray

Using those two objects, cenfind should

  • detect centrioles (data, model) => points,
  • extract nuclei (data, model) => contours,
  • assign centrioles to nuclei (contours, points) => pairs
  • outline centrioles and nuclei (data, points) => image
  • create composite vignettes (data) => composite_image
  • flag partial nuclei (contours, tolerance) => contours
  • compare predictions with annotation (points, points) => metrics_namespace

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

cenfind-0.9.8.tar.gz (63.6 MB view details)

Uploaded Source

Built Distribution

cenfind-0.9.8-py3-none-any.whl (63.6 MB view details)

Uploaded Python 3

File details

Details for the file cenfind-0.9.8.tar.gz.

File metadata

  • Download URL: cenfind-0.9.8.tar.gz
  • Upload date:
  • Size: 63.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.5 Linux/4.15.0-159-generic

File hashes

Hashes for cenfind-0.9.8.tar.gz
Algorithm Hash digest
SHA256 03fad9fc2e76463cf19f1ab0c81ecdd180f806f3ed731fdfa95f43760b8af949
MD5 e6b1ee93eb86f12da98ed31e37fffcd3
BLAKE2b-256 c8804ae6cb4768e5164173fb59eb9d77d987b8f545d511951f3086bbae702f59

See more details on using hashes here.

File details

Details for the file cenfind-0.9.8-py3-none-any.whl.

File metadata

  • Download URL: cenfind-0.9.8-py3-none-any.whl
  • Upload date:
  • Size: 63.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.2.2 CPython/3.9.5 Linux/4.15.0-159-generic

File hashes

Hashes for cenfind-0.9.8-py3-none-any.whl
Algorithm Hash digest
SHA256 b65e09c66ab3c9bcff8850495d09605b0c0676917a39729257707387386efc4a
MD5 cf950ab12d9fb3974d70a80e277bebd8
BLAKE2b-256 b06aaa50733a1810996e63653bf1dc0b33063c0259d9fdde1c60396e02dde190

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page