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

ODC-184 support split and duplicated dims in gs_add_gating_method(). #262

Open
wants to merge 1 commit into
base: devel
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions R/add_pop.R
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ gs_add_gating_method <- function(gs, alias = "*"
preprocessing_args <- .argDeparser(preprocessing_args)
}

# format split dims & drop duplicated dims
dims <- paste(unique(dims), collapse = ",")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it OK if dims is more than 2-D?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openCyto only supports 1D or 2D gating, but yes it will work with more than two dims.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

dim_count <- length(strsplit(split = ",", dims)[[1]])
if (!dim_count %in% c(1, 2)) {
if (!(dim_count == 0 && gm %in% c("polyFunctions", "boolGate", "refGate"))) {
stop(popName, " has invalid number of dimensions: ", dim_count)
}
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would love for us to support multiple dims (CytoExploreR uses a hacky way to get around this) but the issue is that the gating functions within openCyto don't perform a dims check so we'd need to update all of them to ensure that appropriate dimensions are supplied for each of the supported gating functions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could possibly check the dims against the list of supported gating methods but that will have to be updated every time we add a new gating method.


thisRow <- data.table(alias = alias
, pop = pop
, parent = parent
Expand Down