-
Notifications
You must be signed in to change notification settings - Fork 27
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
Batch transformations. #429 #618
base: devel
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is too complex, instead you could consider own method for SingleCellExperiment. Something like this
SCE_method <- function(x, altexp = altExpNames(tse), ...){
# Check that specified altexps are found from x
# Check that assay.type are found from specified altexps
lapply(altExps(x)[altexp], .check_assay_present)
# Apply transformation to x
x <- .perform_transformation(x)
# If altexp is not NULL, apply transformation to altexps
altExps(x)[altexp] <- bplapply(altExps(x)[altexp], ...)
}
SE_method <- function(){
# Input checks
# Apply transformation
x <- .perform_transformation(x)
}
I agree that direct support for SCE is probably the way to go when altExps are supported. This in the above example mixes concepts: |
Yep, I fixed the comment |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #618 +/- ##
========================================
Coverage ? 67.50%
========================================
Files ? 44
Lines ? 5364
Branches ? 0
========================================
Hits ? 3621
Misses ? 1743
Partials ? 0 ☔ View full report in Codecov by Sentry. |
Status of this one? |
rewriting and debugging it as suggested |
Can you revert the already made modifications? Something like this creates a good start point
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you still add unit tests, that altexp works as expected?
R/transformCounts.R
Outdated
#' #using altexp parameter | ||
#' data("GlobalPatterns", package="mia") | ||
#' tse <- GlobalPatterns | ||
#' altExp(tse,"species") <- transformAssay(tse, method = "relabundance",rank = "species", na.rm = FALSE) | ||
#' altExp(tse,"species") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add space after #
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the changes, see those
R/transformCounts.R
Outdated
#' #using altexp parameter | ||
#' data("GlobalPatterns", package="mia") | ||
#' tse <- GlobalPatterns | ||
#' altExp(tse,"species") <- transformAssay(tse, method = "relabundance",rank = "species", na.rm = FALSE) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no rank parameter in transformAssay()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the changes
R/transformCounts.R
Outdated
ref_vals = NA, ...){ | ||
# Input check | ||
# Check reference | ||
if( length(reference) != 1 ){ | ||
stop("'reference' must be a single value specifying the ", | ||
"values of the reference sample.", | ||
call. = FALSE) | ||
ref_vals = NA, ...) { | ||
# Ensure that the matrix has proper dimnames | ||
if (is.null(rownames(mat))) { | ||
rownames(mat) <- paste0("feature", seq_len(nrow(mat))) | ||
} | ||
# Input check end | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this was removed?
Batch transformations. #429