Cell lineage with matlab Phytree


Hi, I am having problems with CPA tracer. I am trying to write a code in matlab to visualize the lineage tree for my database. However, I am not able to convert the information generated using ExportToSpreadsheet Module to be used in for matlab phytree. Could you please help?

Thanks a lot.


Can you give us more specifics about what you’ve tried and what is and is not working? Thanks.


Yes sure, for example, Export to database generates a CSV file where I have the Image Number, Parent Object Number, Object Number.
How does the CPA tracer uses this to draw the lineage tree.

In case of matlab, I need a adjaceny matrix that generates a lineage tree using the bioinformatics toolbox, and function phytree for matlab.


Also, is there any way I can get a link to tracer.py code used in CPA?


The dataset generated using Cell Profiler gives me the object number for each frame and parent Id. How can i use it? For example the is ma data: lineage_object_parent_in_previou_frame= [0 0 1 2 1 2 2 1 1 2 3]; ObjectNumber = [1 2 1 2 1 2 3 1 2 3 4]; IimageNumber_or_frame_number= [1 1 2 2 3 3 3 4 4 4 4];


The source code for tracer is here.

I’m very inexperienced when it comes to MatLab, so I’m afraid I’m not much help there. When it comes to the spreadsheet information you want to use to create your tree, the TrackObject outputs will actually be more helpful; specifically the Label (which is the unique identifier) and its ParentImageNumber and ParentObjectNumber; if you’re using LAP the LinkType may also be of use to you.


Thank you so much for your reply. I am really thankful to you for your help. I am in completion of my project: I have two questions:
1)Is there a way I can save the lineage tree generated in CPA tracer? if yes, how.
2) The tracer shows the lineage for all cells and I am able to select a particular cell. However, zoom in for tracer does not work efficiently. Is there a way I can fix that so that i can zoom in to see only a set of frames.

thank you once again.

  1. It doesn’t seem like there’s a simple way to do it, but you could either a) take a screenshot and then just crop and save that or b) Open the Mayavi editor (teal arrow), copy the plot from scene 1 (orange arrow), then make a new plot (red arrow) and paste it in.
  2. As far as I know, no, but it looks like there are plans in the source code to add the ability to use certain subsets of the data (ie frames 25-30) it just hasn’t been debugged properly and thus isn’t live yet. If you really needed to plot just that data, you could export it to a different table and then point your properties file at that table instead.


Thank you so much. It really helped. I look forward to improved tracer functionalities.


Hello @bcimini,

We would like to make above plot using CellProfilerAnalyst Tracer.

However, our data comes from Imaris and thus has a different structure.
Could you please provide as with an example CellProfiler output table (ideally the one that above plot is based on) such that we know how to reformat our data to be able to load it into CellProfilerAnalyst?

Thank you very much!


Hi Christian,
It’s hard to remember exactly what I used to generate this (this thread’s from August, I usually don’t remember before yesterday’s breakfast! :laughing:), but it was probably the example files and pipelines from the Tracer paper.


Thanks for the answer.
I downloaded the files and it looks like the output is a SQLITE database and not a simple table.
Can one use the Tracer also with a simple tab-delimited table as an input?


I don’t believe so, because Tracer is built off of CellProfilerAnalyst, which requires a database file. You should be able to turn your table into an sqlite with relatively little difficulty; on Windows I’ve used the “DB Broswer for SQLite” tool to do this, but I’m sure there are many others.


I just tried to install the Tracer but got this error:


C:\Program Files\CellProfiler-Analyst>CellProfiler-Analyst.exe
Traceback (most recent call last):
File “CellProfiler-Analyst.py”, line 10, in
File “javabridge_init_.pyc”, line 28, in
Copyright © 2009-2013 Broad Institute
File “javabridge\jutil.pyc”, line 138, in
variables will be assigned to the appropriate
File “javabridge_javabridge.pyc”, line 12, in

File “javabridge_javabridge.pyc”, line 10, in __load

ImportError: DLL load failed: The specified module could not be found.



I added…

C:\Program Files\Java\jdk1.8.0_131

…to both the PATH and the JAVA_HOME system variable. Maybe that is not enough?


Can you try removing the JAVA_HOME variable? Sometimes that helps.


Now I only have below in PATH:

C:\Program Files\Java\jdk1.8.0_131\bin

Note, that I forgot the \bin the first time.

Now I get a new error message: Can’t find the JVM


Based on this thread, it looks like for some people they needed to have JAVA_HOME set, but set to the JRE (not the JDK). Also make sure it’s the 64 bit version!

Sorry for the difficulty, Java is like the most painful part of troubleshooting CP/CPA installation stuff (IMO).


Ok. For me now the following worked:

  • Add to Path: C:\Program Files\Java\jdk1.8.0_131\bin
    • and move it above some other system path that was called OracleJava or something like this.
  • No java_home

Thanks for helping out!


Hi @bcimini ,

Since I got it to to run now, I am trying to use it :slight_smile:

I tried: [Select Tracks to Visualize…] and it removes the connecting lines of the unselected tracks, but the dots are still visible and also the y-axis scaling does not adapt (see Screenshot). How can I fix this?


I tried: [Select Tracks to Visualize…] and it removes the connecting lines of the unselected tracks, but the dots are still visible and also the y-axis scaling does not adapt (see Screenshot). How can I fix this?

I think I may have intended it to work that way, the idea being that I want to see the visualized track in the context of its neighbors. I also suspect that this was easier than figuring out how to re-scale using the visualization package :slight_smile: