Co-localisation calculations


Wondered if you could help!

I’m trying to calculate the proportion of GFP +ve cells which are also positive for EdU in an image. Ive also used DAPI as a nuclear stain.

Ive set up a pipeline to identify primary objects (EdU and DAPI) and then secondary objects (for the GFP), using DAPI as the input object. The problem is that not all of my DAPI positive cells are also positive for GFP but cell profiler seems to be calculating them as such. I’m not sure what I need to change (is it some thing in the Identidy Secondary Objects part?).

Any help would be much appreciated

Thank you

Hi, welcome!
I suspect it’d be easier to help you if you can provide the pipeline and some images needed to run it. Could you try uploading those?

Colocalisation w sec.cppipe (14.7 KB)

Here’s the pipeline


And an example image

  • I want to count the proportion of cells which are positive for both GFP and EdU.
  • At the moment, its counting all DAPI positive cells (601 in the image provided) as also GFP positive

Thanks! Any help very much appreciated!!

I seem to be having problems uploading images, sorry!! Heres a link to a dropbox file -


I think part of the issue here is a terminology misunderstanding; a “secondary object” is an object that’s grown around a primary object, so all primary objects do indeed lead to secondary objects.

To get your GFP positive nuclei, instead of doing IdentifySecondaryObjects on your DAPI objects I’d try doing either of the following- both should get you what you want, but which works better depends on your particular images.

  1. Measuring your DAPI objects in the GFP channel with MeasureObjectIntensity then using FilterObjects to keep only DAPI objects with a certain mean or median intensity
  2. Doing (Apply)Threshold on the GFP channel to mark regions that are GFP positive and then MaskObjects on your DAPI objects to only keep ones that overlap with the thresholded GFP areas.

Does that help?

Thanks so much. Very helpful indeed.

I went for option 2. Which I’ve tested on the image I provided (and manually counted to validate) - seems pretty accurate.

Ultimately, I’ll be counting on slide scanned TIF files, which are pretty large. Whilst some of the results seem ok, its a bit more variable in terms of accuracy (i.e. in some cases counting more EdU positive cells than DAPI positive cells, which obviously doesn’t make sense). It seems to be because its counting some of the nuclei several times when it identifies the primary object (I’ll try and attach a picture) - I’ve tried playing with the advanced settings and thresholds but I end up with no cells. Any idea how I can fix this?

Many thanks!

Heres my latest pipeline in case that helps:
Colocalisation New.cpproj (654.2 KB)

You’ll want to play with the object declumping settings in the “Advanced Settings” tab of IdentifyPrimaryObjects (these are all the settings that discuss either “clumped objects”, “declumping”, or “local maxima”) to adjust when objects are broken into two vs lumped into one- see the module help (or the help for each individual setting) for further explanations on what each one does.

I can’t really be CERTAIN which object is which in your pipeline relative to your explanation since the names don’t quite match up, but your “Colocalised” objects by definition should contain all (blue, green, and red objects); if you’re seeing a greater Image_Count_Colocalised than an Image_Count_BlueObject, that’s definitely a bug and should be fixed. The measure that you said you wanted earlier (percent of GFP+ cells that are also EdU+) would be calculated by dividing the Image_Count_Colocalised by Image_Count_Mesenchyme, either in CP with a “CalculateMath” module or after the fact in Excel or whatever program you like.