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

Improve sweep for multiple assays? #192

Open
cvanderaa opened this issue Aug 25, 2023 · 0 comments
Open

Improve sweep for multiple assays? #192

cvanderaa opened this issue Aug 25, 2023 · 0 comments

Comments

@cvanderaa
Copy link
Collaborator

During a discussion with Sam, we were wondering whether we could improve sweep(). The discussion only applies when sweeping multiple assays. Consider the following example:

data("feat2")
stats <- c(1.2, 2.1, 3, 4.5)
sfeat2 <- sweep(
        feat2, MARGIN = 2, STATS = stats, i = 1:3, 
        name = paste0(names(feat2), "_sweep")
    )

This example divides all columns by arbitrary numbers, but these numbers are the same for all 3 assays. I don't see a reason in practice that a user wants to divide (or any other operation) their column by numbers that are shared across assays. Sam and I are mostly using sweep() to perform some sort of normalization (cf #79) where we want to divide or subtract the columns (or rows) by a column (or row) statistic, eg mean or median. The function does not allow for this.

I see two actions we could take:

  1. We do not allow sweep on multiple assays, but this would limit the use cases for sweep.
  2. The STATS argument should take a list of numeric vectors with as many elements as the length of i. This, however, increases the complexity of the user experience
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