Question: Differential binding using csaw
gravatar for Amitha Sampath
3.6 years ago by
Amitha Sampath10 wrote:


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.

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"
     Sample1 Sample2 Sample3 Sample4 Sample5 Sample6 Sample7 Sample8 Sample9 Sample10 Sample11

        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?



ADD COMMENTlink modified 3.6 years ago by Aaron Lun25k • written 3.6 years ago by Amitha Sampath10
Answer: Differential binding using csaw
gravatar for Aaron Lun
3.6 years ago by
Aaron Lun25k
Cambridge, United Kingdom
Aaron Lun25k wrote:

You have no counts in your y object, which causes problems for edgeR's internal functions. It's also not normal to get exactly 1 for all libraries from normOffsets. Did you actually have any reads aligned to chromosome 1? Check that the chromosome is named in the BAM file as 'chr1', not '1' or something else.

ADD COMMENTlink written 3.6 years ago by Aaron Lun25k
Please log in to add an answer.


Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 264 users visited in the last hour