# HG changeset patch # User yhoogstrate # Date 1408969395 14400 # Node ID c5cc1b24f7d8e4c0abaa97dcff79a3036dadff5f # Parent f20dc31afd5ed76a336e9df47fbfc33e68fa89f4 Uploaded diff -r f20dc31afd5e -r c5cc1b24f7d8 edgeR_Differential_Gene_Expression.xml --- a/edgeR_Differential_Gene_Expression.xml Mon Aug 25 08:14:33 2014 -0400 +++ b/edgeR_Differential_Gene_Expression.xml Mon Aug 25 08:23:15 2014 -0400 @@ -239,8 +239,6 @@ dev.off()# Kill it if(output_format_images == "pdf") { - capabilities() - ##x11() pdf(output_MDSplot) } else if(output_format_images == "svg") { svg(output_MDSplot) @@ -260,7 +258,15 @@ if(output_BCVplot != "/dev/null") { write("Creating Biological coefficient of variation plot",stdout()) - pdf(output_BCVplot) + + if(output_format_images == "pdf") { + pdf(output_BCVplot) + } else if(output_format_images == "svg") { + svg(output_BCVplot) + } else { + png(output_BCVplot) + } + plotBCV(dge, cex=0.4, main="edgeR: Biological coefficient of variation (BCV) vs abundance") dev.off() } @@ -281,14 +287,21 @@ ## todo EXPORT FPKM write.table(file=output_raw_counts,dge\$counts,sep="\t",row.names=TRUE,col.names=NA) - if(output_MAplot != "/dev/null" || output_PValue_distribution_plot != "/dev/null") { etable <- topTags(lrt, n=nrow(dge))\$table etable <- etable[order(etable\$FDR), ] if(output_MAplot != "/dev/null") { write("Creating MA plot...",stdout()) - pdf(output_MAplot) + + if(output_format_images == "pdf") { + pdf(output_MAplot) + } else if(output_format_images == "svg") { + svg(output_MAplot) + } else { + png(output_MAplot) + } + with(etable, plot(logCPM, logFC, pch=20, main="edgeR: Fold change vs abundance")) with(subset(etable, FDR < fdr), points(logCPM, logFC, pch=20, col="red")) abline(h=c(-1,1), col="blue") @@ -297,7 +310,15 @@ if(output_PValue_distribution_plot != "/dev/null") { write("Creating P-value distribution plot...",stdout()) - pdf(output_PValue_distribution_plot) + + if(output_format_images == "pdf") { + pdf(output_PValue_distribution_plot) + } else if(output_format_images == "svg") { + svg(output_PValue_distribution_plot) + } else { + png(output_PValue_distribution_plot) + } + expressed_genes <- subset(etable, PValue < 0.99) h <- hist(expressed_genes\$PValue,breaks=nrow(expressed_genes)/15,main="Binned P-Values (< 0.99)") center <- sum(h\$counts) / length(h\$counts) @@ -315,7 +336,15 @@ } if(output_heatmap_plot != "/dev/null") { - pdf(output_heatmap_plot,width=10.5) + + if(output_format_images == "pdf") { + pdf(output_heatmap_plot,width=10.5) + } else if(output_format_images == "svg") { + svg(output_heatmap_plot,width=10.5) + } else { + png(output_heatmap_plot,width=10.5) + } + etable2 <- topTags(lrt, n=100)\$table order <- rownames(etable2) cpm_sub <- cpm(dge,normalized.lib.sizes=TRUE,log=TRUE)[as.numeric(order),] @@ -352,24 +381,54 @@ - + outputs and ("make_output_BCVplot" in outputs) + + + + + + - + outputs and ("make_output_MAplot" in outputs) + + + + + + - + outputs and ("make_output_PValue_distribution_plot" in outputs) + + + + + + - + outputs and ("make_output_hierarchical_clustering_plot" in outputs) + + + + + + - + outputs and ("make_output_heatmap_plot" in outputs) + + + + + +