How to select cells with both GFP and mCherry for stress granule counting

Dear Friends,
I have different types of HeLa cells (with GFP or mCherry or both) in Ch1 (for gfp) and Ch2 (for mch). I am interested in only those cells where both GFP and mCherry are present. I need these cells for stress granule counting. Can you please suggest how can I proceed for calculation positive cells (gfp+mch) with stress granules?

Thank you so much.
best regards,
NS

2 Likes

Hey @nir9,

would you mind sharing an example image so that we can guide you in the right direction? :upside_down_face:

Cheers,
Robert

Dear Robert,
Thank you very much for your concern. Yes, sure I am sharing the images.CH_GFP.tif (877.8 KB) CH_mCherry.tif (877.8 KB)

Thanks.
Nir9

Hey @nir9,

in Fiji, you can use blurring+thresholding to get rough contours of the cells in the two channels. Afterwards, use the Image Calculator to get the binary overlap (AND) of both binary images. Last but not least, the Particle Analyser allows you to define regions of interest. This macro can be a starting point:

open("C:/Users/rober/Downloads/CH_GFP.tif");
open("C:/Users/rober/Downloads/CH_mCherry.tif");

// duplicate mCherry image and segment it
run("Duplicate...", " ");
run("Gaussian Blur...", "sigma=15");
setAutoThreshold("Default dark");
setOption("BlackBackground", true);
run("Convert to Mask");

// select GFP and segment it
selectWindow("CH_GFP.tif");
setAutoThreshold("Default dark");
//run("Threshold...");
run("Gaussian Blur...", "sigma=15");
setAutoThreshold("Default dark");
run("Convert to Mask");

// select all pixels which are positive in GFP AND mCherry
imageCalculator("AND create", "CH_GFP.tif","CH_mCherry-1.tif");
selectWindow("Result of CH_GFP.tif");

// make Regions of interest
run("Analyze Particles...", "add");

// show result and close intermediate results
selectWindow("CH_mCherry.tif");
close("\\Others");
roiManager("Show None");
roiManager("Show All");

Does this help you?

Cheers,
Robert

Dear Robert,
Thank you so much for your help!
Can you please suggest further after this code if I want to distinguish which contains smaller granule? I need the number of mCherry-cells (with gfp already) containing granule/smaller particle. I can segment and count the individual granule but how I can give the relation of parent cells?

Thanks a lot!
best
Nir9

Let’s work together on it by sharing in both directions.

How do you segment and count them? If you share your macro, I can help you extending it :wink:

Cheers,
Robert

Here it is: (though I am not very satisfied with this, have to improve).

//Droplet counting

run(“16-bit”);

WindowTitle=getTitle()
selectWindow(getTitle());

run(“Duplicate…”, “title=duplicate1.TIF”);
run(“Smooth”);

run(“Threshold…”);
waitForUser(‘choose proper threshold and press Apply and ok’)´
run(“Convert to Mask”);
run(“Analyze Particles…”, “size=0.5-5 circularity=0.70-1.00 show=[Overlay Outlines] display exclude clear summarize record”);

Thanks.
best
Nirnay

Hey @nir9,

after the first step, cell segmentation, you can go through all ROIs in the ROImanager and analyse these rois in detail. For example, you can do so by multiplying all pixels outside of the ROI with 0.

open("C:/Users/rober/Downloads/CH_GFP.tif");
open("C:/Users/rober/Downloads/CH_mCherry.tif");

// duplicate mCherry image and segment it
run("Duplicate...", " ");
run("Gaussian Blur...", "sigma=15");
setAutoThreshold("Default dark");
setOption("BlackBackground", true);
run("Convert to Mask");

// select GFP and segment it
selectWindow("CH_GFP.tif");
setAutoThreshold("Default dark");
//run("Threshold...");
run("Gaussian Blur...", "sigma=15");
setAutoThreshold("Default dark");
run("Convert to Mask");

// select all pixels which are positive in GFP AND mCherry
imageCalculator("AND create", "CH_GFP.tif","CH_mCherry-1.tif");
selectWindow("Result of CH_GFP.tif");

// make Regions of interest
run("Analyze Particles...", "add");

// show result and close intermediate results
selectWindow("CH_mCherry.tif");
close("\\Others");

// go through all ROIs an search for objects inside
number_of_rois = roiManager("count");
for (r = 0; r < number_of_rois; r++) {
	// dupllicate the image to not screw up the original
	run("Duplicate...", "title=duplicate1.TIF");

	// remove noise
	run("Smooth");

	// remove background
	run("Subtract Background...", "rolling=25");

	// remove pixels outside ROIs
	roiManager("select", r);
	run("Make Inverse");
	run("Multiply...", "value=0");
	run("Make Inverse");

	// automatic threshold
	setAutoThreshold("Intermodes dark");
	setOption("BlackBackground", true);
	run("Convert to Mask");

	// find objects
	run("Analyze Particles...", "size=0.5-5 circularity=0.70-1.00 summarize record add ");

	// close duplicate image
	close();
}

// show all ROIs
roiManager("Show None");
roiManager("Show All");

Furthermore, be careful with manual thresholding - it is not reproducible. I can explain that to you in more detail if you like: https://youtu.be/LT8L3vSLQ2Q?t=1578

I hope that helps

Cheers,
Robert

2 Likes

Dear Robert,
That’s awsome! You are Great! Many many thanks to You for your kind help.
I will follow you on your channel.
:slightly_smiling_face: :ok_hand:
Thanks.
With best regards
Nirnay

1 Like

Hello Robert,
Can you please suggest me how to improve the code a bit more:

  1. Open and rename in a batch mode (need all ROIs information also)
  2. how I can do better segmentation of cells! You see here there are two cells. Capture|471x404

so far the code is like this:
//give the path and file name
open(“D:/Research/Experiment_Data/filename_gfp0000.tif”);
run(“Rename…”, “title=CH_GFP.tif”);

//change the file name only
open(“D:/Research/Experiment_Data/filename_mch0000.tif”);
run(“Rename…”, “title=CH_mCherry.tif”);

// duplicate mCherry image and segment it
run(“Duplicate…”, " ");
run(“Gaussian Blur…”, “sigma=15”);
setAutoThreshold(“Default dark”);
setOption(“BlackBackground”, true);
run(“Convert to Mask”);

// select GFP and segment it
selectWindow(“CH_GFP.tif”);
setAutoThreshold(“Default dark”);
//run(“Threshold…”);
run(“Gaussian Blur…”, “sigma=15”);
setAutoThreshold(“Default dark”);
run(“Convert to Mask”);

// select all pixels which are positive in GFP AND mCherry
imageCalculator(“AND create”, “CH_GFP.tif”,“CH_mCherry-1.tif”);
selectWindow(“Result of CH_GFP.tif”);

// make Regions of interest
run(“Analyze Particles…”, “add”);

// show result and close intermediate results
selectWindow(“CH_mCherry.tif”);
close("\Others");

// go through all ROIs an search for objects inside
number_of_rois = roiManager(“count”);
for (r = 0; r < number_of_rois; r++) {
// dupllicate the image to not screw up the original
run(“Duplicate…”, “title=duplicate1.TIF”);

// remove noise
run("Smooth");

// remove background
run("Subtract Background...", "rolling=25");

// remove pixels outside ROIs
roiManager("select", r);
run("Make Inverse");
run("Multiply...", "value=0");
run("Make Inverse");

// automatic threshold
setAutoThreshold("Intermodes dark");
setOption("BlackBackground", true);
run("Convert to Mask");

// find objects
run("Analyze Particles...", "size=0.2-6 circularity=0.50-1.00 summarize record add ");

// close duplicate image
close();

}

// show all ROIs
roiManager(“Show None”);
roiManager(“Show All”);

Thanks a lot!
best
Nirnay