Hello CellProfilers! \o
The Classifier in CellProfiler-Analyst only draws on positive instances of my phenotype. The ExportToDatabase module in CellProfiler warns that the objects exported are not in a one-to-one relationship, and reading the module help and various forum posts indicate SQL finagling may be necessary.
I’m hoping you can confirm or comment on the colocalization pipeline implementation logic. To help you developers and volunteers understand the analysis I’m interested in, I’ve spend the last week generating clear, representative TIF images of the phenotype to be identified (link to TIF images and the pipeline: http://engr.uconn.edu/~pan14001/cp-forum-post-1/). Here is a montage made using FIJI of those 5 multi-channel image frames:
The only difference between each of these 5 images is the degree of overlap of the red centromeres with green inside the blue nuclei; the red fluorescent centromeres in image 1 are radially a full diameter length away and they progress to image 5 which has complete overlap.
I’m interested in:
- Counting whether or not a given nucleus contains any centromere overlap.
- (Stretch goal) Counting how many overlaps there are per nucleus.
I’ve been building the pipeline off of the excellent colocalization example. The reason I need CellProfiler-Analyst with my data is the thresholded radius for the centromeres is necessarily wider than the true diameter. Therefore object based overlap yields false positives. Combating this requires combining with the measured correlation coefficients, but infering which correlation coefficient is appropriate, as well as its value range, is challenging purely inside of CellProfiler and from playing with the data and images inside R.
As mentioned, the obstacle I have now is that CellProfiler-Analyst does not draw any nuclei with no overlaps, and so I can’t establish the negative phenotype to generate a training set.
To debug why this is happening, I enabled Debug level logging as suggested by the first page of the CellProfiler-Analyst documentation and ran the SQL commands with
sqlite> SELECT ImageNumber FROM Per_Image GROUP BY ImageNumber; 1 2 3 4 5 sqlite> SELECT Per_Object_checked.ImageNumber, COUNT(Per_Object_checked.ObjectNumber) FROM Per_Object_checked GROUP BY Per_Object_checked.ImageNumber; 2|8 3|13 4|13 5|13 sqlite> SELECT Per_Image.ImageNumber FROM Per_Image; 1 2 3 4 5 sqlite>
Per_Object_checked table seems to be excluding the first image. I tried replacing the
None values in the table with zeros, but that makes no difference because presumably Pre_Object_checked is limiting the selections.
If I don’t export the cen_overlap object, strangely, I get even fewer
sqlite> SELECT Per_Object_checked.ImageNumber, COUNT(Per_Object_checked.ObjectNumber) FROM Per_Object_checked GROUP BY Per_Object_checked.ImageNumber; 3|8 4|9 5|10 sqlite>
I can draw from image 1 if I set
check_tables = no but then of course get this error:
Exception in thread TileLoader_Thread-4: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/home/omsai/code/CellProfiler-Analyst/cpa/tilecollection.py", line 142, in run new_data = imagetools.FetchTile(obKey, display_whole_image=display_whole_image) File "/home/omsai/code/CellProfiler-Analyst/cpa/imagetools.py", line 36, in FetchTile pos = list(db.GetObjectCoords(obKey)) File "/home/omsai/code/CellProfiler-Analyst/cpa/dbconnect.py", line 658, in GetObjectCoords raise Exception(message) Exception: Failed to load coordinates for object key ImageNumber:1, ObjectNumber:39. This may indicate a problem with your per-object table. You can check your per-object table "Per_Object" in TableViewer
But I don’t understand how I should logically remedy this, namely:
- Are there changes I need to make in the pipeline?
- What changes should I make the the properties file? It seems SQL statement injection is limited; perhaps a more expanded “Dynamic Group” would work?
For completeness, I’m using Ubuntu 16.04.1 LTS. At the time of writing there are no binary GNU/Linux releases, so I’ve installed from Git using CellProfiler-Analyst 2.2.1 and the stable branch of CellProfiler (not sure where the most appropriate place is to fetch the version number in this case; stdout in the terminal says “Version: 2016-05-03T18:31:00 ac0529e / 20160503183100” and the title bar says “2.2.0 (rev ac0529e)”. I no longer remember what exactly I was investigating in May with CellProfiler that required me to move up from the stable release.
By the way, the CellProfiler workshop at ASCB in 2015 was extremely helpful. I had tried on two occasions before to learn on my own but it finally all came together there. Seeing the move to
pip from non-relocatable RPMs also made it a lot easier to install and work with. The documentation built into the CellProfiler GUI is the best I’ve seen in a few years of working with imaging software.