Can't create Scatterplots

Hi,
I am very new to CPA and MySQL. So my problem is, that when I use the ExportToDatabase module of CP to create thr properties file for CPA I can view the images but I can’t create any plots.

When I change the properties file a bit (because in MySQL everything is in small letters):

image_table = Per_Image
object_table = Per_Object

to

image_table = per_image
object_table = per_object

at least now I can create histograms and density plots. But for Scatterplots this error occurs

An error occurred in the program:
Exception: Tables “Per_Image” and “per_image” are not linked.

Traceback (most recent call last):
File “scatter.pyc”, line 239, in update_figpanel
File “scatter.pyc”, line 293, in _load_points
File “sqltools.pyc”, line 45, in str
File “sqltools.pyc”, line 133, in get_from_clause
File “sqltools.pyc”, line 127, in get_tables
File “dbconnect.pyc”, line 918, in get_linking_expressions

So why does the histogram find the table now but the scatterplot does not??

Thank you for your help

Hi Carsten,

A clarifying question: Are you using a remote MySQL server, or a local SQLite database.

Also, which version of CPA are you using? The one available from the main download page here: cellprofiler.org/downloadCPA.shtml?

Regards,
-Mark

Hi Mark,

meanwhile I tried both MySQL workbench 5.2 and SQLite. But I am not happy with either of them.
I fixed the Scatterplot problem by simply change the name of the Per_Image and Per_Object tables in MySQL and the properties file. SQLite worked without problems on the first look.

But now with both databases, when I load an image and click somewhere randomly in the image this error occurs:

An error occurred in the program:
TypeError: unsupported operand type(s) for *: ‘NoneType’ and ‘float’

Traceback (most recent call last):
File “imageviewer.pyc”, line 117, in OnPaint

PLUS when I try to fetch some images in the classifier this error occurs:

Failed to load coordinates for object key ImageNumber:10, ObjectNumber:2. This may indicate a problem with your per-object table.

I don’t know what I am doing wrong. I use the CPA version from the main download page Analyst 2.0 r11710. But it was installed 6 month ago.

Thanks for your help

Best
Carsten

Hi Carsten,

First, do you have just a single, Per_Object table? If not, then CPA will very likely fail (this is a setting in ExportToDatabase, to export to a single per_object table)
(Is this why you had to change the name of the per_X tables before?)

Next, look at the Per_Object table, as the error suggests:

If you inspect the Per_Object table and find the row that has ImageNumber=10 and ObjectNumber=2, are there any oddities in the data, like missing values, NaNs, etc? Take special care to look at the Object_Location_X/Y columns, since those denote the locations of the objects used by CPA.

Finally, post your properties file, so we might better help you.

Thanks,
David

Hi David,

I took a look at the Object table. I had a lot of “None” values because I discarded some objects during my CP analysis. When I avoid this, so a table without “None” values, everthing works.

Now that I can work I realize that I can’t create parallel coordinate plots like they do in the tutorial. Did you replace that by the BoxPlot? Also, when I select datapoints with the lasso they are not highlighted in other plots.
Moreover, I now see that GFP images are black, while bright field images of the same microscope and the same format (.tif) are perfectly displayed in CPA. I can’t find the difference between the two images and I don’t get an error, GFP is just black.

Sorry for somehow changing subject. But I am really lokking forward working with CPA. But with black images it’s a bit difficult

Thanks
Carsten

Hi Carsten,

Sorry for the delay.

Yes, parallel coordinate plots were never implemented in CPA2.0. Yes, with Boxplot you can get at sort-of-similar functionality.
As for other “data exploration” tools in CPAnalyst, yes, some issues have remained (like the lasso function) in the release version. You can try an updated CPA trunk build for some bug fixes (read the caveats that apply!).

Hmm, the GFP images might be black for a number of reasons. Are they 12-bit images saved in a 16-bit format? This can make them look almost black. However if your brightfield channel spanned the full brightness range, then this solution is less likely. Be sure to check your database Pathname and Filename columns for the GFP channel. Perhaps one of them is wrong. If you double-click the thumbnail, does the whole image appear? Black? Another column to check is the “*Location_X/Y” column(s), which might be misnamed. If you haven’t solved the issue, could you upload an example, even a screenshot of CPA?

David