-2

I have a problem when I try estimate dispersion that affects downstream analysis.

#DGEList object

obj<- DGEList(matrix, group=Sample)

#DESIGN MATRIX

design <- model.matrix(~0+Sample)

In my bulk analysis the design matrix is this:

  Sample1 Sample2 Sample3 Sample4
1   1   0   0   0
2   0   1   0   0
3   0   0   1   0
4   0   0   0   1

#DISPERSION ESTIMATION

`obj <- estimateDisp(obj, design, robust=TRUE)`
obj$common.dispersion

Warning message in estimateDisp.default(y = y$counts, design = design, group = group, : “No residual df: setting dispersion to NA”

str(obj)
plotBCV(obj)
Error in xy.coords(x, y, xlabel, ylabel, log): 'x' and 'y' lengths differ
Traceback:

1. plotBCV(obj)
2. plot(A, sqrt(disp), xlab = xlab, ylab = ylab, type = "n", ...)
3. plot.default(A, sqrt(disp), xlab = xlab, ylab = ylab, type = "n", 
 .     ...)
4. xy.coords(x, y, xlabel, ylabel, log)
5. stop("'x' and 'y' lengths differ")

Is there other manner to estimate dispersion?

Ian Campbell
  • 23,484
  • 14
  • 36
  • 57
ASN
  • 1
  • 1
    It is rather a statistical problem than a programming issue. We could provide some help however you provide no context, no example of design matrix. Please improvde your post. – Basti Aug 04 '23 at 09:29
  • 1
    Based on your design matrix, you have no replicates in each group : most statistical methods cannot perform differential expression analysis, including the one you are trying to apply – Basti Aug 04 '23 at 10:00

0 Answers0