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

Feature Request: Parsing of BooleanFilters by gh_pop_get_gate/gs_pop_get_gate #360

Open
DillonHammill opened this issue Jun 8, 2021 · 0 comments

Comments

@DillonHammill
Copy link
Contributor

Hi @mikejiang,

The logic stored in booleanFilters (deparse slot) refers to nodes that exist within the GatingHierarchy/GatingSet. When we extract a booleanFilter from a GatingHierarchy/GatingSet we do not get a filter that can be applied to the data because the reference to the gates in the logic is lost (booleanFilters only store names of the gates and not coordinates).

Would it be possible to automatically parse the booleanFilter logic when extracting it from the GatingHierarchy/GatingSet to produce a valid filter? See example below:

library(CytoExploreRData)

# GatingSet
gs <- load_gs(
    system.file(
     "extdata/Activation-GatingSet",
     package = "CytoExploreRData"
    )
)

# Parental population
cs <- gs_pop_get_data(gs, "Single Cells")

# BooleanFilter
bool <- gh_pop_get_gate(gs[[1]], "Live Cells")
bool@deparse # logic - requires 'Dead Cells' gate

# Cannot subset by booleanFilter
Subset(cs, bool)

# Parse logic into valid filter
bool <- !gh_pop_get_gate(gs[[1]], "Dead Cells")
Subset(cs, bool)

It would be great if gh_pop_get_gate/gs_pop_get_gate could extract the required gates by extracting the nodes from bool@deparse and then apply the required operators !|& to produce a valid filter that can be applied to the data.

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