3.4 years ago by
You can calculate an alternative size factor vector
sf yourself and supply this like so, before calling DESeq():
stopifnot(all(sf > 0))
sf <- sf / exp(mean(log(sf))
sizeFactors(dds) <- sf
The second line is to make sure that the size factors are roughly centered around 1 (so that the mean of normalized counts is similar in scale to the mean of raw counts).
You could define your own size factor vector using some external software, or you could take e.g. an upper quantile of the columns of the count matrix.
Another option is to use
type="iterate" in estimateSizeFactors(), which is an alternate size factor estimator we developed that does not require that there be rows without a zero.
I don't have any advice as to what is the best size factor estimator for microbiome data though. You could try the estimator implemented in metagenomeSeq: