Hi,
I am using edgeR for 65 pairs Tumor-Normal differential expression genes analysis. I want to get genes that differentially express between Tumor samples and Normal samples. The methods I used are refered to section 4.6 "Pro les of Unrelated Nigerian Individuals" of edgeR User's Guide. But the results are not ideal and that result in interrupted analysis. Could you please help me to check on the R codes? The codes are as follows:
library(Rsubread)
library(limma)
library(edgeR)
library(splines)
Counts <- read.table("readcounts.txt",head=T,row.names=1)
gr <- c("N","T")
group <- rep(gr, times=65)
x <- DGEList(counts=Counts,group=group)
x$samples$lib.size <- colSums(x$counts)
x <- calcNormFactors(x)
Patient <- factor(rep(15:79,each=2)) ####The sample names are "CH15N" "CH15T" "CH16N" "CH16T" ...... "CH79N" "CH79T".
Tissue <- factor(group)
data.frame(Sample=colnames(x),Patient,Tissue)
design <- model.matrix(~Patient+Tissue)
rownames(design) <- colnames(x)
x <- estimateGLMCommonDisp(x, design, verbose=TRUE)
x <- estimateGLMTrendedDisp(x, design)
x <- estimateGLMTagwiseDisp(x, design)
fit <- glmFit(x, design)
lrt <- glmLRT(fit)
write.table(topTags(lrt, n=dim(lrt$table)[1]),file="result.txt",row.names=TRUE,sep="\t")
If there is any mistake or question, please let me know. I look forward to hearing from you.
Thanks!
What do you mean by "not ideal" and "interrupted analysis"? The code itself looks fine.