comparison edgeR_repenrich.R @ 6:83b5ea7cc342 draft

planemo upload for repository https://github.com/ARTbio/tools-artbio/tree/master/tools/repenrich commit e3c9f70fe670ee27d667cabd85bf820f63c94f7a
author artbio
date Fri, 07 Dec 2018 13:05:46 -0500
parents 15e3e29f310e
children 308591fd36e5
comparison
equal deleted inserted replaced
5:02a8941da83b 6:83b5ea7cc342
192 plotMDS(y, main="Multidimensional Scaling Plot Of Distances Between Samples") 192 plotMDS(y, main="Multidimensional Scaling Plot Of Distances Between Samples")
193 plotBCV(y, xlab="Gene abundance (Average log CPM)", main="Biological Coefficient of Variation Plot") 193 plotBCV(y, xlab="Gene abundance (Average log CPM)", main="Biological Coefficient of Variation Plot")
194 logFC <- results[, "logFC"] 194 logFC <- results[, "logFC"]
195 # Plot the repeat classes 195 # Plot the repeat classes
196 classes <- with(results, reorder(class, -logFC, median)) 196 classes <- with(results, reorder(class, -logFC, median))
197 classes
197 par(mar=c(6,10,4,1)) 198 par(mar=c(6,10,4,1))
198 boxplot(logFC ~ classes, data=results, outline=FALSE, horizontal=TRUE, 199 boxplot(logFC ~ classes, data=results, outline=FALSE, horizontal=TRUE,
199 las=2, xlab="log(Fold Change)", main=paste0(allcontrasts, ", by Class")) 200 las=2, xlab="log2(Fold Change)", main=paste0(allcontrasts, ", by Class"))
200 abline(v=0) 201 abline(v=0)
201 # Plot the repeat types 202 # Plot the repeat types
202 types <- with(results, reorder(type, -logFC, median)) 203 types <- with(results, reorder(type, -logFC, median))
203 boxplot(logFC ~ types, data=results, outline=FALSE, horizontal=TRUE, 204 boxplot(logFC ~ types, data=results, outline=FALSE, horizontal=TRUE,
204 las=2, xlab="log(Fold Change)", main=paste0(allcontrasts, ", by Type")) 205 las=2, xlab="log2(Fold Change)", main=paste0(allcontrasts, ", by Type"), yaxt="n")
206 axis(2, cex.axis=(1*16)/(length(levels(types))),
207 at=seq(from=1, to=length(levels(types))),
208 labels=levels(types), las=2)
205 abline(v=0) 209 abline(v=0)
210 # volcano plot
211 TEdata = cbind(rownames(results), as.data.frame(results), score=-log(results$FDR, 10))
212 colnames(TEdata) = c("Tag","log2FC", "FDR", "Class", "Type", "score")
213 color = ifelse(TEdata$FDR<0.05, "red", "black")
214 s <- subset(TEdata, FDR<0.01)
215 with(TEdata, plot(log2FC, score, pch=20, col=color, main="Volcano plot (all tag types)", ylab="-log10(FDR)"))
216 text(s[,2], s[,6], labels = s[,5], pos = seq(from=1, to=3), cex=0.5)
206 } 217 }
207 218
208 # close the plot device 219 # close the plot device
209 if (!is.null(opt$plots)) { 220 if (!is.null(opt$plots)) {
210 cat("closing plot device\n") 221 cat("closing plot device\n")