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. Install poetry, system-wide with pip install poetry

Check that you're at the correct location (a simple and recommended location is cd ~, i.e., your home folder).

  1. Download cenfind with:
git clone git@github.com:UPGON/cenfind.git
git clone git@github.com:maweigert/spotipy.git
  1. As of now, you need to install the spotipy package from the git repository https://github.com/maweigert/spotipy: !!! You need to have access to this private repo; contact Leo for setting up the permission.
cd cenfind
  1. Activate the virtual environment using poetry
poetry shell

Your prompt should now be prepended with (cenfind-py3.9).

Note: if your python version is not supported, install the one recommended with pyenv, the set it up and run poetry env use $(which python). Then, repeat the step.

  1. Add the programs squash and score to the PATH with the following commands, so that they can be run from the command line, without the need to type the whole path.
poetry install
  1. Add manually the package spotipy
pip install -e ../spotipy/
  1. Check that cenfind's programs are correctly installed by running:
squash --help
  1. In case of updates, get the last version:
git pull
poetry install

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 setup to initialise the folder with a list of fields and output folders:
prepare /path/to/dataset <list channels of centrioles, like 1 2 3, (0 should be 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/ds .ome.tif
  1. Run score with the arguments source and the index of the nuclei channel (usually 0 or 3).
score /path/to/dataset ./model/master/ 0 1 2 3 --projection_suffix '_max'
  1. Check that the predictions are satisfactory by looking at the folder outlines and at the results/scores.csv.

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.6.tar.gz (63.6 MB view details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: cenfind-0.9.6.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.6.tar.gz
Algorithm Hash digest
SHA256 90b5e7eb9d3d520529d4f5b5395389001bf1cef6b7bfb52a4bb8a5237675c9b7
MD5 94cc6d037b0823eba089c63c900572fe
BLAKE2b-256 5f15c2368b43044f4d62ed05b6a5bca6584e58515312b0332859a362146948aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: cenfind-0.9.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 6a48f43e7d9d9b3b4557e3de78c10a431c2365866ae5188ee57bc26f5d9787b8
MD5 09a8978101002862ab87214668e8e53b
BLAKE2b-256 0781798295b68d2264950d8e5f519b325bc614d343a207fe404536ba5b32d204

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