Search
Question: Differential binding using csaw
0
gravatar for Amitha Sampath
19 months ago by
India
Amitha Sampath10 wrote:

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

ADD COMMENTlink modified 19 months ago by Aaron Lun17k • written 19 months ago by Amitha Sampath10
1
gravatar for Aaron Lun
19 months ago by
Aaron Lun17k
Cambridge, United Kingdom
Aaron Lun17k 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 19 months ago by Aaron Lun17k
Please log in to add an answer.

Help
Access

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