A plugin to perform cell marker gating for multiplexed immunofluorescent imaging
Step 1. Install napari (see https://napari.org/stable/tutorials/fundamentals/installation)
Step 2.
Install napari-cell-gater
via pip:
pip install git+https://github.com/melonora/napari-cell-gater.git
-
Users will select the necesary directories: images, masks, and quantification directories.
Assumptions for inputs:
1.1 Files inside these directories are named according to the samples names.
1.2 The image for sample 1, should be "1.ome.tif" or "1.tif"; the mask file "1.tif"; and the quantification file "1.csv".
1.3 Each set of files should all be inside each of the three folders.
1.4 Any extra files in those folders can make code fail. -
Select the lowerbound and upperbound channels to gate. These are all the columns from the quantification csv file that you want to threshold. You must pick the same channels if you plan to save and reload the gates.
-
Select a sample, and a marker from dropdown menus. 3 layers will load:
(a.) the reference channel (default: first channel, changeable by dropdown menu)
(b.) the segmentation mask (for large images this might be a problem)
(c.) the channel_to_be_gated
A scatter plot (default: x-axis=channel_to_be_gated intensity, y-axis=Area) (y-axis can be changed by dropdown)
Underneath the scatterplot a slider will appear, the position of the slider will show up as a vertical line in the scatter plot. The scatter plot can also be changed to a hexbin plot, which really helps with dense clusters of cells. Plotting the data in log10 space is also possible by dropdown. Most of the times it helps. Gates would still be saved in linear space. -
Adjust the contrast with the Napari layer menu (top left)
-
Drag the slider to what they think is correct
-
Click "Plot Points" to plot points on top of positive cells.
-
Repeat steps 5 and 6 until satisfied.
-
Click "Save Gate" to save the gate for the current marker and sample. Go to step 4 and repeat.
Contributions are very welcome. Tests can be run with tox, please ensure the coverage at least stays the same before you submit a pull request.
Distributed under the terms of the BSD-3 license, "napari-cell-gater" is free and open source software
If you encounter any problems, please [file an issue] along with a detailed description.