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

Extend transform method to support gate objects #258

Open
wants to merge 5 commits into
base: devel
Choose a base branch
from

Conversation

djhammill
Copy link

@djhammill djhammill commented Oct 12, 2023

@mikejiang, this PR extends the existing transform method for flowFrame and flowSet objects to cover gate objects (rectangleGate, polygonGate, ellipsoidGate, quadGate and filters) as well. This change makes it easy to convert gate objects between the linear and transformed scales to match the scales of the data.

Transformations are applied in place so that any gate attributes remain attached.

For ellipsoidGates, we can't maintain the geometry of the ellipse with transformation so instead we convert it to a polygonGate and then apply the transformers to those co-ordinates - returning a polygonGate instead of a transformed ellipsoidGate.

I also found a bug with the parameters of ellipsoidGates - it returns a named vector unlike the parameters of other gate types which are unnamed. This means that if you try to combine ellipses with other gate types in the same set of dimensions into a filters object, the validFilters check throws an error when it shouldn't. I fixed this in the ellipsoidGate constructor by making sure the parameters stored without names.

I haven't added support for multiRangeGate as they are only currently supported for Time channel which should never be transformed. I can add support multiRangeGate later if required.

I rendered the docs for multiRangeGate and added some additional tests to the testthat suite to make sure the gates are transformed appropriately.

@djhammill
Copy link
Author

Added a minor change to transformList constructor to automatically pull out the channel names from the list of transformations functions if supplied.

inv_trans <- gh_pop_get_transformations(gs[[1]], inverse = TRUE)
transformList(tfun = inv_trans)

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

Successfully merging this pull request may close these issues.

1 participant