Open antagomir opened 1 year ago
Maybe apply.altexp
parameter to transformAssay
?
@Insaynoah Could you check this?
If apply.altexp=TRUE
It might be that you have to move code from lines 235-258 to internal function. Then call that internal function from the transformAssay().
# In input check, check that assays present. --> If apply.altexp was specified, check also assays of altexp --> fail fast
#
x <- .perform_transformation()
if( apply.altexps && length(altExps) > 0 ){
altExps() <- lapply(altExps(), .perform_ransformation()
}
return(x)
.perform_transform <- funciton(){
1. Apply pseudocount
2. Apply transformation
3. return TreeSE with transformed data
}
Thanks @Insaynoah if you have a chance to check it
This is useful and often needed. @ake123 can you check? See the comments above
tse <- agglomerateByRanks(tse)
tse <- transformAssay(tse, method = "relabundance", apply.altexp = TRUE)
Yes. Just one reservation: imo we could allow users to choose which altexps they would like to include. The default could be all (as in apply.altexp=TRUE) but it could also be a subset selection, like apply.altexp=c("counts", "relabundance").
Could it be just a shorter "altexp" instead of "apply.altexp"?
altexp
is ok, so it would be
tse <- transformAssay(tse, method = "relabundance", altexp = c("phylum", "genus"))
Hups, yes.
This is ready I am waiting for the other PR closed then make a PR for this.
Create Function to add given transformation to all altExps / ranks at once, or at least provide an example in OMA/mia.
This is handy also since methods like
agglomerateFeaturesByRank
orsplitByRank
will only deal with count and relabundance assays, and ignore the rest (like CLR, which does translate directly in such operations). Hence there is often a need to add transformations in batch for all altExps after such operations.