EdgeR problem: glmLRT contrast (compare group with processed/extracted group)
1
0
Entering edit mode
4.9 years ago
97sun3 ▴ 10

Hello, experts.

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[1], dim[2], 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
RNA-Seq R • 2.8k views
ADD COMMENT
1
Entering edit mode
4.9 years ago
97sun3 ▴ 10
y <- estimateDistp(y, design)

also doesn't work. I have an error message saying,

Error in estimateDisp.default(y = y$counts, design = design, group = group, : object 'prior.n' not found

ADD COMMENT
0
Entering edit mode

I'm having this exact same issue following tutorial from: https://www.sc-best-practices.org/conditions/differential_gene_expression.html#pseudobulk

ADD REPLY

Login before adding your answer.

Traffic: 2333 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