Re: Colocalization Finder

Posted by CARL Philippe (LBP) on
URL: http://imagej.273.s1.nabble.com/Re-Colocalization-Finder-tp5022772p5022784.html

Dear Jeremy,

I'm really sorry to not have answered your mail earlier, but I had been quite badly sick spending a couple of days mostly in bed!

> The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
> This means that we are using a display that shows correlation to select which pixels to use in a correlation
> measurement - somewhat self referential.

The plugin able you as well to locate the position within the scatterPlot of a given pixel inside the composite picture.
In order to do so, just take a limiting ROI within the scatterPlot that insn't covering the whole picture (let's say for example 1/4 or 1/8th of the scatterPlot size).
Then press the Ctrl key and move the mouse over the composite picture.
You will then see the ROI within the scatterPlot jumping around, it's center position representing then the pixel selected within the composite picture.

The tests you described are quite interresting and can easily be reproduced with the following macro code:
        newImage("Untitled", "8-bit noise", 256, 256, 2);
        run("Stack to Images");
        run("Colocalization Finder", "image_1=Untitled-0001 image_2=Untitled-0002");
        selectWindow("ScatterPlot");
        makeRectangle(60, 20, 257, 257);
// output = call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        makeRectangle(189, 20, 128, 128);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);
        makeRectangle(189, 149, 128, 128);
        call("Colocalization_Finder.analyzeByMacro", "true", "false", 0);

Following your observations, I compared on one side the equations within the plugin to the published and theoritical ones (i.e. see paper from Bolte and Cordelière in the journal of microscopy).
So the used calculations are not similar (at least on it's first look) since the plugin uses methods from G. Chinga with the use of the stdev value within the calculation.
Nevertheless by writing down both equations, it is very easy to demonstrate (at most within 2 lines) that they are in fact absolutely similar.
And on the other side, I compared the values calculated by the plugin to the one obtained "by hand" i.e. by making the calculations by Excel and this on several ROI selections within the scatterPlot (using noised picture generated as you described it).
Using both directions (and way on the contrary of what I was expecting at first reading your mail) I didn't figure out any issue or bug within the Pearson's value calculation.

And to push things even further (if you wish) I can send you the Excel file I used for the calculation verifications, together with a "special version" of the colocalization_finder plugin outputing the needed parameters to be put within the Excel spreadsheet.
Following these tests, I even found something quite funny...
So let's say you have 65536 intensity values with 65535 values equal to 0 and only 1 equal to whatever value and you have this for the two pictures (let's call these whatever values x and y).
Then (x - Average) / Stdev = X = (y - Average) / Stdev = Y = almost 256.
And X * Y = 65534 and summed over all the elements gives EXACTLY 65535.
Given that we started with 65536 values, the Pearson's coefficient is then exactly equal to 1!
And what is funny is that this result is exactly the same for whatever initial x and/or y values!!!
More than obviously there is probably a mathematical pattern here that can more than probably also be demonstrated (but this demonstration I didn't try to make it).

So as a conclusion the Pearson's calculation within the colocalization_finder plugin is right for me unless you find new potential issues.

Feel free to contact me for any additional question or issue.

My best regards,

Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies
UMR 7021 CNRS - Université de Strasbourg
Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Jeremy Adler" <[hidden email]>
À: "imagej"
Envoyé: Mardi 10 Décembre 2019 12:30:40
Objet: Re: Colocalization Finder

The Colocalization Finder plugin allows for selection part of scatterplot for subsequent measurement of correlations.
This means that we are using a display that shows correlation to select which pixels to use in a correlation measurement - somewhat self referential.
To test the plugin I generated two uncorrelated images
           newImage("Untitled", "8-bit noise", 256, 256, 2);// Gaussian distributions
and the split them, before running the plugin.
1) Using the whole image produces a sensible Pearson correlation - around zero.
2) Adjusting the ROI to select the upper right quadrant produces a correlation near 1.00 -
A near perfect positive correlation.
3) Selecting the lower right quadrant also produces a near perfect positive correlation

2) and 3)  cannot be correct, a perfect positive correlation in a scatterplot should appear as a diagonal line going thru the origin.

is the Pearson's_Rr shown in the results table the normal Pearson correlation ?

presumably I am missing something important, but what ?

Jeremy Adler
BioVis
Uppsala U

-----Original Message-----
From: ImageJ Interest Group On Behalf Of CARL Philippe (LBP)
Sent: den 6 december 2019 18:09
To:
Subject: Re: Colocalization with Coloc2

Dear David,
I would rather recommend you to use the Colocalization Finder plugin:
https://imagejdocu.tudor.lu/plugin/analysis/colocalizationfinder/start
for which I took over the maintenance.
The plugin can be applied for whatever bit depth picture (i.e. 8, 16 or 32 Bit picture) and able you to define "on the fly" an analysis ROI (i.e. within the scatterPlot picture) as well as within the composite picture.
The calculations are generated (inside a results window) when you click inside a ROI (i.e. within the scatterPlot or composite picture) and you can as well set a ROI selection with a double click inside a ROI.
Nevertheless, the plugin has only be written for the analysis of two single pictures as start conditions (i.e. not for a stack).
But the code is very easily scriptable for stacks and you can find two example macros within the website link I indicted higher.
The only drawback of the tool is maybe the lack of a good "biologist compatible" description (sorry I'm only a physicist) of it's features for which I'm waiting for some "biologist colleagues" to write it and you are as well welcome to do so if you wish.
Feel free to contact me if you have any issues with this tool or ideas for improving it.
My best regards,
Philippe

Philippe CARL
Laboratoire de Bioimagerie et Pathologies UMR 7021 CNRS - Université de Strasbourg Faculté de Pharmacie
74 route du Rhin
67401 ILLKIRCH
Tel : +33(0)3 68 85 41 84

----- Mail original -----
De: "Knecht, David" <[hidden email]>
À: "imagej"
Envoyé: Vendredi 6 Décembre 2019 16:56:21
Objet: Colocalization with Coloc2

I was trying to use the Coloc2 in Fiji and the colocsample data provided in the cookbook. (https://imagej.net/Colocalization_Analysis) to instruct my microscopy students.  I have not done much of this myself so wanted to understand the software before teaching it.

I was unable to generate any useful data.   I got all kinds of warnings when I ran it with the stacks or a single slice from the stacks even though the dataset was clearly colocalized.

1.   I tried to use a freehand ROI to focus on the membrane edge of the cell, but it did not seem to be used or make any difference.  The image shown in the results was always the entire image and nothing seemed to indictate it was working with just the ROI
2.  I tried subtracting background (around 60) from the images so only real data was analyzed and still got lots of warnings.
3.  The results scatterplots seemed meaningless. In no case did it show the high degree of colocalization of the two probes in the sample data.
4.   I am not sure how to generate the useful dot scatterplots of the sort shown in Dunn et al. from this analysis.
5.  With the stacks, I expected a slice by slice analysis.  The image shown in the results seemed to be only the first slice.
6.  I was never able to see an image with the colocalized pixels found by the analysis highlighted.

It would be really useful to someone doing this for the first time if that page were updated with a complete astep by step nalysis of that sample data.  Settings, results, etc. with different inputs (ROI, noise reduction, stacks vs. slices etc.). so all the complexities are clarified.  Is that available somewhere?   Thanks- Dave

Dr. David Knecht
Professor, Department of Molecular and Cell Biology University of Connecticut
91 N. Eagleville Rd.
U-3125
Storrs, CT 06269-3125
860-486-2200

--
ImageJ mailing list: http://imagej.nih.gov/ij/list.html