A command-line interface to measure chemotaxis index (CI) from chemotaxis assay images

-
Install anaconda if its not already installed.
-
Create a new conda environment with python 2.7.12 and activate it. The env name used below
chemotaxis_py2.7.12is optional, name it as you like.# create a new conda environemnt conda create --name chemotaxis_py2.7.12 python=2.7.12 # activate it conda activate chemotaxis_py2.7.12
-
Clone the chemotaxis-cli repo to the directory of your choice.
# navigate to the directory you want to clone the repo to cd <path_to_your_dir> # clone the chemotaxis-cli repository there git clone https://github.com/AndersenLab/chemotaxis-cli.git
-
Install the requirements and
ctinto your environment.# navigate into the repository directory cd <path_to_your_chemotaxis-cli_directory> # install the requirements with pip pip install -r requirements.txt # install ct python setup.py install
-
Run
ctfrom within thechemotaxis_py2.7.12env following example usage below. If you don’t plan to runctits a good idea todeactivateyour environment. See details of conda environment management here.
-
Activate the conda environment you installed
ctinto.# activate your chemotaxis env conda activate chemotaxis_py2.7.12 -
Navigate to the directory with your chemotaxis assay plate images, then run the
ctcommand on images to calculate the chemotaxis index (CI). The command below can be edited to run on example images in thechemotaxis-clirepo you cloned in the install.# navigagte to your directory with images. You can use our examples if desired. cd <your_path_to_chemotaxis_cli>/examples/example1 # Run ct on all .jpg files within a directory. ct *.jpg --radius 920 --fp_sigma 1 --crop 20 --center 5 --small 100 --large 1200 --debug --header > results1.txt # Run on the second example with different parameters cd <your_path_to_chemotaxis_cli>/examples/example2 ct *.jpg --radius 781 --fp_sigma 2 --crop 20 --center 5 --small 100 --large 1200 --debug --header > results2.txt
-
Process the
.txtfile as you please. The output variables are defined below:
| fname | q1 | q2 | q3 | q4 | n | total_q | total | ci |
|---|---|---|---|---|---|---|---|---|
| the file name without file extension | pixel count in top left quadrant | pixel count in top right quadrant | pixel count in bottom left quadrant | pixel count in bottom right quadrant | pixel count in origin (center) | sum of q1-q4 | sum of all | chemotaxis index (CI) |
--radiussets the radius of n pixels used to find plates in the image. It can be helpful to measure this pixel value in imageJ for one image and provide it toctso the program has an optimal starting radius for finding plates.--fp_sigmafloat, sets the standard deviation of the Gaussian filter used in canny edge detection when finding the plate center and radius. Higher values will find only the most obvious plate features. The default is 1.--cropwill crop the plate radius by n pixels when creating the plate mask. This is useful ifctidentifies the correct plate radius but the plate edges are identified as objects.--centersets the denominator value for the equation (plate radius / x), which is used to specify the radius of the origin (center) mask. The origin (center) mask is used to avoid counting nematode objects that have not migrated away from the origin (center) of the plate. The default--centervalue is 5.--smallsets the pixel count used to filter out small objects.--largesets the pixel count used to filter out large objects.--debugwill create many additional debug files that will help the user assess what objects are being counted and filtered.--headerwill attach a column header to output text file.--revwill reverse the sign of the chemotaxis index. This is helpful if the test and control compounds are switched from the default locations. Normally test compounds are in the top left and bottom right quadrants and controls are in the top right and bottom left quadrants.
- Bleach synchronize strains to be assayed.
- Use the COPAS BIOSORT with our custom chemotaxis plate holder to sort 50 synchronized L4 animals to the origin of chemotaxis assay plates.
- The CAD files and drawings required to fabricate our 3 part plate holder are here.
- The parts are assembled from bottom to top in the following order: base, support, then plates.
- Spot control and test compounds onto the plates using a multi-channel pipet. The spot locations are etched into the chemotaxis plate holder for convenience.
- If necessary, wick the M9 fluid used to dispense the nematodes to the center of the chemotaxis plates away using the corner of a kimwipe.
- Once the dispensing fluid is removed allow the nematodes to respond to the compounds for 1 hour at 20°C.
- After 1 hour, transfer the chemotaxis plates to 4°C prior to imaging.
- Image the plates within 5 days, when imaging ensure that the edges of the plate are visible so that ct can setup the plate regions correctly.
- Prior to analyzing images with
ct, open one image in imageJ and manually measure the diameter of a plate in pixels.- Select the straight line tool
- Draw a line across the diameter of the plate then click
command+mto record a Length measurement. This is the diameter of the plate in pixels, divide by 2 to get the plate radius.
- Run
cton your images and provide your plate radius--radius <your radius>as an argument. - Process the results