I used csaw package which is based on edgeR's statistical method. So I need to have a design matrix. The user guide gives an example of analysing 2 groups as below:
bam.files <- c("es_1.bam", "es_2.bam", "tn_1.bam", "tn_2.bam")
design <- model.matrix(~factor(c('es', 'es', 'tn', 'tn')))
colnames(design) <- c("intercept", "cell.type")
However, I want to analysis 3 groups, so below is how I set the design matrix:
bam.files <- c("heart.bam", "liver.bam", "muscle.bam")
design <- model.matrix(~factor(c('heart', 'liver', 'muscle')))
colnames(design) <- c("intercept1","intercept2", "cell.type")
Then I tried to find differentially bind regions:
y <- asDGEList(filtered.data)
y <- estimateDisp(y, design)
And I got error:
**Warning message:
In estimateDisp.default(y = y$counts, design = design, group = group, :
No residual df: setting dispersion to NA**
Any advices would be greatly appreciated!!
Thanks! This helps! Will search before ask questions next time!