Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

disable gate extension logic for the latest flowJo wsp #106

Open
mikejiang opened this issue Jun 30, 2020 · 2 comments
Open

disable gate extension logic for the latest flowJo wsp #106

mikejiang opened this issue Jun 30, 2020 · 2 comments

Comments

@mikejiang
Copy link
Member

The existing gate extension rationale was detailed in RGLab/flowWorkspace#36, basically it is a heuristic fix for the issue of truncated gate coordinates recorded in flowJo xml workspace. i.e. whenever the negative gate coordinates observed from xml, it's an indication that the gate is meant to extend the far lower end to cover the rest of negative data area.

However, we started to experience some problems where the gate coordinate extension shouldn't be triggered.
e.g.
The exception will be thrown (RGLab/flowWorkspace#334) when attempting to extend ellipsoidGate, which appears to be unnecessary because ellipsoidGate is internally interpolated into polygon thus the coordinates are computed from antipodal points from xml and probably won't have the same truncation issue as the other polygonGates.

So we may want to skip extension for ellipsoidGate.

But the default gate extension behavior won't be even safe for polygonGate. e.g.
This is what the original gate looks like
image
And the gate coordinates do contain negative values

data.frame(gs_pop_get_gate(gs, "B8R+/Live/Q8: CD44- , CD62L-")[[1]]@boundaries, check.names = F)
  Comp-VioBlue-A Comp-BV510-A
1       45.16228     116.7371
2       45.16228      -1.3806
3       59.08485      -1.3806
4       80.12748     116.7371

And the default extend_value=0 threshold will trigger the extension logic, which distorted the original gate and its stats, e.g.
image

@mikejiang
Copy link
Member Author

To investigate this behavior from the relative recent flowJo 10.6.1,
image

The gates seems to be fine without extension(by relaxing the extend_val threshold)
image

So we may conclude the legacy behavior has been fixed(i.e. gate original coordinates are always preserved by xml) by the newer flowJo so that we no longer need to do this hack.

For now, I will set default extend_val = -Inf to disable the logic. Once confirmed with @jspidlen, @jayalmarode about this , we can make this logic conditional on the flowJo wsp version.

@mikejiang
Copy link
Member Author

Looks like it is still needed for the gate that is defined on log scale, even for the latest flowJo
e.g.
image
Without extension, gate includes less cells than it should
image

By extending the gate, the correct stats is restored
image

And we had the legacy flowJo xml that have the live/dead gate defined on biexp scale,e.g.
image
The coordinates are apparently wrong without extension.

So maybe for now, keep the current behavior as it is except skipping extending ellipsoidGate. When things go wrong, we will have to investigate the problem case by case and adjust extend_val as needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant