urgent help: meet an error in using edgeR
1
0
Entering edit mode
wang peter ★ 2.0k
@wang-peter-4647
Last seen 10.3 years ago
HELLO all: hope some one can help me on such error. > d <- DGEList(counts = d, lib.size = lib_size) > #normalization > dge <- calcNormFactors(d) > rm(d) > > fac=factor(c('c0h','c0h','c0h','c24h','c24h','c24h','t0h','t0h','t0h ','t6h','t6h','t6h','t6h','t12h','t12h','t12h','t12h','t18h','t18h','t 18h','t18h', + 't24h','t24h','t24h','t36h','t36h','t36h','t48h','t48h' ,'t48h','c6h','c12h','c18h','c36h','c48h')) > design = model.matrix(~fac) > colnames(design) <- levels(fac) > dge <- estimateGLMCommonDisp(dge, design)#??tag wise????????common?? > dge <- estimateGLMTagwiseDisp(dge, design) > glmfit.dge <- glmFit(dge, design, dispersion=dge$tagwise.dispersion)#??????tag wise?? > t0_c0 = makeContrasts("t0h-c0h",levels=design) > lrt.dge <- glmLRT(dge, glmfit.dge, contrast = t0_c0) > result <- topTags(lrt.dge, n=dim(dge)[1], adjust.method="BH", sort.by="p.value") Error in abs(object$table$logFC) : Non-numeric argument to mathematical function R version 2.15.1 (2012-06-22) Platform: x86_64-pc-mingw32/x64 (64-bit) locale: [1] LC_COLLATE=Chinese (Simplified)_People's Republic of China.936 [2] LC_CTYPE=Chinese (Simplified)_People's Republic of China.936 [3] LC_MONETARY=Chinese (Simplified)_People's Republic of China.936 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Simplified)_People's Republic of China.936 attached base packages: [1] stats graphics grDevices utils datasets methods base other attached packages: [1] edgeR_2.6.10 limma_3.12.1 -- shan gao Room 231(Dr.Fei lab) Boyce Thompson Institute Cornell University Tower Road, Ithaca, NY 14853-1801 Office phone: 1-607-254-1267(day) Official email:sg839 at cornell.edu Facebook:http://www.facebook.com/profile.php?id=100001986532253
• 714 views
ADD COMMENT
0
Entering edit mode
@martin-morgan-1513
Last seen 5 months ago
United States
On 08/26/2012 12:52 PM, wang peter wrote: >> d <- DGEList(counts = d, lib.size = lib_size) >> >#normalization >> >dge <- calcNormFactors(d) >> >rm(d) >> > >> >fac=factor(c('c0h','c0h','c0h','c24h','c24h','c24h','t0h','t0h','t 0h','t6h','t6h','t6h','t6h','t12h','t12h','t12h','t12h','t18h','t18h', 't18h','t18h', > + 't24h','t24h','t24h','t36h','t36h','t36h','t48h','t48 h','t48h','c6h','c12h','c18h','c36h','c48h')) >> >design = model.matrix(~fac) >> >colnames(design) <- levels(fac) >> >dge <- estimateGLMCommonDisp(dge, design)#??tag wise????????common?? >> >dge <- estimateGLMTagwiseDisp(dge, design) >> >glmfit.dge <- glmFit(dge, design, dispersion=dge$tagwise.dispersion)#??????tag wise?? >> >t0_c0 = makeContrasts("t0h-c0h",levels=design) >> >lrt.dge <- glmLRT(dge, glmfit.dge, contrast = t0_c0) provide the _vector_ rather than matrix to contrast lrt.dge <- glmLRT(dge, glmfit.dge, contrast = t0_c0[,1]) (this is a subtle issue in glmLRT, where with contrast as a matrix argument, in tab <- data.frame(logFC = logFC, logCPM = (glmfit$abundance + log(1e+06))/log(2), LR = LR, PValue = LRT.pvalue, row.names = rn) logFC is also a matrix and 'tab' has first column named after the matrix column, rather than 'logFC'). Martin >> >result <- topTags(lrt.dge, n=dim(dge)[1], adjust.method="BH", sort.by="p.value") -- Computational Biology / Fred Hutchinson Cancer Research Center 1100 Fairview Ave. N. PO Box 19024 Seattle, WA 98109 Location: Arnold Building M1 B861 Phone: (206) 667-2793
ADD COMMENT

Login before adding your answer.

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