# HG changeset patch # User iuc # Date 1546107684 18000 # Node ID 7b7303fa20e3087c9a06b7a49b15de02181643a5 # Parent 59ebf2c42c0e30a27475793ab50657a43ea308fe planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit c2b155f1fd4470ddecb5bd1c6e2c54dd46bfeaed diff -r 59ebf2c42c0e -r 7b7303fa20e3 volcanoplot.R --- a/volcanoplot.R Tue Oct 23 06:57:26 2018 -0400 +++ b/volcanoplot.R Sat Dec 29 13:21:24 2018 -0500 @@ -48,20 +48,26 @@ results <- results[order(results$Pvalue),] if (!is.null(opt$label_file)) { labelfile <- read.delim(opt$label_file) + # label genes specified in file tolabel <- filter(results, labels %in% labelfile[, 1]) -} else if (!is.null(opt$top_num)) { - tolabel <- filter(results, fdr% top_n(opt$top_num) -} else { +} else if (is.null(opt$top_num)) { + # label all significant genes tolabel <- filter(results, fdr 0) { + # label only top significant genes + tolabel <- filter(results, fdr% + top_n(n=opt$top_num, Pvalue) +} else if (opt$top_num == 0) { + # no labels + tolabel <- NULL } pdf("out.pdf") p <- ggplot(results, aes(logFC, -log10(Pvalue))) + geom_point(aes(col=sig)) + - geom_label_repel(data=tolabel, aes(label=labels, fill=factor(sig)), colour="white", segment.colour="black", show.legend=FALSE) + scale_color_manual(values=colours) + scale_fill_manual(values=colours) + - theme(panel.grid.major = element_blank(), + theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank(), panel.background = element_blank(), axis.line = element_line(colour = "black"), @@ -80,6 +86,9 @@ } else { p <- p + labs(colour="") } +if (!is.null(tolabel)) { + p <- p + geom_label_repel(data=tolabel, aes(label=labels, fill=factor(sig)), colour="white", segment.colour="black", show.legend=FALSE) +} print(p) dev.off() diff -r 59ebf2c42c0e -r 7b7303fa20e3 volcanoplot.xml --- a/volcanoplot.xml Tue Oct 23 06:57:26 2018 -0400 +++ b/volcanoplot.xml Sat Dec 29 13:21:24 2018 -0500 @@ -1,4 +1,4 @@ - + create a volcano plot r-ggplot2 @@ -22,8 +22,12 @@ -x $lfc_thresh #if $labels.label_select == 'file': -f '$labels.label_file' - #else if $labels.top_num: - -t $labels.top_num + #else if $labels.label_select == 'signif': + #if $labels.top_num: + -t $labels.top_num + #end if + #else + -t 0 #end if #if $plot_options.title: -T '$plot_options.title' @@ -49,12 +53,13 @@ - - + + + - + @@ -119,7 +124,7 @@ * Log fold change * Labels (e.g. Gene symbols or IDs) -All points meeting the specified significance threshold will be labelled by default with the values in the Labels columns. Users can select to only label the top significant points under **Plot Options** or only to label certain points through providing a tabular labels file. The labels file must contin a header row and have the labels in the first column. These labels must match the labels in the main input file. If no labels are desired specify 0 for "Only label top most signifcant". If a log fold change (lfc) threshold is specified, points that meet the significance threshold and lfc threshold will be coloured red if upregulated and blue if downregulated. +All significant points, those meeting the specified FDR and Log Fold Change thresholds, will be coloured, red for upregulated, blue for downregulated. Users can choose to apply labels to the points (such as gene symbols) from the Labels column. To label all significant points, select "Significant" for the **Points to label** option, or to only label the top most significant specify a number under "Only label top most significant". Users can label any points of interest through selecting **Points to label** "Input from file" and providing a tabular labels file. The labels file must contain a header row and have the labels in the first column. These labels must match the labels in the main input file. **Outputs**