Hi,
I currently working with the package csaw to analyze differentially bound sites. Everything works fine until "estimateDisp". Please can someone help me identify the cause of the error.
library(csaw)
library(limma)
library(edgeR)
all <- list.files(pattern="^H3K27me3_.*.bam$")
bam.files <- c(all)
frag.len <- 150
window.width <- 10
spacing <- 50
param <- readParam(restrict = "chr1")
data <- windowCounts(bam.files, ext=frag.len, width = window.width, spacing=spacing, param=param)
binned <- windowCounts(bam.files, bin=TRUE, width=10000, param=param)
normfacs <- normOffsets(binned)
grouping <- factor(c('TFO','TFO','TFO','TFO','TFO','TFO','TFY','TFY','TFY','TFY','TFY'))
design <- model.matrix(~0 + grouping)
colnames(design) <- levels(grouping)
y <- asDGEList(data, norm.factors=normfacs)
y <- estimateDisp(y, design)
So the code works fine until the last command estimateDisp. Below is the output from asDGEList and estimateDisp
>y <- asDGEList(data, norm.factors=normfacs)
> y
An object of class "DGEList"
$counts
Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 Sample7 Sample8 Sample9 Sample10 Sample11
$samples
group lib.size norm.factors
Sample1 1 0 1
Sample2 1 0 1
Sample3 1 0 1
Sample4 1 0 1
Sample5 1 0 1
6 more rows ...
> y <- estimateDisp(y, design)
Error in solve.default(designunique, t(mu1)) : no right-hand side in 'b'
In addition: Warning message:
In matrix(x, dim[1], dim[2], byrow = TRUE) :
data length exceeds size of matrix
Also, normOffsets returns 1 for all of my 11 samples. Is this normal?
Regards,
Amitha