As far as I could find out, this code will log2 transform data.
I was wondering if there is any option to specify log transformation to another log base, particularly natural log?
Or would it be possible to reverse log2 transformation after the normalization and then manually transform to natural log?
Sure, technically it is possible by using log=FALSE and then transform the normalized counts using any method you want. See ?scuttle::logNormCounts on log option.
By the way, GitHub issues are mainly for bug reports and feature requests, maybe consider to ask in a forum first, and not opening issues, at least not right away. Just a suggestion. For technical questions that require the package developers expertise the support forum at support.bioconductor.org is a good place to ask.
Edit: I quote here the answer from Aaron Lun from the GitHub issue:
Internally, if pseudo.count=1, the logNormCounts() function will use log1p. This has the advantage of preserving sparsity compared to the naive log(x + 1) method, which goes through a non-sparse intermediate x + 1. For all other settings of pseudo.count, we go through the usual log(x + pseudo.count), because we're going to lose sparsity anyway.
Now, log(x + 1) is a natural log, so we divide the result by log(2) to
obtain log2-transformed values. One could just as easily undo that
division outside of the function, or change the base as desired. It's
just a division so it's pretty cheap.
It uses the either the size factors from the deconvolution method (computeSumFactors) if these are present in the SingleCellExperiment or (if not present) then normalizes based on library size alone.
In any case, this normalization is done first, and then the log transformation is being applied if log=TRUE.
Thanks for your prompt response!
So if I set log=FALSE, the code would normalize the data but not log-transform, yet. Then I can log-transform it manually afterwards? Is that correct?
And thanks for your advice regarding GitHub!
Yes, that is my understanding of the function.
It uses the either the size factors from the deconvolution method (computeSumFactors) if these are present in the SingleCellExperiment or (if not present) then normalizes based on library size alone. In any case, this normalization is done first, and then the log transformation is being applied if
log=TRUE
.