I am trying to use a custom size factors (computed using the Scran package) in edgeR when doing the workflow for differential expression and get the following error:
d2=estimateDisp(d2,design.mat,mixed.df=T,offset=sce$size_factor)
Error in estimateDisp.default(y = y$counts, design = design, group = group, :
formal argument "offset" matched by multiple actual arguments
Here d2 is the raw counts DGEList and sce$size_factor is the size factors computed by scran for my single cell data. Is this the correct way to use the Scran size factors?
If instead of the above method I load an already Scran normalized counts table and use the default offset and default size factors of 1 then calling the estimate dispersion function, it seems to work. I guess my real question is are these equivalent? My end goal is just to use edgeR differential expression on single cell data with the Scran normalization method.