I'm here to ask for your kind helps. I'm currently working on DEG analysis. briefly, I want to compare DEG differences between (P07_T01-P07_N01 & P08_T01-P08_N01) vs (P07_T02& P08_T02). This is to compare T01's solely with T02's.
Yet, there are 2 problems.
First, I keep getting an error from y <- estimateGLMCommonDisp(y, design) statement. the error contet is below.
Error in dispCoxReid(y, design = design, offset = offset, subset = subset, : no data rows with required number of counts In addition: Warning message: In matrix(x, dim, dim, byrow = TRUE) : data length exceeds size of matrix
** It's weird cause, the next statement works without any problems. (y <- estimateGLMTrendedDisp(y, design))
The second problem is that I'd like to adjust my glmLRT statement using contrast to make (P07_T01-P07_N01 & P08_T01-P08_N01) vs (P07_T02& P08_T02) and I don't know how to. I'll attach my code below. It would be really nice if you can give me any advice. Big thanks in advance.
> #round up > trimmed_RNA<-round(RNA_count, 0) > trimmed_RNA<-subset(trimmed_RNA) > final_RNA<-cbind(P07_N01_RNA.genes$V1, trimmed_RNA) > colnames(final_RNA) = c("geneID", "p07_N01", "p07_T01","p08_N01", "p08_T01", "p07_T02", "p08_T02") > > #Data setting > c_data <- final_RNA[,2:7] > rownames(c_data) <- final_RNA[,1] > y <- DGEList(counts=c_data, genes=final_RNA[,1], group=matrix ) > y <- calcNormFactors(y) > plotMDS(y) > > # 2.3 filtering > countsPerMillion <- cpm(y) > countCheck <- countsPerMillion > 1 > keep <- which(rowSums(countCheck) >= 10) > y <- y[keep,] > > # 2.4 Normalization > y <- calcNormFactors(y, method="TMM") > > #creating group factor and Setting up the Model > matrix <- factor(c("NM","CC","NM", "CC", "LC", "LC")) > group <- c("NM","CC","NM", "CC", "LC", "LC") > data.frame(sample =colnames(y), matrix) > status=factor(c("Normal", "Cancer", "Normal", "Cancer", "Cancer", "Cancer")) > design <- model.matrix(~group+group:status) > > matrix <- factor(c("NM","CC","NM", "CC", "LC", "LC")) > data.frame(sample =colnames(y),matrix) > design <-model.matrix(~0+matrix) > > #Setting up the Model > rownames(design) = colnames(y) > #estimating Dispersions > y <- estimateGLMCommonDisp(y, design) > y <- estimateGLMTrendedDisp(y, design) > plotBCV(y) > #Fitting and Making Comparisons > fit <- glmFit(y,design) > lrt <- glmLRT(fit, coef=2) > top4<-topTags(lrt, n=Inf) > table <- top4$table