CPA TypeError when plotting classifier results table


I’ve used CPAs classifier and stored the results table back to the database named “Hit_table_grouped_by_Image.” .

Now I wanted to plot a histogram of one of the columns, say “Enriched_Score_positive” from said table.
The table itself displays fine (see screenshot), but when I try to select the table from OTHER TABLES I receive the following error:

An error occurred in the program:
TypeError: object of type ‘NoneType’ has no len()

Traceback (most recent call last):
File “cpa\histogram.pyc”, line 115, in on_table_selected
File “cpa\guiutils.pyc”, line 177, in get_other_table_from_user
File “cpa\guiutils.pyc”, line 252, in prompt_user_to_link_table
File “cpa\guiutils.pyc”, line 67, in init


There needs to be a process by which you match the hit table with the rest of your data; I know you can do this in PlateViewer, but I’m not sure if any of the other CPA modules support it, I haven’t tested that rigorously. Can you test to see if you can align your hit table with the data in PlateViewer and if so whether or not that works? That’ll help with telling whether it’s a problem with your data or just with the histogram tool.

(If it doesn’t work in PlateViewer either, can you let me know if this is an SQLite that you’ve altered like we discussed in [this thread](Exporting to SQLite and overwriting Presults? If so, you may have to mess somehow with the link tables.)


thanks for your answer @bcimini

[quote=“bcimini, post:2, topic:5001”] Can you test to see if you can align your hit table with the data in PlateViewer and if so whether or not that works?
If tested this but I think my dataset is not really suited here as its not from a plate but several stack from a confocal, so I receive the following error when I click on the plate viewer:

An error occurred in the program:
Exception: Properties field “plate_shape” is required for PlateViewer.

Traceback (most recent call last):
File “”, line 267, in launch_plate_map_browser
File “cpa\plateviewer.pyc”, line 43, in init

In this case I have not altered the SQL file at all, to be honest I am still fighting with appending one database to another…so that’s still ongoing :slight_smile: Thanks for your help! I really think CP and CPA are awesome!


I think you can still run the PlateViewer as long as you set something the plate_shape to something reasonable (like 96) in the properties file and the plate_id and well_id to something; you can edit that in any text editor you like. It’ll be nonsense, but it doesn’t actually matter.

I suspect that’s not actually necessary though, because I just tried doing this myself on some sample data and you can definitely match the hit table to your data in the Histogram tool, at least in my hands. I did manage to replicate your error in one particular set of circumstances though- after you hit OTHER TABLE, it asks what kind of data you’re adding (per well, per image, etc). The box that comes up LOOKS like it’s a dropdown, but it’s not, so if you arrow down to “per image” and then hit enter without clicking on it, “per well” is actually still selected and if I used a dataset without plate or well metadata I got the same exact error that you did. If you make the box bigger and CLICK on the “per image” option, do you then get a question box asking whether your table represents a new set of images? If so, click “No”, then you should get a table that looks like the one I’ve posted below and you should be on your way. Can you check if this is also how you were getting to that error? If so, that should be an easy fix, though I may file a UI improvement ticket on it because that box comes up a very confusing size. If not, you may want to try the properties file trick I just mentioned.


Hi @bcimini, once again thanks for the swift and great help :slight_smile:

Indeed this fixed the problem, I mistook the menue to be a drop-down menu when in fact I should have selected my choice by highlighting.

so yes I can confirm that this is how I got the error and also that it works perfectly fine if I do it the way you wrote! thanks again, really really helpful!