Differential binding using csaw
1
0
Entering edit mode
@amitha-sampath-10057
Last seen 7.5 years ago
India

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

csaw differential binding analysis chipseq differential expression differential gene expression • 1.6k views
ADD COMMENT
1
Entering edit mode
Aaron Lun ★ 28k
@alun
Last seen 2 hours ago
The city by the bay

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 COMMENT

Login before adding your answer.

Traffic: 435 users visited in the last hour
Help About
FAQ
Access RSS
API
Stats

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.

Powered by the version 2.3.6