# HG changeset patch # User fubar # Date 1393390499 18000 # Node ID 4a2e7a9725b20b0f81b5d3230b40fad34845914e # Parent 2a377f98ab76cc2785cf4b5356f62c350f72272f Uploaded diff -r 2a377f98ab76 -r 4a2e7a9725b2 rgedgeRpaired_nocamera.xml --- a/rgedgeRpaired_nocamera.xml Tue Feb 25 23:54:15 2014 -0500 +++ b/rgedgeRpaired_nocamera.xml Tue Feb 25 23:54:59 2014 -0500 @@ -1,10 +1,10 @@ - + models using BioConductor packages biocbasics r302 graphicsmagick - ghostscript + ghostscript @@ -50,9 +50,16 @@ - + + + + + + @@ -159,6 +166,7 @@ + @@ -174,6 +182,7 @@ 0) { - print.noquote(paste("prior.df =",edgeR_priordf)) - DGEList = estimateGLMTagwiseDisp(DGEList,mydesign,prior.df = edgeR_priordf) - } else { - DGEList = estimateGLMTagwiseDisp(DGEList,mydesign) + comdisp = DGEList\$common.dispersion + estpriorn = getPriorN(DGEList) + print(paste("Common Dispersion =",comdisp,"CV = ",sqrt(comdisp),"getPriorN = ",estpriorn),quote=F) + } else { + DGEList = estimateGLMRobustDisp(DGEList,design=mydesign, prior.df = edgeR_priordf, maxit = 6, residual.type = robust_meth) + } } DGLM = glmFit(DGEList,design=mydesign) DE = glmLRT(DGLM,coef=ncol(DGLM\$design)) # always last one - subject is first if needed @@ -625,8 +636,6 @@ abline(0,1,lwd=3) points(qq\$x[goodness\$outlier],qq\$y[goodness\$outlier], pch=16, col="maroon") dev.off() - estpriorn = getPriorN(DGEList) - print(paste("Common Dispersion =",comdisp,"CV = ",sqrt(comdisp),"getPriorN = ",estpriorn),quote=F) efflib = DGEList\$samples\$lib.size*DGEList\$samples\$norm.factors normData = (1e+06*DGEList\$counts/efflib) uniqueg = unique(group) @@ -697,7 +706,7 @@ #newCountDataSet(workCM, group) deSeqDatsizefac = estimateSizeFactors(deSEQds) deSeqDatdisp = estimateDispersions(deSeqDatsizefac,fitType=DESeq_fitType) - resDESeq = nbinomWaldTest(deSeqDatdisp) + resDESeq = nbinomWaldTest(deSeqDatdisp, pAdjustMethod=fdrtype) rDESeq = as.data.frame(results(resDESeq)) rDESeq = cbind(Contig=rownames(workCM),rDESeq,NReads=cmrowsums,URL=contigurls) srDESeq = rDESeq[order(rDESeq\$pvalue),] @@ -744,13 +753,11 @@ if (doedgeR == F) { #### Setup DGEList object DGEList = DGEList(counts=workCM, group = group) - DGEList = calcNormFactors(DGEList) DGEList = estimateGLMCommonDisp(DGEList,mydesign) DGEList = estimateGLMTrendedDisp(DGEList,mydesign) DGEList = estimateGLMTagwiseDisp(DGEList,mydesign) - DGEList = estimateGLMTagwiseDisp(DGEList,mydesign) - norm.factor = DGEList\$samples\$norm.factors } + norm.factor = calcNormFactors(DGEList) pdf("VOOM_mean_variance_plot.pdf") dat.voomed = voom(DGEList, mydesign, plot = TRUE, lib.size = colSums(workCM) * norm.factor) dev.off() @@ -810,11 +817,12 @@ out_edgeR = F out_DESeq2 = F out_VOOM = "$out_VOOM" +edgeR_robust_meth = $edgeR_robust # control robust deviance options doDESeq2 = $DESeq2.doDESeq2 # make these T or F doVoom = $doVoom doCamera = F doedgeR = $edgeR.doedgeR -edgeR_priordf = 0 +edgeR_priordf = 10 #if $doVoom == "T": @@ -886,7 +894,7 @@ fdrtype='BH',mydesign=NULL,priordf=edgeR_priordf,fdrthresh=fdrthresh,outputdir='.', myTitle=myTitle,useNDF=F,libSize=c(),filterquantile=fQ,subjects=subjects, doDESeq2=doDESeq2,doVoom=doVoom,doCamera=doCamera,doedgeR=doedgeR,org=org, - histgmt=history_gmt,bigmt=builtin_gmt,DESeq_fitType=DESeq_fitType) + histgmt=history_gmt,bigmt=builtin_gmt,DESeq_fitType=DESeq_fitType,robustmeth=edgeR_robust_meth) sessionInfo() ]]>