taborlab / FlowCal

Python Flow Cytometry Calibration Library
MIT License
49 stars 23 forks source link

AttributeError in density_and_hist, likely caused by Matplotlib v2.0.0 #233

Closed SynbioLucas closed 7 years ago

SynbioLucas commented 7 years ago

Error reads: AttributeError: '_LogicleTransform' object has no attribute 'linthresh'.

Full stack trace: here

Whereas, running the exact same code on an earlier version of Matplotlib yields a normal FSC/SSC plot for beads. (Caveat: other packages are different as well! See full list attached.)

OS: Linux Mint v18.1 64-bit Packages installed: Linux Packages Packages installed on WORKING system (no errors): Windows Packages

castillohair commented 7 years ago

Same as #231.

castillohair commented 7 years ago

Found the problem. FlowCal uses something called "logicle" scaling, which is standard for visualization of flow cytometry data, and allows to see negative fluorescence values in a histogram that is mostly logarithmic. To implement this, I had to make a bunch of classes and give them to matplotlib. But one of the classes was not written from scratch, but inherited from another matplotlib class. Matplotlib 2 rewrote parts of this class, and now my inherited class breaks.

b00504c2db1d55593a8984263ab4c870680c435d has a solution for this issue. Basically I rewrote the whole class using code from the parent class in matplotlib 1.5.1. I confirmed that it solves the plotting issue in matplotlib 2.0.0, but I need to test that it doesn't break things in previous versions of matplotlib. After I do this, I'll incorporate changes into the release version.

castillohair commented 7 years ago

Merged into develop. Will push into stable branch soon.