annotate rgedgeRpaired_nocamera.xml @ 149:3107df74056e draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
author iuc
date Mon, 04 May 2015 22:47:36 -0400
parents 474c08e747b6
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1 <?xml version="1.0"?>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
2 <tool id="rgdifferentialcount" name="Differential_Count" version="0.28">
474c08e747b6 Uploaded
iuc
parents:
diff changeset
3 <description>models using BioConductor packages</description>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
4 <requirements>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
5 <requirement type="package" version="3.1.2">R</requirement>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
6 <requirement type="package" version="1.3.18">graphicsmagick</requirement>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
7 <requirement type="package" version="9.10">ghostscript</requirement>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
8 <requirement type="package" version="2.14">biocbasics</requirement>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
9 </requirements>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
10 <stdio>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
11 <exit_code range="4" level="fatal" description="Number of subject ids must match total number of samples in the input matrix"/>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
12 </stdio>
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
13 <command interpreter="python">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
14 rgToolFactory.py --script_path "$runme" --interpreter "Rscript" --tool_name "Differential_Counts"
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
15 --output_dir "$html_file.files_path" --output_html "$html_file" --make_HTML "yes"
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
16 </command>
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
17 <configfiles>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
18 <configfile name="runme"><![CDATA[
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
19 #
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
20 # edgeR.Rscript
474c08e747b6 Uploaded
iuc
parents:
diff changeset
21 # updated feb 2014 adding outlier-robust deviance estimate options by ross for R 3.0.2/bioc 2.13
474c08e747b6 Uploaded
iuc
parents:
diff changeset
22 # updated npv 2011 for R 2.14.0 and edgeR 2.4.0 by ross
474c08e747b6 Uploaded
iuc
parents:
diff changeset
23 # Performs DGE on a count table containing n replicates of two conditions
474c08e747b6 Uploaded
iuc
parents:
diff changeset
24 #
474c08e747b6 Uploaded
iuc
parents:
diff changeset
25 # Parameters
474c08e747b6 Uploaded
iuc
parents:
diff changeset
26 #
474c08e747b6 Uploaded
iuc
parents:
diff changeset
27 # 1 - Output Dir
474c08e747b6 Uploaded
iuc
parents:
diff changeset
28
474c08e747b6 Uploaded
iuc
parents:
diff changeset
29 # Original edgeR code by: S.Lunke and A.Kaspi
474c08e747b6 Uploaded
iuc
parents:
diff changeset
30 reallybig = log10(.Machine\$double.xmax)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
31 reallysmall = log10(.Machine\$double.xmin)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
32 library("gplots")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
33 library("edgeR")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
34 library('stringr')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
35 hmap2 = function(cmat,nsamp=100,outpdfname='heatmap2.pdf', TName='Treatment',group=NA,myTitle='title goes here')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
36 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
37 # Perform clustering for significant pvalues after controlling FWER
474c08e747b6 Uploaded
iuc
parents:
diff changeset
38 samples = colnames(cmat)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
39 gu = unique(group)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
40 gn = rownames(cmat)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
41 if (length(gu) == 2) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
42 col.map = function(g) {if (g==gu[1]) "#FF0000" else "#0000FF"}
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
43 pcols = unlist(lapply(group,col.map))
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
44 } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
45 colours = rainbow(length(gu),start=0,end=4/6)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
46 pcols = colours[match(group,gu)] }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
47 dm = cmat[(! is.na(gn)),]
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
48 # remove unlabelled hm rows
474c08e747b6 Uploaded
iuc
parents:
diff changeset
49 nprobes = nrow(dm)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
50 # sub = paste('Showing',nprobes,'contigs ranked for evidence of differential abundance')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
51 if (nprobes > nsamp) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
52 dm =dm[1:nsamp,]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
53 #sub = paste('Showing',nsamp,'contigs ranked for evidence for differential abundance out of',nprobes,'total')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
54 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
55 newcolnames = substr(colnames(dm),1,20)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
56 colnames(dm) = newcolnames
474c08e747b6 Uploaded
iuc
parents:
diff changeset
57 pdf(outpdfname)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
58 heatmap.2(dm,main=myTitle,ColSideColors=pcols,col=topo.colors(100),dendrogram="col",key=T,density.info='none',
474c08e747b6 Uploaded
iuc
parents:
diff changeset
59 Rowv=F,scale='row',trace='none',margins=c(8,8),cexRow=0.4,cexCol=0.5)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
60 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
61 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
62
474c08e747b6 Uploaded
iuc
parents:
diff changeset
63 hmap = function(cmat,nmeans=4,outpdfname="heatMap.pdf",nsamp=250,TName='Treatment',group=NA,myTitle="Title goes here")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
64 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
65 # for 2 groups only was
474c08e747b6 Uploaded
iuc
parents:
diff changeset
66 #col.map = function(g) {if (g==TName) "#FF0000" else "#0000FF"}
474c08e747b6 Uploaded
iuc
parents:
diff changeset
67 #pcols = unlist(lapply(group,col.map))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
68 gu = unique(group)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
69 colours = rainbow(length(gu),start=0.3,end=0.6)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
70 pcols = colours[match(group,gu)]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
71 nrows = nrow(cmat)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
72 mtitle = paste(myTitle,'Heatmap: n contigs =',nrows)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
73 if (nrows > nsamp) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
74 cmat = cmat[c(1:nsamp),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
75 mtitle = paste('Heatmap: Top ',nsamp,' DE contigs (of ',nrows,')',sep='')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
76 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
77 newcolnames = substr(colnames(cmat),1,20)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
78 colnames(cmat) = newcolnames
474c08e747b6 Uploaded
iuc
parents:
diff changeset
79 pdf(outpdfname)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
80 heatmap(cmat,scale='row',main=mtitle,cexRow=0.3,cexCol=0.4,Rowv=NA,ColSideColors=pcols)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
81 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
82 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
83
474c08e747b6 Uploaded
iuc
parents:
diff changeset
84 qqPlot = function(descr='qqplot',pvector, outpdf='qqplot.pdf',...)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
85 # stolen from https://gist.github.com/703512
474c08e747b6 Uploaded
iuc
parents:
diff changeset
86 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
87 o = -log10(sort(pvector,decreasing=F))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
88 e = -log10( 1:length(o)/length(o) )
474c08e747b6 Uploaded
iuc
parents:
diff changeset
89 o[o==-Inf] = reallysmall
474c08e747b6 Uploaded
iuc
parents:
diff changeset
90 o[o==Inf] = reallybig
474c08e747b6 Uploaded
iuc
parents:
diff changeset
91 maint = descr
474c08e747b6 Uploaded
iuc
parents:
diff changeset
92 pdf(outpdf)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
93 plot(e,o,pch=19,cex=1, main=maint, ...,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
94 xlab=expression(Expected~~-log[10](italic(p))),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
95 ylab=expression(Observed~~-log[10](italic(p))),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
96 xlim=c(0,max(e)), ylim=c(0,max(o)))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
97 lines(e,e,col="red")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
98 grid(col = "lightgray", lty = "dotted")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
99 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
100 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
101
474c08e747b6 Uploaded
iuc
parents:
diff changeset
102 smearPlot = function(myDGEList,deTags, outSmear, outMain)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
103 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
104 pdf(outSmear)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
105 plotSmear(myDGEList,de.tags=deTags,main=outMain)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
106 grid(col="lightgray", lty="dotted")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
107 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
108 }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
109
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
110 boxPlot = function(rawrs,cleanrs,maint,myTitle,pdfname)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
111 {
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
112 nc = ncol(rawrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
113 ##### for (i in c(1:nc)) {rawrs[(rawrs[,i] < 0),i] = NA}
474c08e747b6 Uploaded
iuc
parents:
diff changeset
114 fullnames = colnames(rawrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
115 newcolnames = substr(colnames(rawrs),1,20)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
116 colnames(rawrs) = newcolnames
474c08e747b6 Uploaded
iuc
parents:
diff changeset
117 newcolnames = substr(colnames(cleanrs),1,20)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
118 colnames(cleanrs) = newcolnames
474c08e747b6 Uploaded
iuc
parents:
diff changeset
119 defpar = par(no.readonly=T)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
120 print.noquote('@@@ Raw contig counts by sample:')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
121 print.noquote(summary(rawrs))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
122 print.noquote('@@@ Library size contig counts by sample:')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
123 print.noquote(summary(cleanrs))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
124 pdf(pdfname)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
125 par(mfrow=c(1,2))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
126 boxplot(rawrs,varwidth=T,notch=T,ylab='log contig count',col="maroon",las=3,cex.axis=0.35,main='log2 raw counts')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
127 grid(col="lightgray",lty="dotted")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
128 boxplot(cleanrs,varwidth=T,notch=T,ylab='log contig count',col="maroon",las=3,cex.axis=0.35,main=paste('log2 counts after ',maint))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
129 grid(col="lightgray",lty="dotted")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
130 dev.off()
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
131 pdfname = "sample_counts_histogram.pdf"
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
132 nc = ncol(rawrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
133 print.noquote(paste('Using ncol rawrs=',nc))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
134 ncroot = round(sqrt(nc))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
135 if (ncroot*ncroot < nc) { ncroot = ncroot + 1 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
136 m = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
137 for (i in c(1:nc)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
138 rhist = hist(rawrs[,i],breaks=100,plot=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
139 m = append(m,max(rhist\$counts))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
140 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
141 ymax = max(m)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
142 ncols = length(fullnames)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
143 if (ncols > 20)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
144 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
145 scale = 7*ncols/20
474c08e747b6 Uploaded
iuc
parents:
diff changeset
146 pdf(pdfname,width=scale,height=scale)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
147 } else {
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
148 pdf(pdfname)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
149 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
150 par(mfrow=c(ncroot,ncroot))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
151 for (i in c(1:nc)) {
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
152 hist(rawrs[,i], main=paste("Contig logcount",i), xlab='log raw count', col="maroon",
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
153 breaks=100,sub=fullnames[i],cex=0.8,ylim=c(0,ymax))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
154 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
155 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
156 par(defpar)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
157
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
158 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
159
474c08e747b6 Uploaded
iuc
parents:
diff changeset
160 cumPlot = function(rawrs,cleanrs,maint,myTitle)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
161 { # updated to use ecdf
474c08e747b6 Uploaded
iuc
parents:
diff changeset
162 pdfname = "Differential_rowsum_bar_charts.pdf"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
163 defpar = par(no.readonly=T)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
164 lrs = log(rawrs,10)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
165 lim = max(lrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
166 pdf(pdfname)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
167 par(mfrow=c(2,1))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
168 hist(lrs,breaks=100,main=paste('Before:',maint),xlab="# Reads (log)",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
169 ylab="Count",col="maroon",sub=myTitle, xlim=c(0,lim),las=1)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
170 grid(col="lightgray", lty="dotted")
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
171 lrs = log(cleanrs,10)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
172 hist(lrs,breaks=100,main=paste('After:',maint),xlab="# Reads (log)",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
173 ylab="Count",col="maroon",sub=myTitle,xlim=c(0,lim),las=1)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
174 grid(col="lightgray", lty="dotted")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
175 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
176 par(defpar)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
177 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
178
474c08e747b6 Uploaded
iuc
parents:
diff changeset
179 cumPlot1 = function(rawrs,cleanrs,maint,myTitle)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
180 { # updated to use ecdf
474c08e747b6 Uploaded
iuc
parents:
diff changeset
181 pdfname = paste(gsub(" ","", myTitle , fixed=TRUE),"RowsumCum.pdf",sep='_')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
182 pdf(pdfname)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
183 par(mfrow=c(2,1))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
184 lastx = max(rawrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
185 rawe = knots(ecdf(rawrs))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
186 cleane = knots(ecdf(cleanrs))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
187 cy = 1:length(cleane)/length(cleane)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
188 ry = 1:length(rawe)/length(rawe)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
189 plot(rawe,ry,type='l',main=paste('Before',maint),xlab="Log Contig Total Reads",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
190 ylab="Cumulative proportion",col="maroon",log='x',xlim=c(1,lastx),sub=myTitle)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
191 grid(col="blue")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
192 plot(cleane,cy,type='l',main=paste('After',maint),xlab="Log Contig Total Reads",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
193 ylab="Cumulative proportion",col="maroon",log='x',xlim=c(1,lastx),sub=myTitle)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
194 grid(col="blue")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
195 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
196 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
197
474c08e747b6 Uploaded
iuc
parents:
diff changeset
198
474c08e747b6 Uploaded
iuc
parents:
diff changeset
199
474c08e747b6 Uploaded
iuc
parents:
diff changeset
200 doGSEAold = function(y=NULL,design=NULL,histgmt="",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
201 bigmt="/data/genomes/gsea/3.1/Abetterchoice_nocgp_c2_c3_c5_symbols_all.gmt",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
202 ntest=0, myTitle="myTitle", outfname="GSEA.xls", minnin=5, maxnin=2000,fdrthresh=0.05,fdrtype="BH")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
203 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
204 sink('Camera.log')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
205 genesets = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
206 if (bigmt > "")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
207 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
208 bigenesets = readLines(bigmt)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
209 genesets = bigenesets
474c08e747b6 Uploaded
iuc
parents:
diff changeset
210 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
211 if (histgmt > "")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
212 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
213 hgenesets = readLines(histgmt)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
214 if (bigmt > "") {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
215 genesets = rbind(genesets,hgenesets)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
216 } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
217 genesets = hgenesets
474c08e747b6 Uploaded
iuc
parents:
diff changeset
218 } # use only history if no bi
474c08e747b6 Uploaded
iuc
parents:
diff changeset
219 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
220 print.noquote(paste("@@@read",length(genesets), 'genesets from',histgmt,bigmt))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
221 genesets = strsplit(genesets,'\t') # tabular. genesetid\tURLorwhatever\tgene_1\t..\tgene_n
474c08e747b6 Uploaded
iuc
parents:
diff changeset
222 outf = outfname
474c08e747b6 Uploaded
iuc
parents:
diff changeset
223 head=paste(myTitle,'edgeR GSEA')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
224 write(head,file=outfname,append=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
225 ntest=length(genesets)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
226 urownames = toupper(rownames(y))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
227 upcam = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
228 downcam = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
229 for (i in 1:ntest) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
230 gs = unlist(genesets[i])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
231 g = gs[1] # geneset_id
474c08e747b6 Uploaded
iuc
parents:
diff changeset
232 u = gs[2]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
233 if (u > "") { u = paste("<a href=\'",u,"\'>",u,"</a>",sep="") }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
234 glist = gs[3:length(gs)] # member gene symbols
474c08e747b6 Uploaded
iuc
parents:
diff changeset
235 glist = toupper(glist)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
236 inglist = urownames %in% glist
474c08e747b6 Uploaded
iuc
parents:
diff changeset
237 nin = sum(inglist)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
238 if ((nin > minnin) && (nin < maxnin)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
239 ### print(paste('@@found',sum(inglist),'genes in glist'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
240 camres = camera(y=y,index=inglist,design=design)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
241 if (! is.null(camres)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
242 rownames(camres) = g # gene set name
474c08e747b6 Uploaded
iuc
parents:
diff changeset
243 camres = cbind(GeneSet=g,URL=u,camres)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
244 if (camres\$Direction == "Up")
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
245 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
246 upcam = rbind(upcam,camres) } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
247 downcam = rbind(downcam,camres)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
248 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
249 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
250 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
251 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
252 uscam = upcam[order(upcam\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
253 unadjp = uscam\$PValue
474c08e747b6 Uploaded
iuc
parents:
diff changeset
254 uscam\$adjPValue = p.adjust(unadjp,method=fdrtype)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
255 nup = max(10,sum((uscam\$adjPValue < fdrthresh)))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
256 dscam = downcam[order(downcam\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
257 unadjp = dscam\$PValue
474c08e747b6 Uploaded
iuc
parents:
diff changeset
258 dscam\$adjPValue = p.adjust(unadjp,method=fdrtype)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
259 ndown = max(10,sum((dscam\$adjPValue < fdrthresh)))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
260 write.table(uscam,file=paste('camera_up',outfname,sep='_'),quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
261 write.table(dscam,file=paste('camera_down',outfname,sep='_'),quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
262 print.noquote(paste('@@@@@ Camera up top',nup,'gene sets:'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
263 write.table(head(uscam,nup),file="",quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
264 print.noquote(paste('@@@@@ Camera down top',ndown,'gene sets:'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
265 write.table(head(dscam,ndown),file="",quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
266 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
267 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
268
474c08e747b6 Uploaded
iuc
parents:
diff changeset
269
474c08e747b6 Uploaded
iuc
parents:
diff changeset
270
474c08e747b6 Uploaded
iuc
parents:
diff changeset
271
474c08e747b6 Uploaded
iuc
parents:
diff changeset
272 doGSEA = function(y=NULL,design=NULL,histgmt="",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
273 bigmt="/data/genomes/gsea/3.1/Abetterchoice_nocgp_c2_c3_c5_symbols_all.gmt",
474c08e747b6 Uploaded
iuc
parents:
diff changeset
274 ntest=0, myTitle="myTitle", outfname="GSEA.xls", minnin=5, maxnin=2000,fdrthresh=0.05,fdrtype="BH")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
275 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
276 sink('Camera.log')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
277 genesets = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
278 if (bigmt > "")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
279 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
280 bigenesets = readLines(bigmt)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
281 genesets = bigenesets
474c08e747b6 Uploaded
iuc
parents:
diff changeset
282 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
283 if (histgmt > "")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
284 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
285 hgenesets = readLines(histgmt)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
286 if (bigmt > "") {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
287 genesets = rbind(genesets,hgenesets)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
288 } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
289 genesets = hgenesets
474c08e747b6 Uploaded
iuc
parents:
diff changeset
290 } # use only history if no bi
474c08e747b6 Uploaded
iuc
parents:
diff changeset
291 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
292 print.noquote(paste("@@@read",length(genesets), 'genesets from',histgmt,bigmt))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
293 genesets = strsplit(genesets,'\t') # tabular. genesetid\tURLorwhatever\tgene_1\t..\tgene_n
474c08e747b6 Uploaded
iuc
parents:
diff changeset
294 outf = outfname
474c08e747b6 Uploaded
iuc
parents:
diff changeset
295 head=paste(myTitle,'edgeR GSEA')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
296 write(head,file=outfname,append=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
297 ntest=length(genesets)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
298 urownames = toupper(rownames(y))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
299 upcam = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
300 downcam = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
301 incam = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
302 urls = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
303 gsids = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
304 for (i in 1:ntest) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
305 gs = unlist(genesets[i])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
306 gsid = gs[1] # geneset_id
474c08e747b6 Uploaded
iuc
parents:
diff changeset
307 url = gs[2]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
308 if (url > "") { url = paste("<a href=\'",url,"\'>",url,"</a>",sep="") }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
309 glist = gs[3:length(gs)] # member gene symbols
474c08e747b6 Uploaded
iuc
parents:
diff changeset
310 glist = toupper(glist)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
311 inglist = urownames %in% glist
474c08e747b6 Uploaded
iuc
parents:
diff changeset
312 nin = sum(inglist)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
313 if ((nin > minnin) && (nin < maxnin)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
314 incam = c(incam,inglist)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
315 gsids = c(gsids,gsid)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
316 urls = c(urls,url)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
317 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
318 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
319 incam = as.list(incam)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
320 names(incam) = gsids
474c08e747b6 Uploaded
iuc
parents:
diff changeset
321 allcam = camera(y=y,index=incam,design=design)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
322 allcamres = cbind(geneset=gsids,allcam,URL=urls)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
323 for (i in 1:ntest) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
324 camres = allcamres[i]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
325 res = try(test = (camres\$Direction == "Up"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
326 if ("try-error" %in% class(res)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
327 cat("test failed, camres = :")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
328 print.noquote(camres)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
329 } else { if (camres\$Direction == "Up")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
330 { upcam = rbind(upcam,camres)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
331 } else { downcam = rbind(downcam,camres)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
332 }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
333
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
334 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
335 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
336 uscam = upcam[order(upcam\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
337 unadjp = uscam\$PValue
474c08e747b6 Uploaded
iuc
parents:
diff changeset
338 uscam\$adjPValue = p.adjust(unadjp,method=fdrtype)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
339 nup = max(10,sum((uscam\$adjPValue < fdrthresh)))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
340 dscam = downcam[order(downcam\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
341 unadjp = dscam\$PValue
474c08e747b6 Uploaded
iuc
parents:
diff changeset
342 dscam\$adjPValue = p.adjust(unadjp,method=fdrtype)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
343 ndown = max(10,sum((dscam\$adjPValue < fdrthresh)))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
344 write.table(uscam,file=paste('camera_up',outfname,sep='_'),quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
345 write.table(dscam,file=paste('camera_down',outfname,sep='_'),quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
346 print.noquote(paste('@@@@@ Camera up top',nup,'gene sets:'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
347 write.table(head(uscam,nup),file="",quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
348 print.noquote(paste('@@@@@ Camera down top',ndown,'gene sets:'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
349 write.table(head(dscam,ndown),file="",quote=F,sep='\t',row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
350 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
351 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
352
474c08e747b6 Uploaded
iuc
parents:
diff changeset
353
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
354 edgeIt = function (Count_Matrix=c(),group=c(),out_edgeR=F,out_Voom=F,out_DESeq2=F,fdrtype='fdr',priordf=5,
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
355 fdrthresh=0.05,outputdir='.', myTitle='Differential Counts',libSize=c(),useNDF=F,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
356 filterquantile=0.2, subjects=c(),TreatmentName="Rx",ControlName="Ctrl",mydesign=NULL,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
357 doDESeq2=T,doVoom=T,doCamera=T,doedgeR=T,org='hg19',
474c08e747b6 Uploaded
iuc
parents:
diff changeset
358 histgmt="", bigmt="/data/genomes/gsea/3.1/Abetterchoice_nocgp_c2_c3_c5_symbols_all.gmt",
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
359 doCook=F,DESeq_fitType="parameteric",robust_meth='ordinary')
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
360 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
361
474c08e747b6 Uploaded
iuc
parents:
diff changeset
362 logf = file('Differential.log', open = "a")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
363 sink(logf,type = c("output", "message"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
364
474c08e747b6 Uploaded
iuc
parents:
diff changeset
365
474c08e747b6 Uploaded
iuc
parents:
diff changeset
366 run_edgeR = function(workCM,pdata,subjects,group,priordf,robust_meth,mydesign,mt,cmrowsums,out_edgeR,nonzerod)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
367 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
368 logf = file('edgeR.log', open = "a")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
369 sink(logf,type = c("output", "message"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
370 #### Setup myDGEList object
474c08e747b6 Uploaded
iuc
parents:
diff changeset
371 myDGEList = DGEList(counts=workCM, group = group)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
372 myDGEList = calcNormFactors(myDGEList)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
373 if (robust_meth == 'ordinary') {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
374 myDGEList = estimateGLMCommonDisp(myDGEList,mydesign)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
375 myDGEList = estimateGLMTrendedDisp(myDGEList,mydesign)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
376 if (priordf > 0) { myDGEList = estimateGLMTagwiseDisp(myDGEList,mydesign,prior.df = priordf)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
377 } else { myDGEList = estimateGLMTagwiseDisp(myDGEList,mydesign) }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
378 comdisp = myDGEList\$common.dispersion
474c08e747b6 Uploaded
iuc
parents:
diff changeset
379 estpriorn = getPriorN(myDGEList)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
380 print(paste("Common Dispersion =",comdisp,"CV = ",sqrt(comdisp),"getPriorN = ",estpriorn),quote=F)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
381 } else {
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
382 myDGEList = estimateGLMRobustDisp(myDGEList,design=mydesign, prior.df = priordf, maxit = 6, residual.type = robust_meth)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
383 }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
384
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
385
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
386 DGLM = glmFit(myDGEList,design=mydesign)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
387 DE = glmLRT(DGLM,coef=ncol(DGLM\$design)) # always last one - subject is first if needed
474c08e747b6 Uploaded
iuc
parents:
diff changeset
388 normData = cpm(myDGEList)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
389 uoutput = cbind(
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
390 Name=as.character(rownames(myDGEList\$counts)),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
391 DE\$table,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
392 adj.p.value=p.adjust(DE\$table\$PValue, method=fdrtype),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
393 Dispersion=myDGEList\$tagwise.dispersion,totreads=cmrowsums,normData,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
394 myDGEList\$counts
474c08e747b6 Uploaded
iuc
parents:
diff changeset
395 )
474c08e747b6 Uploaded
iuc
parents:
diff changeset
396 soutput = uoutput[order(DE\$table\$PValue),] # sorted into p value order - for quick toptable
474c08e747b6 Uploaded
iuc
parents:
diff changeset
397 goodness = gof(DGLM, pcutoff=fdrthresh)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
398 if (sum(goodness\$outlier) > 0) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
399 print.noquote('GLM outliers:')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
400 print(paste(rownames(DGLM)[(goodness\$outlier)],collapse=','),quote=F)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
401 } else {
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
402 print('No GLM fit outlier genes found\n')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
403 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
404 z = limma::zscoreGamma(goodness\$gof.statistic, shape=goodness\$df/2, scale=2)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
405 pdf(paste("edgeR",mt,"GoodnessofFit.pdf",sep='_'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
406 qq = qqnorm(z, panel.first=grid(), main="tagwise dispersion")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
407 abline(0,1,lwd=3)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
408 points(qq\$x[goodness\$outlier],qq\$y[goodness\$outlier], pch=16, col="maroon")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
409 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
410 uniqueg = unique(group)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
411 write.table(soutput,file=out_edgeR, quote=FALSE, sep="\t",row.names=F)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
412 tt = cbind(
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
413 Name=as.character(rownames(myDGEList)),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
414 DE\$table,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
415 adj.p.value=p.adjust(DE\$table\$PValue, method=fdrtype),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
416 Dispersion=myDGEList\$tagwise.dispersion,totreads=cmrowsums
474c08e747b6 Uploaded
iuc
parents:
diff changeset
417 )
474c08e747b6 Uploaded
iuc
parents:
diff changeset
418 tt = cbind(tt,URL=contigurls) # add to end so table isn't laid out strangely
474c08e747b6 Uploaded
iuc
parents:
diff changeset
419 stt = tt[order(DE\$table\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
420 print.noquote("@@ edgeR Top tags\n")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
421 print.noquote(stt[1:50,])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
422 deTags = rownames(uoutput[uoutput\$adj.p.value < fdrthresh,])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
423 nsig = length(deTags)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
424 print.noquote(paste('@@',nsig,'tags significant at adj p=',fdrthresh))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
425 deColours = ifelse(deTags,'red','black')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
426 pdf(paste("edgeR",mt,"BCV_vs_abundance.pdf",sep="_"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
427 plotBCV(myDGEList, cex=0.3, main="Biological CV vs abundance")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
428 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
429 dg = myDGEList[order(DE\$table\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
430 outpdfname= paste("edgeR",mt,"top_100_heatmap.pdf",sep="_")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
431 ocpm = normData[order(DE\$table\$PValue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
432 ocpm = ocpm[c(1:100),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
433 hmap2(ocpm,TName=TName,group=group,outpdfname=outpdfname,myTitle=paste(myTitle,'Heatmap'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
434 outSmear = paste("edgeR",mt,"smearplot.pdf",sep="_")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
435 outMain = paste("Smear Plot for ",TName,' Vs ',CName,' (FDR@',fdrthresh,' N = ',nsig,')',sep='')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
436 smearPlot(myDGEList=myDGEList,deTags=deTags, outSmear=outSmear, outMain = outMain)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
437 qqPlot(descr=paste(myTitle,'edgeR adj p QQ plot'),pvector=tt\$adj.p.value,outpdf=paste('edgeR',mt,'qqplot.pdf',sep='_'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
438 topresults.edgeR = soutput[which(soutput\$adj.p.value < fdrthresh), ]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
439 edgeRcountsindex = which(allgenes %in% rownames(topresults.edgeR))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
440 edgeRcounts = rep(0, length(allgenes))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
441 edgeRcounts[edgeRcountsindex] = 1 # Create venn diagram of hits
474c08e747b6 Uploaded
iuc
parents:
diff changeset
442 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
443 return(list(myDGEList=myDGEList,edgeRcounts=edgeRcounts))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
444 } ### run_edgeR
474c08e747b6 Uploaded
iuc
parents:
diff changeset
445
474c08e747b6 Uploaded
iuc
parents:
diff changeset
446
474c08e747b6 Uploaded
iuc
parents:
diff changeset
447 run_DESeq2 = function(workCM,pdata,subjects,group,out_DESeq2,mt,DESeq_fitType)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
448
474c08e747b6 Uploaded
iuc
parents:
diff changeset
449 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
450 logf = file("DESeq2.log", open = "a")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
451 sink(logf,type = c("output", "message"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
452 # DESeq2
474c08e747b6 Uploaded
iuc
parents:
diff changeset
453 require('DESeq2')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
454 library('RColorBrewer')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
455 if (length(subjects) == 0)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
456 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
457 pdata = data.frame(Name=colnames(workCM),Rx=group,row.names=colnames(workCM))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
458 deSEQds = DESeqDataSetFromMatrix(countData = workCM, colData = pdata, design = formula(~ Rx))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
459 } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
460 pdata = data.frame(Name=colnames(workCM),Rx=group,subjects=subjects,row.names=colnames(workCM))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
461 deSEQds = DESeqDataSetFromMatrix(countData = workCM, colData = pdata, design = formula(~ subjects + Rx))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
462 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
463 deSeqDatsizefac = estimateSizeFactors(deSEQds)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
464 deSeqDatdisp = estimateDispersions(deSeqDatsizefac,fitType=DESeq_fitType)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
465 resDESeq = nbinomWaldTest(deSeqDatdisp)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
466 rDESeq = as.data.frame(results(resDESeq))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
467 rDESeq = cbind(Contig=rownames(workCM),rDESeq,NReads=cmrowsums,URL=contigurls)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
468 srDESeq = rDESeq[order(rDESeq\$pvalue),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
469 qqPlot(descr=paste(myTitle,'DESeq2 adj p qq plot'),pvector=rDESeq\$padj,outpdf=paste('DESeq2',mt,'qqplot.pdf',sep="_"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
470 cat("# DESeq top 50\n")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
471 print.noquote(srDESeq[1:50,])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
472 write.table(srDESeq,file=out_DESeq2, quote=FALSE, sep="\t",row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
473 topresults.DESeq = rDESeq[which(rDESeq\$padj < fdrthresh), ]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
474 DESeqcountsindex = which(allgenes %in% rownames(topresults.DESeq))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
475 DESeqcounts = rep(0, length(allgenes))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
476 DESeqcounts[DESeqcountsindex] = 1
474c08e747b6 Uploaded
iuc
parents:
diff changeset
477 pdf(paste("DESeq2",mt,"dispersion_estimates.pdf",sep='_'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
478 plotDispEsts(resDESeq)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
479 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
480 ysmall = abs(min(rDESeq\$log2FoldChange))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
481 ybig = abs(max(rDESeq\$log2FoldChange))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
482 ylimit = min(4,ysmall,ybig)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
483 pdf(paste("DESeq2",mt,"MA_plot.pdf",sep="_"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
484 plotMA(resDESeq,main=paste(myTitle,"DESeq2 MA plot"),ylim=c(-ylimit,ylimit))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
485 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
486 rlogres = rlogTransformation(resDESeq)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
487 sampledists = dist( t( assay(rlogres) ) )
474c08e747b6 Uploaded
iuc
parents:
diff changeset
488 sdmat = as.matrix(sampledists)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
489 pdf(paste("DESeq2",mt,"sample_distance_plot.pdf",sep="_"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
490 heatmap.2(sdmat,trace="none",main=paste(myTitle,"DESeq2 sample distances"),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
491 col = colorRampPalette( rev(brewer.pal(9, "RdBu")) )(255))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
492 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
493 result = try( (ppca = plotPCA( varianceStabilizingTransformation(deSeqDatdisp,blind=T), intgroup=c("Rx","Name")) ) )
474c08e747b6 Uploaded
iuc
parents:
diff changeset
494 if ("try-error" %in% class(result)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
495 print.noquote('DESeq2 plotPCA failed.')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
496 } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
497 pdf(paste("DESeq2",mt,"PCA_plot.pdf",sep="_"))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
498 #### wtf - print? Seems needed to get this to work
474c08e747b6 Uploaded
iuc
parents:
diff changeset
499 print(ppca)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
500 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
501 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
502 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
503 return(DESeqcounts)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
504 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
505
474c08e747b6 Uploaded
iuc
parents:
diff changeset
506
474c08e747b6 Uploaded
iuc
parents:
diff changeset
507 run_Voom = function(workCM,pdata,subjects,group,mydesign,mt,out_Voom)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
508 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
509 logf = file('VOOM.log', open = "a")
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
510 sink(logf,type = c("output", "message"))
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
511 if (doedgeR == F) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
512 #### Setup myDGEList object
474c08e747b6 Uploaded
iuc
parents:
diff changeset
513 myDGEList = DGEList(counts=workCM, group = group)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
514 myDGEList = calcNormFactors(myDGEList)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
515 myDGEList = estimateGLMCommonDisp(myDGEList,mydesign)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
516 myDGEList = estimateGLMTrendedDisp(myDGEList,mydesign)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
517 myDGEList = estimateGLMTagwiseDisp(myDGEList,mydesign)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
518 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
519 pdf(paste("VOOM",mt,"mean_variance_plot.pdf",sep='_'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
520 dat.voomed <- voom(myDGEList, mydesign, plot = TRUE, normalize.method="quantil", lib.size = NULL)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
521 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
522 # Use limma to fit data
474c08e747b6 Uploaded
iuc
parents:
diff changeset
523 fit = lmFit(dat.voomed, mydesign)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
524 fit = eBayes(fit)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
525 rvoom = topTable(fit, coef = length(colnames(mydesign)), adj = fdrtype, n = Inf, sort="none")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
526 qqPlot(descr=paste(myTitle,'VOOM-limma adj p QQ plot'),pvector=rvoom\$adj.P.Val,outpdf=paste('VOOM',mt,'qqplot.pdf',sep='_'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
527 rownames(rvoom) = rownames(workCM)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
528 rvoom = cbind(Contig=rownames(workCM),rvoom,NReads=cmrowsums,URL=contigurls)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
529 srvoom = rvoom[order(rvoom\$P.Value),]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
530 cat("# VOOM top 50\n")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
531 print(srvoom[1:50,])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
532 write.table(srvoom,file=out_Voom, quote=FALSE, sep="\t",row.names=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
533 # Use an FDR cutoff to find interesting samples for edgeR, DESeq and voom/limma
474c08e747b6 Uploaded
iuc
parents:
diff changeset
534 topresults.voom = rvoom[which(rvoom\$adj.P.Val < fdrthresh), ]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
535 voomcountsindex <- which(allgenes %in% rownames(topresults.voom))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
536 voomcounts = rep(0, length(allgenes))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
537 voomcounts[voomcountsindex] = 1
474c08e747b6 Uploaded
iuc
parents:
diff changeset
538 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
539 return(voomcounts)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
540 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
541
474c08e747b6 Uploaded
iuc
parents:
diff changeset
542
474c08e747b6 Uploaded
iuc
parents:
diff changeset
543 #### data cleaning and analsis control starts here
474c08e747b6 Uploaded
iuc
parents:
diff changeset
544
474c08e747b6 Uploaded
iuc
parents:
diff changeset
545
474c08e747b6 Uploaded
iuc
parents:
diff changeset
546 # Error handling
474c08e747b6 Uploaded
iuc
parents:
diff changeset
547 nugroup = length(unique(group))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
548 if (nugroup!=2){
474c08e747b6 Uploaded
iuc
parents:
diff changeset
549 print("Number of conditions identified in experiment does not equal 2")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
550 q()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
551 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
552 require(edgeR)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
553 options(width = 512)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
554 mt = paste(unlist(strsplit(myTitle,'_')),collapse=" ")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
555 allN = nrow(Count_Matrix)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
556 nscut = round(ncol(Count_Matrix)/2) # half samples
474c08e747b6 Uploaded
iuc
parents:
diff changeset
557 colTotmillionreads = colSums(Count_Matrix)/1e6
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
558 counts.dataframe = as.data.frame(c())
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
559 rawrs = rowSums(Count_Matrix)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
560 nonzerod = Count_Matrix[(rawrs > 0),] # remove all zero count genes
474c08e747b6 Uploaded
iuc
parents:
diff changeset
561 nzN = nrow(nonzerod)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
562 nzrs = rowSums(nonzerod)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
563 zN = allN - nzN
474c08e747b6 Uploaded
iuc
parents:
diff changeset
564 print('@@@ Quantiles for non-zero row counts:',quote=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
565 print(quantile(nzrs,probs=seq(0,1,0.1)),quote=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
566 if (useNDF == T)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
567 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
568 gt1rpin3 = rowSums(Count_Matrix/expandAsMatrix(colTotmillionreads,dim(Count_Matrix)) >= 1) >= nscut
474c08e747b6 Uploaded
iuc
parents:
diff changeset
569 lo = colSums(Count_Matrix[!gt1rpin3,])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
570 workCM = Count_Matrix[gt1rpin3,]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
571 cleanrs = rowSums(workCM)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
572 cleanN = length(cleanrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
573 meth = paste( "After removing",length(lo),"contigs with fewer than ",nscut," sample read counts >= 1 per million, there are",sep="")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
574 print(paste("Read",allN,"contigs. Removed",zN,"contigs with no reads.",meth,cleanN,"contigs"),quote=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
575 maint = paste('Filter >=1/million reads in >=',nscut,'samples')
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
576 } else {
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
577 useme = (nzrs > quantile(nzrs,filterquantile))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
578 workCM = nonzerod[useme,]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
579 lo = colSums(nonzerod[!useme,])
474c08e747b6 Uploaded
iuc
parents:
diff changeset
580 cleanrs = rowSums(workCM)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
581 cleanN = length(cleanrs)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
582 meth = paste("After filtering at count quantile =",filterquantile,", there are",sep="")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
583 print(paste('Read',allN,"contigs. Removed",zN,"with no reads.",meth,cleanN,"contigs"),quote=F)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
584 maint = paste('Filter below',filterquantile,'quantile')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
585 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
586 cumPlot(rawrs=rawrs,cleanrs=cleanrs,maint=maint,myTitle=myTitle)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
587 allgenes = rownames(workCM)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
588 reg = "^chr([0-9]+):([0-9]+)-([0-9]+)" # ucsc chr:start-end regexp
474c08e747b6 Uploaded
iuc
parents:
diff changeset
589 genecards="<a href=\'http://www.genecards.org/index.php?path=/Search/keyword/"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
590 ucsc = paste("<a href=\'http://genome.ucsc.edu/cgi-bin/hgTracks?db=",org,sep='')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
591 testreg = str_match(allgenes,reg)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
592 if (sum(!is.na(testreg[,1]))/length(testreg[,1]) > 0.8) # is ucsc style string
474c08e747b6 Uploaded
iuc
parents:
diff changeset
593 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
594 print("@@ using ucsc substitution for urls")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
595 contigurls = paste0(ucsc,"&amp;position=chr",testreg[,2],":",testreg[,3],"-",testreg[,4],"\'>",allgenes,"</a>")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
596 } else {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
597 print("@@ using genecards substitution for urls")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
598 contigurls = paste0(genecards,allgenes,"\'>",allgenes,"</a>")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
599 }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
600 print.noquote(paste("@@ Total low count contigs per sample = ",paste(table(lo),collapse=',')))
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
601 cmrowsums = rowSums(workCM)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
602 TName=unique(group)[1]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
603 CName=unique(group)[2]
474c08e747b6 Uploaded
iuc
parents:
diff changeset
604 if (is.null(mydesign)) {
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
605 if (length(subjects) == 0)
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
606 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
607 mydesign = model.matrix(~group)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
608 }
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
609 else {
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
610 subjf = factor(subjects)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
611 mydesign = model.matrix(~subjf+group) # we block on subject so make group last to simplify finding it
474c08e747b6 Uploaded
iuc
parents:
diff changeset
612 }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
613 }
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
614 print.noquote(paste('Using samples:',paste(colnames(workCM),collapse=',')))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
615 print.noquote('Using design matrix:')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
616 print.noquote(mydesign)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
617 normData = cpm(workCM)*1e6
474c08e747b6 Uploaded
iuc
parents:
diff changeset
618 colnames(normData) = paste( colnames(workCM),'N',sep="_")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
619 print(paste('Raw sample read totals',paste(colSums(nonzerod,na.rm=T),collapse=',')))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
620
474c08e747b6 Uploaded
iuc
parents:
diff changeset
621 if (doedgeR == T) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
622 eres = run_edgeR(workCM,pdata,subjects,group,priordf,robust_meth,mydesign,mt,cmrowsums,out_edgeR,nonzerod)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
623 myDGEList = eres\$myDGEList
474c08e747b6 Uploaded
iuc
parents:
diff changeset
624 edgeRcounts = eres\$edgeRcounts
474c08e747b6 Uploaded
iuc
parents:
diff changeset
625 #### Plot MDS
474c08e747b6 Uploaded
iuc
parents:
diff changeset
626 sample_colors = match(group,levels(group))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
627 sampleTypes = levels(factor(group))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
628 print.noquote(sampleTypes)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
629 pdf(paste("edgeR",mt,"MDSplot.pdf",sep='_'))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
630 plotMDS.DGEList(myDGEList,main=paste("MDS for",myTitle),cex=0.5,col=sample_colors,pch=sample_colors)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
631 legend(x="topleft", legend = sampleTypes,col=c(1:length(sampleTypes)), pch=19)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
632 grid(col="blue")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
633 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
634 scale <- myDGEList\$samples\$lib.size*myDGEList\$samples\$norm.factors
474c08e747b6 Uploaded
iuc
parents:
diff changeset
635 normCounts <- round(t(t(myDGEList\$counts)/scale)*mean(scale))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
636 try({boxPlot(rawrs=nzd,cleanrs=log2(normCounts+1),maint='Effects of TMM size normalisation',myTitle=myTitle,pdfname=paste("edgeR",mt,"raw_norm_counts_box.pdf",sep='_'))},T)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
637 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
638 if (doDESeq2 == T) { DESeqcounts = run_DESeq2(workCM,pdata,subjects,group,out_DESeq2,mt,DESeq_fitType) }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
639 if (doVoom == T) { voomcounts = run_Voom(workCM,pdata,subjects,group,mydesign,mt,out_Voom) }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
640
474c08e747b6 Uploaded
iuc
parents:
diff changeset
641
474c08e747b6 Uploaded
iuc
parents:
diff changeset
642 if (doCamera) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
643 doGSEA(y=myDGEList,design=mydesign,histgmt=histgmt,bigmt=bigmt,ntest=20,myTitle=myTitle,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
644 outfname=paste("GSEA_Camera",mt,"table.xls",sep="_"),fdrthresh=fdrthresh,fdrtype=fdrtype)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
645 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
646 counts.dataframe = c()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
647 vennmain = 'no venn'
474c08e747b6 Uploaded
iuc
parents:
diff changeset
648 if ((doDESeq2==T) || (doVoom==T) || (doedgeR==T)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
649 if ((doVoom==T) && (doDESeq2==T) && (doedgeR==T)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
650 vennmain = paste(mt,'Voom,edgeR and DESeq2 overlap at FDR=',fdrthresh)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
651 counts.dataframe = data.frame(edgeR = edgeRcounts, DESeq2 = DESeqcounts,
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
652 VOOM_limma = voomcounts, row.names = allgenes)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
653 } else if ((doDESeq2==T) && (doedgeR==T)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
654 vennmain = paste(mt,'DESeq2 and edgeR overlap at FDR=',fdrthresh)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
655 counts.dataframe = data.frame(edgeR = edgeRcounts, DESeq2 = DESeqcounts, row.names = allgenes)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
656 } else if ((doVoom==T) && (doedgeR==T)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
657 vennmain = paste(mt,'Voom and edgeR overlap at FDR=',fdrthresh)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
658 counts.dataframe = data.frame(edgeR = edgeRcounts, VOOM_limma = voomcounts, row.names = allgenes)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
659 }
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
660
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
661 if (nrow(counts.dataframe > 1)) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
662 counts.venn = vennCounts(counts.dataframe)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
663 vennf = paste("Differential_venn",mt,"significant_genes_overlap.pdf",sep="_")
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
664 pdf(vennf)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
665 vennDiagram(counts.venn,main=vennmain,col="maroon")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
666 dev.off()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
667 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
668 } #### doDESeq2 or doVoom
474c08e747b6 Uploaded
iuc
parents:
diff changeset
669 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
670 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
671 #### Done
474c08e747b6 Uploaded
iuc
parents:
diff changeset
672 ]]>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
673 builtin_gmt = ""
474c08e747b6 Uploaded
iuc
parents:
diff changeset
674 history_gmt = ""
474c08e747b6 Uploaded
iuc
parents:
diff changeset
675 history_gmt_name = ""
474c08e747b6 Uploaded
iuc
parents:
diff changeset
676 out_edgeR = F
474c08e747b6 Uploaded
iuc
parents:
diff changeset
677 out_DESeq2 = F
474c08e747b6 Uploaded
iuc
parents:
diff changeset
678 out_Voom = "$out_VOOM"
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
679 edgeR_robust_meth = "ordinary"
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
680 doDESeq2 = $DESeq2.doDESeq2
474c08e747b6 Uploaded
iuc
parents:
diff changeset
681 doVoom = $doVoom
474c08e747b6 Uploaded
iuc
parents:
diff changeset
682 doCamera = F
474c08e747b6 Uploaded
iuc
parents:
diff changeset
683 doedgeR = $edgeR.doedgeR
474c08e747b6 Uploaded
iuc
parents:
diff changeset
684 edgeR_priordf = 10
474c08e747b6 Uploaded
iuc
parents:
diff changeset
685
474c08e747b6 Uploaded
iuc
parents:
diff changeset
686
474c08e747b6 Uploaded
iuc
parents:
diff changeset
687 #if $doVoom == "T":
474c08e747b6 Uploaded
iuc
parents:
diff changeset
688 out_Voom = "$out_VOOM"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
689 #end if
474c08e747b6 Uploaded
iuc
parents:
diff changeset
690
474c08e747b6 Uploaded
iuc
parents:
diff changeset
691 #if $DESeq2.doDESeq2 == "T":
474c08e747b6 Uploaded
iuc
parents:
diff changeset
692 out_DESeq2 = "$out_DESeq2"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
693 doDESeq2 = T
474c08e747b6 Uploaded
iuc
parents:
diff changeset
694 DESeq_fitType = "$DESeq2.DESeq_fitType"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
695 #end if
474c08e747b6 Uploaded
iuc
parents:
diff changeset
696
474c08e747b6 Uploaded
iuc
parents:
diff changeset
697 #if $edgeR.doedgeR == "T":
474c08e747b6 Uploaded
iuc
parents:
diff changeset
698 out_edgeR = "$out_edgeR"
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
699 edgeR_priordf = $edgeR.edgeR_priordf
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
700 edgeR_robust_meth = "$edgeR.edgeR_robust_method"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
701 #end if
474c08e747b6 Uploaded
iuc
parents:
diff changeset
702
474c08e747b6 Uploaded
iuc
parents:
diff changeset
703
474c08e747b6 Uploaded
iuc
parents:
diff changeset
704 if (sum(c(doedgeR,doVoom,doDESeq2)) == 0)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
705 {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
706 write("No methods chosen - nothing to do! Please try again after choosing one or more methods", stderr())
474c08e747b6 Uploaded
iuc
parents:
diff changeset
707 quit(save="no",status=2)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
708 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
709
474c08e747b6 Uploaded
iuc
parents:
diff changeset
710 Out_Dir = "$html_file.files_path"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
711 Input = "$input1"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
712 TreatmentName = "$treatment_name"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
713 TreatmentCols = "$Treat_cols"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
714 ControlName = "$control_name"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
715 ControlCols= "$Control_cols"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
716 org = "$input1.dbkey"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
717 if (org == "") { org = "hg19"}
474c08e747b6 Uploaded
iuc
parents:
diff changeset
718 fdrtype = "$fdrtype"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
719 fdrthresh = $fdrthresh
474c08e747b6 Uploaded
iuc
parents:
diff changeset
720 useNDF = $useNDF
474c08e747b6 Uploaded
iuc
parents:
diff changeset
721 fQ = $fQ # non-differential centile cutoff
474c08e747b6 Uploaded
iuc
parents:
diff changeset
722 myTitle = "$title"
474c08e747b6 Uploaded
iuc
parents:
diff changeset
723 sids = strsplit("$subjectids",',')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
724 subjects = unlist(sids)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
725 nsubj = length(subjects)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
726 TCols = as.numeric(strsplit(TreatmentCols,",")[[1]])-1
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
727 CCols = as.numeric(strsplit(ControlCols,",")[[1]])-1
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
728 cat('Got TCols=')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
729 cat(TCols)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
730 cat('; CCols=')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
731 cat(CCols)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
732 cat('\n')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
733 <![CDATA[
474c08e747b6 Uploaded
iuc
parents:
diff changeset
734 useCols = c(TCols,CCols)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
735 if (file.exists(Out_Dir) == F) dir.create(Out_Dir)
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
736 Count_Matrix = read.table(Input,header=T,row.names=1,sep='\t')
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
737 snames = colnames(Count_Matrix)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
738 nsamples = length(snames)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
739 if (nsubj > 0 & nsubj != nsamples) {
474c08e747b6 Uploaded
iuc
parents:
diff changeset
740 options("show.error.messages"=T)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
741 mess = paste('Fatal error: Supplied subject id list',paste(subjects,collapse=','),
474c08e747b6 Uploaded
iuc
parents:
diff changeset
742 'has length',nsubj,'but there are',nsamples,'samples',paste(snames,collapse=','))
474c08e747b6 Uploaded
iuc
parents:
diff changeset
743 write(mess, stderr())
474c08e747b6 Uploaded
iuc
parents:
diff changeset
744 quit(save="no",status=4)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
745 }
474c08e747b6 Uploaded
iuc
parents:
diff changeset
746 if (length(subjects) != 0) {subjects = subjects[useCols]}
474c08e747b6 Uploaded
iuc
parents:
diff changeset
747 Count_Matrix = Count_Matrix[,useCols] ### reorder columns
474c08e747b6 Uploaded
iuc
parents:
diff changeset
748 rn = rownames(Count_Matrix)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
749 islib = rn %in% c('librarySize','NotInBedRegions')
474c08e747b6 Uploaded
iuc
parents:
diff changeset
750 LibSizes = Count_Matrix[subset(rn,islib),][1] # take first
474c08e747b6 Uploaded
iuc
parents:
diff changeset
751 Count_Matrix = Count_Matrix[subset(rn,! islib),]
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
752 group = c(rep(TreatmentName,length(TCols)), rep(ControlName,length(CCols)) )
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
753 group = factor(group, levels=c(ControlName,TreatmentName))
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
754 colnames(Count_Matrix) = paste(group,colnames(Count_Matrix),sep="_")
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
755 results = edgeIt(Count_Matrix=Count_Matrix,group=group, out_edgeR=out_edgeR, out_Voom=out_Voom, out_DESeq2=out_DESeq2,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
756 fdrtype='BH',mydesign=NULL,priordf=edgeR_priordf,fdrthresh=fdrthresh,outputdir='.',
474c08e747b6 Uploaded
iuc
parents:
diff changeset
757 myTitle=myTitle,useNDF=F,libSize=c(),filterquantile=fQ,subjects=subjects,TreatmentName=TreatmentName,ControlName=ControlName,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
758 doDESeq2=doDESeq2,doVoom=doVoom,doCamera=doCamera,doedgeR=doedgeR,org=org,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
759 histgmt=history_gmt,bigmt=builtin_gmt,DESeq_fitType=DESeq_fitType,robust_meth=edgeR_robust_meth)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
760 sessionInfo()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
761
474c08e747b6 Uploaded
iuc
parents:
diff changeset
762 sink()
474c08e747b6 Uploaded
iuc
parents:
diff changeset
763 ]]>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
764 </configfile>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
765 </configfiles>
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
766 <inputs>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
767 <param name="input1" type="data" format="tabular" label="Select an input matrix - rows are contigs, columns are counts for each sample" help="Use the HTSeq based count matrix preparation tool to create these matrices from BAM/SAM files and a GTF file of genomic features"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
768 <param name="title" type="text" value="Differential Counts" size="80" label="Title for job outputs" help="Supply a meaningful name here to remind you what the outputs contain">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
769 <sanitizer invalid_char="">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
770 <valid initial="string.letters,string.digits">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
771 <add value="_"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
772 </valid>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
773 </sanitizer>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
774 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
775 <param name="treatment_name" type="text" value="Treatment" size="50" label="Treatment Name"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
776 <param name="Treat_cols" label="Select columns containing treatment." type="data_column" data_ref="input1" numerical="True" multiple="true" use_header_names="true" size="120" display="checkboxes" force_select="True">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
777 <validator type="no_options" message="Please select at least one column."/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
778 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
779 <param name="control_name" type="text" value="Control" size="50" label="Control Name"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
780 <param name="Control_cols" label="Select columns containing control." type="data_column" data_ref="input1" numerical="True" multiple="true" use_header_names="true" size="120" display="checkboxes" force_select="True">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
781 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
782 <param name="subjectids" type="text" optional="true" size="120" value="" label="IF SUBJECTS NOT ALL INDEPENDENT! Enter comma separated strings to indicate sample labels for (eg) pairing - must be one for every column in input" help="Leave blank if no pairing, but eg if data from sample id A99 is in columns 2,4 and id C21 is in 3,5 then enter 'A99,C21,A99,C21'">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
783 <sanitizer>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
784 <valid initial="string.letters,string.digits">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
785 <add value=","/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
786 </valid>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
787 </sanitizer>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
788 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
789 <param name="fQ" type="float" value="0.3" size="5" label="Non-differential contig count quantile threshold - zero to analyze all non-zero read count contigs" help="May be a good or a bad idea depending on the biology and the question. EG 0.3 = sparsest 30% of contigs with at least one read are removed before analysis"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
790 <param name="useNDF" type="boolean" truevalue="T" falsevalue="F" checked="false" size="1" label="Non differential filter - remove contigs below a threshold (1 per million) for half or more samples" help="May be a good or a bad idea depending on the biology and the question. This was the old default. Quantile based is available as an alternative"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
791 <conditional name="edgeR">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
792 <param name="doedgeR" type="select" label="Run this model using edgeR" help="edgeR uses a negative binomial model and seems to be powerful, even with few replicates">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
793 <option value="F">Do not run edgeR</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
794 <option value="T" selected="true">Run edgeR</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
795 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
796 <when value="T">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
797 <param name="edgeR_priordf" type="integer" value="10" size="3" label="prior.df for tagwise dispersion - larger value = more squeezing of tag dispersions to common dispersion. Replaces prior.n and prior.df = prior.n * residual.df" help="10 = edgeR default. Use a larger value to 'smooth' small samples. See edgeR docs and note below"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
798 <param name="edgeR_robust_method" type="select" value="20" size="3" label="Use robust dispersion method" help="Use ordinary, anscombe or deviance robust deviance estimates">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
799 <option value="ordinary" selected="true">Use ordinary deviance estimates</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
800 <option value="deviance">Use robust deviance estimates</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
801 <option value="anscombe">use Anscombe robust deviance estimates</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
802 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
803 </when>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
804 <when value="F"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
805 </conditional>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
806 <conditional name="DESeq2">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
807 <param name="doDESeq2" type="select" label="Run the same model with DESeq2 and compare findings" help="DESeq2 is an update to the DESeq package. It uses different assumptions and methods to edgeR">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
808 <option value="F" selected="true">Do not run DESeq2</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
809 <option value="T">Run DESeq2</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
810 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
811 <when value="T">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
812 <param name="DESeq_fitType" type="select">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
813 <option value="parametric" selected="true">Parametric (default) fit for dispersions</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
814 <option value="local">Local fit - this will automagically be used if parametric fit fails</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
815 <option value="mean">Mean dispersion fit- use this if you really understand what you're doing - read the fine manual linked below in the documentation</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
816 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
817 </when>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
818 <when value="F"> </when>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
819 </conditional>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
820 <param name="doVoom" type="select" label="Run the same model with Voom/limma and compare findings" help="Voom uses counts per million and a precise transformation of variance so count data can be analysed using limma">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
821 <option value="F" selected="true">Do not run VOOM</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
822 <option value="T">Run VOOM</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
823 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
824 <param name="fdrthresh" type="float" value="0.05" size="5" label="P value threshold for FDR filtering for amily wise error rate control" help="Conventional default value of 0.05 recommended"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
825 <param name="fdrtype" type="select" label="FDR (Type II error) control method" help="Use fdr or bh typically to control for the number of tests in a reliable way">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
826 <option value="fdr" selected="true">fdr</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
827 <option value="BH">Benjamini Hochberg</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
828 <option value="BY">Benjamini Yukateli</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
829 <option value="bonferroni">Bonferroni</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
830 <option value="hochberg">Hochberg</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
831 <option value="holm">Holm</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
832 <option value="hommel">Hommel</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
833 <option value="none">no control for multiple tests</option>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
834 </param>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
835 </inputs>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
836 <outputs>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
837 <data format="tabular" name="out_edgeR" label="${title}_topTable_edgeR.xls">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
838 <filter>edgeR['doedgeR'] == "T"</filter>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
839 </data>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
840 <data format="tabular" name="out_DESeq2" label="${title}_topTable_DESeq2.xls">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
841 <filter>DESeq2['doDESeq2'] == "T"</filter>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
842 </data>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
843 <data format="tabular" name="out_VOOM" label="${title}_topTable_VOOM.xls">
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
844 <filter>doVoom == "T"</filter>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
845 </data>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
846 <data format="html" name="html_file" label="${title}.html"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
847 </outputs>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
848 <tests>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
849 <test>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
850 <param name="input1" value="test_bams2mx.xls" ftype="tabular"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
851 <param name="treatment_name" value="liver"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
852 <param name="title" value="edgeRtest"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
853 <param name="useNDF" value=""/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
854 <param name="doedgeR" value="T"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
855 <param name="doVoom" value="T"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
856 <param name="doDESeq2" value="T"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
857 <param name="fdrtype" value="fdr"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
858 <param name="edgeR_priordf" value="8"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
859 <param name="edgeR_robust" value="ordinary"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
860 <param name="fdrthresh" value="0.05"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
861 <param name="control_name" value="heart"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
862 <param name="subjectids" value=""/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
863 <param name="Control_cols" value="3,4,5,9"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
864 <param name="Treat_cols" value="2,6,7,8"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
865 <output name="out_edgeR" file="edgeRtest1out.xls" compare="diff" lines_diff="20"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
866 <output name="html_file" file="edgeRtest1out.html" compare="diff" lines_diff="20"/>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
867 </test>
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
868 </tests>
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
869 <help>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
870
474c08e747b6 Uploaded
iuc
parents:
diff changeset
871 **What it does**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
872
474c08e747b6 Uploaded
iuc
parents:
diff changeset
873 Allows short read sequence counts from controlled experiments to be analysed for differentially expressed genes.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
874 Optionally adds a term for subject if not all samples are independent or if some other factor needs to be blocked in the design.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
875
474c08e747b6 Uploaded
iuc
parents:
diff changeset
876 **Input**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
877
474c08e747b6 Uploaded
iuc
parents:
diff changeset
878 Requires a count matrix as a tabular file. These are best made using the companion HTSeq_ based counter Galaxy wrapper
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
879 and your fave gene model to generate inputs. Each row is a genomic feature (gene or exon eg) and each column the
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
880 non-negative integer count of reads from one sample overlapping the feature.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
881
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
882 The matrix must have a header row uniquely identifying the source samples, and unique row names in
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
883 the first column. Typically the row names are gene symbols or probe ids for downstream use in GSEA and other methods.
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
884 They must be unique and R names or they will be mangled - please read the fine R docs for the rules on identifiers.
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
885
474c08e747b6 Uploaded
iuc
parents:
diff changeset
886 **Specifying comparisons**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
887
474c08e747b6 Uploaded
iuc
parents:
diff changeset
888 This is basically dumbed down for two factors - case vs control.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
889
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
890 More complex interfaces are possible but painful at present.
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
891 Probably need to specify a phenotype file to do this better.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
892 Work in progress. Send code.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
893
474c08e747b6 Uploaded
iuc
parents:
diff changeset
894 If you have (eg) paired samples and wish to include a term in the GLM to account for some other factor (subject in the case of paired samples),
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
895 put a comma separated list of indicators for every sample (whether modelled or not!) indicating (eg) the subject number or
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
896 A list of integers, one for each subject or an empty string if samples are all independent.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
897 If not empty, there must be exactly as many integers in the supplied integer list as there are columns (samples) in the count matrix.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
898 Integers for samples that are not in the analysis *must* be present in the string as filler even if not used.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
899
474c08e747b6 Uploaded
iuc
parents:
diff changeset
900 So if you have 2 pairs out of 6 samples, you need to put in unique integers for the unpaired ones
474c08e747b6 Uploaded
iuc
parents:
diff changeset
901 eg if you had 6 samples with the first two independent but the second and third pairs each being from independent subjects. you might use
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
902 8,9,1,1,2,2
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
903 as subject IDs to indicate two paired samples from the same subject in columns 3/4 and 5/6
474c08e747b6 Uploaded
iuc
parents:
diff changeset
904
474c08e747b6 Uploaded
iuc
parents:
diff changeset
905 **Methods available**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
906
474c08e747b6 Uploaded
iuc
parents:
diff changeset
907 You can run 3 popular Bioconductor packages available for count data.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
908
474c08e747b6 Uploaded
iuc
parents:
diff changeset
909 edgeR - see edgeR_ for details
474c08e747b6 Uploaded
iuc
parents:
diff changeset
910
474c08e747b6 Uploaded
iuc
parents:
diff changeset
911 VOOM/limma - see limma_VOOM_ for details
474c08e747b6 Uploaded
iuc
parents:
diff changeset
912
474c08e747b6 Uploaded
iuc
parents:
diff changeset
913 DESeq2 - see DESeq2_ for details
474c08e747b6 Uploaded
iuc
parents:
diff changeset
914
474c08e747b6 Uploaded
iuc
parents:
diff changeset
915 and optionally camera in edgeR which works better if MSigDB is installed.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
916
474c08e747b6 Uploaded
iuc
parents:
diff changeset
917 **Outputs**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
918
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
919 Some helpful plots and analysis results. Note that most of these are produced using R code
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
920 suggested by the excellent documentation and vignettes for the Bioconductor
474c08e747b6 Uploaded
iuc
parents:
diff changeset
921 packages invoked. The Tool Factory is used to automatically lay these out for you to enjoy.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
922
474c08e747b6 Uploaded
iuc
parents:
diff changeset
923 **Note on Voom**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
924
474c08e747b6 Uploaded
iuc
parents:
diff changeset
925 The voom from limma version 3.16.6 help in R includes this from the authors - but you should read the paper to interpret this method.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
926
474c08e747b6 Uploaded
iuc
parents:
diff changeset
927 This function is intended to process RNA-Seq or ChIP-Seq data prior to linear modelling in limma.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
928
474c08e747b6 Uploaded
iuc
parents:
diff changeset
929 voom is an acronym for mean-variance modelling at the observational level.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
930 The key concern is to estimate the mean-variance relationship in the data, then use this to compute appropriate weights for each observation.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
931 Count data almost show non-trivial mean-variance relationships. Raw counts show increasing variance with increasing count size, while log-counts typically show a decreasing mean-variance trend.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
932 This function estimates the mean-variance trend for log-counts, then assigns a weight to each observation based on its predicted variance.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
933 The weights are then used in the linear modelling process to adjust for heteroscedasticity.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
934
474c08e747b6 Uploaded
iuc
parents:
diff changeset
935 In an experiment, a count value is observed for each tag in each sample. A tag-wise mean-variance trend is computed using lowess.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
936 The tag-wise mean is the mean log2 count with an offset of 0.5, across samples for a given tag.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
937 The tag-wise variance is the quarter-root-variance of normalized log2 counts per million values with an offset of 0.5, across samples for a given tag.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
938 Tags with zero counts across all samples are not included in the lowess fit. Optional normalization is performed using normalizeBetweenArrays.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
939 Using fitted values of log2 counts from a linear model fit by lmFit, variances from the mean-variance trend were interpolated for each observation.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
940 This was carried out by approxfun. Inverse variance weights can be used to correct for mean-variance trend in the count data.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
941
474c08e747b6 Uploaded
iuc
parents:
diff changeset
942
474c08e747b6 Uploaded
iuc
parents:
diff changeset
943 Author(s)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
944
474c08e747b6 Uploaded
iuc
parents:
diff changeset
945 Charity Law and Gordon Smyth
474c08e747b6 Uploaded
iuc
parents:
diff changeset
946
474c08e747b6 Uploaded
iuc
parents:
diff changeset
947 References
474c08e747b6 Uploaded
iuc
parents:
diff changeset
948
474c08e747b6 Uploaded
iuc
parents:
diff changeset
949 Law, CW (2013). Precision weights for gene expression analysis. PhD Thesis. University of Melbourne, Australia.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
950
474c08e747b6 Uploaded
iuc
parents:
diff changeset
951 Law, CW, Chen, Y, Shi, W, Smyth, GK (2013). Voom! Precision weights unlock linear model analysis tools for RNA-seq read counts.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
952 Technical Report 1 May 2013, Bioinformatics Division, Walter and Eliza Hall Institute of Medical Reseach, Melbourne, Australia.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
953 http://www.statsci.org/smyth/pubs/VoomPreprint.pdf
474c08e747b6 Uploaded
iuc
parents:
diff changeset
954
474c08e747b6 Uploaded
iuc
parents:
diff changeset
955 See Also
474c08e747b6 Uploaded
iuc
parents:
diff changeset
956
474c08e747b6 Uploaded
iuc
parents:
diff changeset
957 A voom case study is given in the edgeR User's Guide.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
958
474c08e747b6 Uploaded
iuc
parents:
diff changeset
959 vooma is a similar function but for microarrays instead of RNA-seq.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
960
474c08e747b6 Uploaded
iuc
parents:
diff changeset
961
474c08e747b6 Uploaded
iuc
parents:
diff changeset
962 ***old rant on changes to Bioconductor package variable names between versions***
474c08e747b6 Uploaded
iuc
parents:
diff changeset
963
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
964 The edgeR authors made a small cosmetic change in the name of one important variable (from p.value to PValue)
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
965 breaking this and all other code that assumed the old name for this variable,
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
966 between edgeR2.4.4 and 2.4.6 (the version for R 2.14 as at the time of writing).
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
967 This means that all code using edgeR is sensitive to the version. I think this was a very unwise thing
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
968 to do because it wasted hours of my time to track down and will similarly cost other edgeR users dearly
474c08e747b6 Uploaded
iuc
parents:
diff changeset
969 when their old scripts break. This tool currently now works with 2.4.6.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
970
474c08e747b6 Uploaded
iuc
parents:
diff changeset
971 **Note on prior.N**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
972
474c08e747b6 Uploaded
iuc
parents:
diff changeset
973 http://seqanswers.com/forums/showthread.php?t=5591 says:
474c08e747b6 Uploaded
iuc
parents:
diff changeset
974
474c08e747b6 Uploaded
iuc
parents:
diff changeset
975 *prior.n*
474c08e747b6 Uploaded
iuc
parents:
diff changeset
976
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
977 The value for prior.n determines the amount of smoothing of tagwise dispersions towards the common dispersion.
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
978 You can think of it as like a "weight" for the common value. (It is actually the weight for the common likelihood
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
979 in the weighted likelihood equation). The larger the value for prior.n, the more smoothing, i.e. the closer your
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
980 tagwise dispersion estimates will be to the common dispersion. If you use a prior.n of 1, then that gives the
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
981 common likelihood the weight of one observation.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
982
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
983 In answer to your question, it is a good thing to squeeze the tagwise dispersions towards a common value,
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
984 or else you will be using very unreliable estimates of the dispersion. I would not recommend using the value that
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
985 you obtained from estimateSmoothing()---this is far too small and would result in virtually no moderation
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
986 (squeezing) of the tagwise dispersions. How many samples do you have in your experiment?
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
987 What is the experimental design? If you have few samples (less than 6) then I would suggest a prior.n of at least 10.
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
988 If you have more samples, then the tagwise dispersion estimates will be more reliable,
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
989 so you could consider using a smaller prior.n, although I would hesitate to use a prior.n less than 5.
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
990
474c08e747b6 Uploaded
iuc
parents:
diff changeset
991
474c08e747b6 Uploaded
iuc
parents:
diff changeset
992 From Bioconductor Digest, Vol 118, Issue 5, Gordon writes:
474c08e747b6 Uploaded
iuc
parents:
diff changeset
993
474c08e747b6 Uploaded
iuc
parents:
diff changeset
994 Dear Dorota,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
995
474c08e747b6 Uploaded
iuc
parents:
diff changeset
996 The important settings are prior.df and trend.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
997
474c08e747b6 Uploaded
iuc
parents:
diff changeset
998 prior.n and prior.df are related through prior.df = prior.n * residual.df,
474c08e747b6 Uploaded
iuc
parents:
diff changeset
999 and your experiment has residual.df = 36 - 12 = 24. So the old setting of
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1000 prior.n=10 is equivalent for your data to prior.df = 240, a very large
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1001 value. Going the other way, the new setting of prior.df=10 is equivalent
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1002 to prior.n=10/24.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1003
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1004 To recover old results with the current software you would use
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1005
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1006 estimateTagwiseDisp(object, prior.df=240, trend="none")
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1007
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1008 To get the new default from old software you would use
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1009
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1010 estimateTagwiseDisp(object, prior.n=10/24, trend=TRUE)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1011
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1012 Actually the old trend method is equivalent to trend="loess" in the new
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1013 software. You should use plotBCV(object) to see whether a trend is
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1014 required.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1015
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1016 Note you could also use
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1017
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1018 prior.n = getPriorN(object, prior.df=10)
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1019
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1020 to map between prior.df and prior.n.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1021
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1022 ----
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1023
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1024 **Attributions**
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1025
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
1026 edgeR - edgeR_
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1027
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
1028 VOOM/limma - limma_VOOM_
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1029
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1030 DESeq2 - DESeq2_ for details
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1031
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1032 See above for Bioconductor package documentation for packages exposed in Galaxy by this tool and app store package.
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1033
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
1034 Galaxy_ (that's what you are using right now!) for gluing everything together
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1035
149
3107df74056e planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/differential_count_models commit 344140b8df53b8b7024618bb04594607a045c03a
iuc
parents: 146
diff changeset
1036 Otherwise, all code and documentation comprising this tool was written by Ross Lazarus and is
146
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1037 licensed to you under the LGPL_ like other rgenetics artefacts
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1038
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1039 .. _LGPL: http://www.gnu.org/copyleft/lesser.html
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1040 .. _HTSeq: http://www-huber.embl.de/users/anders/HTSeq/doc/index.html
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1041 .. _edgeR: http://www.bioconductor.org/packages/release/bioc/html/edgeR.html
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1042 .. _DESeq2: http://www.bioconductor.org/packages/release/bioc/html/DESeq2.html
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1043 .. _limma_VOOM: http://www.bioconductor.org/packages/release/bioc/html/limma.html
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1044 .. _Galaxy: http://getgalaxy.org
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1045 </help>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1046 <citations>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1047 <citation type="doi">doi: 10.1093/bioinformatics/btp616</citation>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1048 </citations>
474c08e747b6 Uploaded
iuc
parents:
diff changeset
1049 </tool>