RGLab / CytoML

A GatingML Interface for Cross Platform Cytometry Data Sharing
GNU Affero General Public License v3.0
30 stars 14 forks source link

Support magnetic gates from flowJo #85

Open jacobpwagner opened 4 years ago

jacobpwagner commented 4 years ago

This is an issue to link together commits on parallel work on cytolib and CytoML to support magnetic gates exported to FlowJo workspace XML.

For reference, FlowJo's doc on magnetic gates: http://docs.flowjo.com/vx/graphs-and-gating/advanced-gates/gw-gatemagnetic/

When output to XML, the same magnetic gate applied across samples is stored in each subpopulation's gate node with identical coordinates and an adjustX and adjustY attribute to specify the shift on the transformed gate. This last part is important because it means that the shift can't be applied when the gate is parsed as it has no information of the transformation to be applied.

Thus the strategy is to parse the gate and store its shift for later application immediately after transformation here:

https://github.com/RGLab/CytoML/blob/398d51ce2e34937fdee39cce90462f31709f99e6/inst/include/CytoML/flowJoWorkspace.hpp#L362

In order to do this, the base cytolib gate classes need to be updated to store and apply the parsed shifts accordingly when called by a to-be-added GatingHierarchy::shift_gate method.

jacobpwagner commented 4 years ago

The joint CytoML/cytolib solution of adding shifts to gate objects to be applied post-transformation is done, but adds some more memory overhead to each gate. I may re-implement this entirely in CytoML by storing the shifts outside of the gate objects and applying them within parse_sample as is done now.