Is it possible to combine export to excel files to one file?

Hi I’m using CellProfiler 2 and am trying to analyze some data. The data looks at the amount of mCherry positive events within a cell and the number of FITC positive events within the mCherry positive area. The pipeline we have is fine it does the job and gives us an output we are satisfied with when we look at it when we have a small data set.

The output, does result in three separate .csv files. I would like a one file output and one that aligns the data from each MCH and FITC even to their parents. Our lab inherited a python script that does part of the work but it only sums the MCH and FITC data for each cell, it does not provide us with a table that shows the individual values. I’m a novice with Python as it is so I am struggling to get it work the way I want.

Is there a way I can change the output so that it does what I am asking?

Thank you!

Hi @JMilesUTSW,

Could you elaborate on how you imagine a single file output would look? If you want to combine multiple object types this may not be straightforward as a single parent cell will probably have multiple children. A single row in a table represents one object, so which object should that row represent and where should the data from multiple objects be placed?

The ExportToDatabase module does have a single table export option, but this is primarily designed for use with CellProfiler Analyst as the presence of mixed object types can make it hard to interpret.

Hi @DStirling,

I am trying to get an output that makes it easy to sort and identify which image and cell the mCherry and FITC positive events come from. This data is already in the outputs but is not easy to sort manually in excel for large data sets over three different files. Some wells will be FITC+.MCH+, some will only be MCH+ but all will have cells.

I would like an output that I can look at each object of FITC and see which MCH object it comes from and which cell they both are children of. In addition to information like intensity, area, etc. of the object. I also need to know how many cells are MCH- within an image and how many MCH objects are FITC-. Right now we are using a python script written at my PI’s previous lab and it does some of this, but it sums the values for each child (summed area/parent cell) and does not allow us to determine how many MCH+ objects there are in an image or even in a cell. I’m working on improving the script but am a novice there, so if there is a way in CP to change the output, it would make things a little easier.

Does that clarify my question a bit more? I have attached a csv with an example layout to give an idea of what I am talking about.

Thank you so much for your reply!!!

RESULTexample.csv (636 Bytes)

Thanks, I think I understand. Due to the way that exporting different object and image sets works I don’t think there’s an easy way to do this in CellProfiler itself. However, such an operation is relatively straightforward using the Pandas Python package.

Here is a rough jupyter notebook for this sort of task, which hopefully might be useful as a starting point:

Thank you so much! I will have to see if I can get this to work for me, appreciate it!