Extracting object data in CPA

Hi CPA teams,

First of all, thanks for inventing such software. Super helpful!

However, I am just wondering that is it possible to obtain the details of each of classified object in the CPA?

For instance, here: VI. Table Viewer — CellProfiler Analyst 3.0.0 documentation
We can get the classification result in total per image. But, can we also get each of the object’s detail we have gathered in the CP previously? for instance, the mean pixel intensity, mean radius and etc?

I tried to get the training set from CPA but not sure how to implement it in CP. Maybe from the team could give me some directions? or similar case?

Thanks a look forward to any reply.

Best
IS

Hi Immanuel,

That information is already in your database, you just need to join your two database tables (your object table and your class table) on the ImageNumber and ObjectNumber - you can do this in whatever you plan to do your downstream data analysis in (Python, R, even Excel just by making sure both tables are ordered in the same way(they should be by default) and then copying and pasting).

If none of those work, please give us a little more info on what you want to extract and how you want to interact with the data, and we’ll try to help you out!

Hi @bcimini

Thanks for the reply.
I try to grasp what you are trying to explain.
However, I can’t even save the database I have generated.

It says this
image

Maybe I can explain a bit more.
So, basically i try to revisit my detected object after my classification. As you see here, I only have the total cell count and the two group classification (negative/ positive).

However, I want to revisit each of the detected object profile, such as the area, mean intensity and etc which I also have in the initial database. This is the example of my full object table

I am sure this can be achieved, but I just have no clue how can I combine these two database when i couldn’t save the properties file.

Best,
IS

Regarding the error - could you confirm that you’re running v3.0.2?

Also, if you head into the table viewer and try to open a table from the database, are you able to find a table containing the per-object scores from the classifier? It looks like the table you have open is the per-image summary. The per-object class table may not be generated if you haven’t set the class_table name parameter in your .properties file.

Hi @DStirling

I am running at the v3.0.1
Does this make a difference?

Also, where do I need to set the per-object class table?
Does this correlate to this one in CP?
image

I will try to install the new CPA and generate the new properties file with single object view.

Thanks and will report this soon.

Best
IS

The error you saw is a bug I fixed in 3.0.2, so the newer version should resolve that.

For the class table, you should see an option in ExportToDatabase labelled “Enter a phenotype class table name if using the Classifier tool in CellProfiler Analyst”, under the properties file generation settings.

There’s no need to re-run the analysis though. If you open the .properties file you already have in Notepad, you should be able to find the class_table field and add a name to it. Once you’ve done that, running a “Score All” operation in CPA should create a table of the per-object results.

Just to add to this for future reference, if you want to construct a view which has the class name AND the original data, you can use the SQL query tool available in the ‘Advanced’ menu in the main window. Paste this command in and replace “ClassTable” and “ObjectTable” with your table names:

SELECT * from ClassTable INNER JOIN ObjectTable ON ClassTable.ImageNumber=ObjectTable.ImageNumber AND ClassTable.ObjectTable_Number_Object_Number=ObjectTable.ObjectTable_Number_Object_Number

It may take a while to run on large datasets, but the resulting table should display and can then be saved to the database.

Hi @DStirling and @bcimini

I found the class! Thanks, it was me that didn’t know it’s there all the time.
Thank you for the additional command as well.

Best
IS

1 Like