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

Conversation

djhammill
Copy link
Contributor

@amcdavid adding PR here to implement features or fixes required by CytoExploreR please see https://ozette.atlassian.net/jira/software/c/projects/ODC/issues/ODC-184

This PR just makes it easier for users to interact with the gs_add_gating_method() API which currently expects dims to be supplied in a concatenated comma-separated string (i.e. "FSC-A,SSC-A") rather than the conventional c("FSC-A", "SSC-A") - both inputs will be supported after this change.

@djhammill djhammill self-assigned this Nov 5, 2024
@@ -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.

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

Successfully merging this pull request may close these issues.

2 participants