Repository 'volcanoplot'
hg clone https://toolshed.g2.bx.psu.edu/repos/iuc/volcanoplot

Changeset 0:59ebf2c42c0e (2018-10-23)
Next changeset 1:7b7303fa20e3 (2018-12-29)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 7cc1a05f2868f270bf5bdbbd4820ef6f69c9fc8d
added:
static/images/volcano_plot.png
test-data/input.tab
test-data/labels.tab
test-data/out.pdf
test-data/out2.pdf
volcanoplot.R
volcanoplot.xml
b
diff -r 000000000000 -r 59ebf2c42c0e static/images/volcano_plot.png
b
Binary file static/images/volcano_plot.png has changed
b
diff -r 000000000000 -r 59ebf2c42c0e test-data/input.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/input.tab Tue Oct 23 06:57:26 2018 -0400
b
b'@@ -0,0 +1,16407 @@\n+Gene\tlog2FoldChange\tpvalue\tpadj\n+DOK6\t0.51\t1.861e-08\t0.0003053\n+TBX5\t-2.129\t5.655e-08\t0.0004191\n+SLC32A1\t0.9003\t7.664e-08\t0.0004191\n+IFITM1\t-1.687\t3.735e-06\t0.006809\n+NUP93\t0.3659\t3.373e-06\t0.006809\n+EMILIN2\t1.534\t2.976e-06\t0.006809\n+TPX2\t-0.9974\t2.097e-06\t0.006809\n+LAMA2\t-1.425\t2.39e-06\t0.006809\n+CAV2\t-1.052\t3.213e-06\t0.006809\n+TNN\t-1.658\t8.973e-06\t0.01472\n+POU3F4\t1.181\t1.062e-05\t0.01584\n+COL13A1\t-1.647\t1.394e-05\t0.01592\n+IFITM3\t-1.61\t1.202e-05\t0.01592\n+SHISA3\t-1.477\t1.31e-05\t0.01592\n+LOC285954\t1.05\t1.456e-05\t0.01592\n+VEPH1\t1.137\t2.211e-05\t0.02267\n+ARHGAP29\t-1.526\t3.675e-05\t0.03547\n+KIAA1755\t-1.562\t3.972e-05\t0.0362\n+LAMC3\t-1.563\t4.29e-05\t0.03704\n+ITM2A\t-1.398\t4.972e-05\t0.04078\n+DTHD1\t1.54\t5.594e-05\t0.04371\n+RBMS1\t-0.9139\t6.688e-05\t0.04988\n+CEBPD\t-1.202\t7.859e-05\t0.05606\n+DMBX1\t-1.425\t9.529e-05\t0.06486\n+PAPLN\t-1.253\t9.883e-05\t0.06486\n+ADM\t-1.357\t0.0001089\t0.06872\n+COL2A1\t-1.187\t0.0001424\t0.07794\n+HS3ST3A1\t-1.004\t0.0001388\t0.07794\n+DYSF\t-1.03\t0.0001425\t0.07794\n+PI16\t1.495\t0.0001297\t0.07794\n+CDC42EP5\t-1.355\t0.0001581\t0.08146\n+SLC12A8\t-0.9425\t0.0001589\t0.08146\n+ZNF391\t-1.024\t0.0001913\t0.09512\n+GALNTL2\t1.075\t0.0002298\t0.1109\n+C4orf45\t1.288\t0.0002472\t0.1159\n+KIF18B\t-0.8849\t0.0002551\t0.1162\n+KIF20A\t-0.9505\t0.0002972\t0.1318\n+PDE1B\t1.053\t0.0003356\t0.1449\n+BCAN\t1.117\t0.0003698\t0.1477\n+APLNR\t-1.365\t0.000378\t0.1477\n+CILP\t-1.11\t0.0003582\t0.1477\n+TEC\t-1.373\t0.0003701\t0.1477\n+KLF5\t-0.8177\t0.0004159\t0.1578\n+ACSS2\t-0.5578\t0.0004232\t0.1578\n+RAPGEF2\t0.3371\t0.0004513\t0.1645\n+C1orf51\t-0.6451\t0.0005237\t0.1665\n+IGF2-AS1\t-1.235\t0.0005835\t0.1665\n+RPLP0P2\t-1.096\t0.0005689\t0.1665\n+COTL1\t-0.7376\t0.0005886\t0.1665\n+MYO1D\t-0.8454\t0.0005529\t0.1665\n+CIAO1\t0.2695\t0.000522\t0.1665\n+POU3F3\t0.6857\t0.000588\t0.1665\n+CFLAR\t-0.9694\t0.0005598\t0.1665\n+BHLHE40\t-1.127\t0.0004785\t0.1665\n+PLSCR4\t-1.317\t0.0004978\t0.1665\n+HECW1\t0.5135\t0.0005373\t0.1665\n+KCNQ3\t1.147\t0.000483\t0.1665\n+TIMP1\t-1.15\t0.0005267\t0.1665\n+CAV1\t-1.115\t0.0006722\t0.1869\n+LTBP4\t-0.8186\t0.0006991\t0.1912\n+HDAC1\t-0.4542\t0.0007203\t0.1937\n+HSPG2\t-1.218\t0.0007963\t0.1947\n+CYR61\t-1.102\t0.0008071\t0.1947\n+MYOF\t-1.194\t0.0007397\t0.1947\n+COL4A1\t-1.252\t0.0007866\t0.1947\n+NMB\t0.8677\t0.0007872\t0.1947\n+ICAM1\t-1.144\t0.0007795\t0.1947\n+NOTCH3\t-0.7585\t0.0007529\t0.1947\n+MPPED2\t0.5135\t0.0008344\t0.1984\n+COL9A1\t-0.9755\t0.0008905\t0.2087\n+ACSF2\t-1.142\t0.0009448\t0.2183\n+KTN1\t-0.3119\t0.0009652\t0.2199\n+ITPR1\t-1.118\t0.00102\t0.226\n+PRPS2\t-0.722\t0.00101\t0.226\n+FAM180B\t1.249\t0.001146\t0.2399\n+POU2F3\t-1.273\t0.001114\t0.2399\n+COL5A2\t-1.262\t0.001155\t0.2399\n+ZSWIM3\t0.438\t0.001143\t0.2399\n+CADM2\t0.643\t0.001102\t0.2399\n+ARHGEF17\t-0.5462\t0.001214\t0.2453\n+SSC5D\t-1.126\t0.001229\t0.2453\n+NRN1\t0.8605\t0.001241\t0.2453\n+PLAT\t-1.103\t0.001226\t0.2453\n+SFXN2\t-0.8373\t0.00126\t0.2456\n+FMNL2\t-0.2466\t0.001276\t0.2456\n+ADAMTS3\t-0.6153\t0.001288\t0.2456\n+ADAMTS19\t-1.199\t0.001348\t0.2543\n+SH3BP1\t-0.9641\t0.001367\t0.2548\n+LEFTY2\t-1.225\t0.001414\t0.2578\n+EHBP1\t0.3191\t0.001414\t0.2578\n+UAP1L1\t-1.113\t0.001454\t0.2622\n+RAB27A\t-1.073\t0.001516\t0.2702\n+ZNF213\t0.3028\t0.001604\t0.28\n+TOMM34\t-0.4213\t0.001596\t0.28\n+PERP\t-0.914\t0.001672\t0.2888\n+OSMR\t-1.226\t0.001749\t0.2988\n+CDCA3\t-0.7986\t0.001911\t0.3119\n+GPR179\t0.8394\t0.001972\t0.3119\n+TMC6\t-1.078\t0.001977\t0.3119\n+STXBP5L\t0.6711\t0.001936\t0.3119\n+HSPA1L\t0.8842\t0.001851\t0.3119\n+PLIN2\t-0.604\t0.001866\t0.3119\n+GSN\t-1.117\t0.001977\t0.3119\n+F8A1\t0.9911\t0.00191\t0.3119\n+SLC27A6\t-1.196\t0.001998\t0.3121\n+COL4A2\t-1.013\t0.002192\t0.3157\n+WFDC1\t-1.162\t0.002149\t0.3157\n+DSEL\t0.6867\t0.002194\t0.3157\n+DOCK6\t-0.8158\t0.002172\t0.3157\n+MAN2B1\t-0.4688\t0.002099\t0.3157\n+NFKBIZ\t-0.888\t0.002132\t0.3157\n+OCIAD2\t0.7605\t0.002108\t0.3157\n+REST\t-0.5478\t0.002073\t0.3157\n+ANXA5\t-0.8639\t0.002075\t0.3157\n+TRIM13\t0.3688\t0.002254\t0.3216\n+ANLN\t-0.7229\t0.002306\t0.3261\n+AP1S3\t-0.8107\t0.002352\t0.3271\n+LOC100859930\t0.9008\t0.002343\t0.3271\n+STK17B\t-0.887\t0.00238\t0.3281\n+BHLHB9\t0.4738\t0.002441\t0.3337\n+IL1R1\t-1.185\t0.00248\t0.3362\n+CSDA\t-0.7633\t0.002833\t0.35\n+POSTN\t-1.176\t0.002706\t0.35\n+HHIPL1\t0.8127\t0.002742\t0.35\n+APBA2\t0.4314\t0.002752\t0.35\n+CBLN1\t1.066\t0.002768\t0.35\n+ALPK2\t-1.1'..b'AS1\t-0.002239\t0.9948\t0.9996\n+PARG\t0.0008872\t0.9933\t0.9996\n+ANAPC16\t-0.0007184\t0.996\t0.9996\n+CHCHD1\t-0.0003005\t0.9983\t0.9996\n+GHITM\t0.001448\t0.9937\t0.9996\n+WAPAL\t0.001466\t0.9943\t0.9996\n+TAF5\t0.002798\t0.9922\t0.9996\n+SORCS1\t0.0009783\t0.997\t0.9996\n+TCERG1L\t0.001615\t0.9952\t0.9996\n+NKX6-2\t-0.0008079\t0.9984\t0.9996\n+HBBP1\t-0.002008\t0.9939\t0.9996\n+TRIM66\t-0.001007\t0.9977\t0.9996\n+DAK\t0.001217\t0.9964\t0.9996\n+PDE2A\t0.003856\t0.9917\t0.9996\n+USP35\t-0.001857\t0.9946\t0.9996\n+GPR83\t0.002159\t0.9951\t0.9996\n+ENDOD1\t0.002419\t0.9942\t0.9996\n+LOC100507424\t-0.00107\t0.9977\t0.9996\n+NTF3\t-0.001251\t0.9974\t0.9996\n+HTR7P1\t0.0009986\t0.998\t0.9996\n+DNM1L\t-0.001273\t0.992\t0.9996\n+SLC38A2\t0.0003228\t0.9985\t0.9996\n+MCRS1\t-0.001476\t0.993\t0.9996\n+LOC100240734\t0.002675\t0.9945\t0.9996\n+TSPAN31\t0.0008547\t0.9961\t0.9996\n+MED13L\t0.00217\t0.9934\t0.9996\n+CPB2\t0.002953\t0.9939\t0.9996\n+RAP2A\t-0.0004082\t0.9972\t0.9996\n+RAB2B\t0.001374\t0.995\t0.9996\n+ACTR10\t-0.0004557\t0.9986\t0.9996\n+EFCAB11\t0.0008383\t0.9982\t0.9996\n+SLC25A47\t0.002553\t0.9946\t0.9996\n+NDNL2\t0.001534\t0.9936\t0.9996\n+MGA\t0.001088\t0.9956\t0.9996\n+LRRC57\t0.000468\t0.9985\t0.9996\n+PPIP5K1\t0.001302\t0.9954\t0.9996\n+PAQR5\t0.002054\t0.9957\t0.9996\n+NEO1\t0.001641\t0.9947\t0.9996\n+UBE2Q2\t0.0009179\t0.9964\t0.9996\n+SNRNP25\t-0.002516\t0.9941\t0.9996\n+COG7\t-0.0007377\t0.9961\t0.9996\n+DHODH\t-0.0006192\t0.9974\t0.9996\n+YWHAE\t0.001269\t0.9923\t0.9996\n+PEMT\t-0.0003723\t0.998\t0.9996\n+ALKBH5\t0.00143\t0.9957\t0.9996\n+CWC25\t0.00192\t0.9932\t0.9996\n+CARD14\t-0.003995\t0.9915\t0.9996\n+PPP4R1\t-0.000582\t0.998\t0.9996\n+MEX3D\t-0.0007018\t0.9969\t0.9996\n+ZNF433\t0.001903\t0.9925\t0.9996\n+ETV2\t-0.0006367\t0.9982\t0.9996\n+HIF3A\t-0.001561\t0.9959\t0.9996\n+TULP2\t0.002308\t0.995\t0.9996\n+PRMT1\t-0.001814\t0.9939\t0.9996\n+KCNC3\t-0.001947\t0.9959\t0.9996\n+C19orf51\t0.002026\t0.9958\t0.9996\n+ZNF773\t-0.003241\t0.9913\t0.9996\n+SRSF7\t0.002883\t0.9919\t0.9996\n+C2orf74\t0.001012\t0.997\t0.9996\n+CD207\t0.0006884\t0.9986\t0.9996\n+COPS7B\t0.001438\t0.9931\t0.9996\n+MSL3P1\t0.00214\t0.9953\t0.9996\n+ING5\t-0.001838\t0.9942\t0.9996\n+PYGB\t0.0003786\t0.9972\t0.9996\n+B4GALT5\t0.0008644\t0.9974\t0.9996\n+TMPRSS15\t-0.001422\t0.9971\t0.9996\n+SH3BGR\t-0.0006994\t0.9974\t0.9996\n+RRP1B\t0.000589\t0.9956\t0.9996\n+DIP2A\t-0.001075\t0.9963\t0.9996\n+MTFP1\t-0.0007746\t0.9976\t0.9996\n+EP300\t-0.0003846\t0.9982\t0.9996\n+PACSIN2\t-0.001144\t0.9917\t0.9996\n+HIGD1A\t-0.00144\t0.9942\t0.9996\n+GNAT1\t0.0007149\t0.9985\t0.9996\n+FAM208A\t0.0005188\t0.9984\t0.9996\n+ID2B\t-0.00391\t0.992\t0.9996\n+RSRC1\t0.0004531\t0.9983\t0.9996\n+GPR160\t0.00134\t0.9971\t0.9996\n+TNK2\t-0.001609\t0.996\t0.9996\n+SENP5\t-0.0003959\t0.9986\t0.9996\n+SLBP\t-0.0007454\t0.9963\t0.9996\n+C4orf19\t0.003242\t0.9934\t0.9996\n+TMEM33\t0.001515\t0.9923\t0.9996\n+LRRC66\t-0.0006605\t0.9985\t0.9996\n+NPY5R\t-0.002376\t0.9952\t0.9996\n+NDUFS6\t-0.0009438\t0.9936\t0.9996\n+ZNF622\t0.001756\t0.9924\t0.9996\n+FAM151B\t0.002005\t0.9956\t0.9996\n+RBM27\t-0.001799\t0.9931\t0.9996\n+TIGD6\t0.002251\t0.9943\t0.9996\n+FAM114A2\t0.0006701\t0.9984\t0.9996\n+LOC100507194\t-0.004099\t0.9916\t0.9996\n+PRRC2A\t0.0007916\t0.9938\t0.9996\n+TAF11\t0.000735\t0.9956\t0.9996\n+PXT1\t-0.002307\t0.9952\t0.9996\n+GLP1R\t-0.001237\t0.9971\t0.9996\n+TCP1\t-0.00206\t0.9931\t0.9996\n+CCM2\t-0.000938\t0.9955\t0.9996\n+WBSCR16\t0.001843\t0.9928\t0.9996\n+LOC155060\t-0.003811\t0.9916\t0.9996\n+C8orf42\t0.001161\t0.9975\t0.9996\n+CSGALNACT1\t-0.001458\t0.9967\t0.9996\n+PPAPDC1B\t0.0008906\t0.9974\t0.9996\n+LINC00535\t0.003013\t0.9929\t0.9996\n+VPS28\t0.0005436\t0.9965\t0.9996\n+DNAJC25\t-0.000678\t0.9974\t0.9996\n+TSC1\t0.001054\t0.9962\t0.9996\n+RLIM\t-0.001962\t0.9932\t0.9996\n+TAF9B\t-0.002379\t0.9915\t0.9996\n+DDX3Y\t-0.001194\t0.996\t0.9996\n+ZNRF2\t0.0002994\t0.9988\t0.9998\n+FNDC5\t0.0003447\t0.9991\t0.9998\n+KANSL2\t0.0002676\t0.9992\t0.9998\n+ISCU\t0.0001513\t0.9992\t0.9998\n+CUEDC1\t-0.0002373\t0.999\t0.9998\n+ZNF559\t0.0002839\t0.9994\t0.9998\n+LUST\t0.0003314\t0.9993\t0.9998\n+ZNF346\t0.0001664\t0.999\t0.9998\n+LOC100128750\t-0.0004801\t0.999\t0.9998\n+USP11\t-0.0003655\t0.9991\t0.9998\n+N4BP1\t-0.0001139\t0.9994\t0.9998\n+CIRBP-AS1\t0.0002081\t0.9995\t0.9998\n+PKLR\t-0.0001906\t0.9996\t0.9999\n+OBFC1\t-4.637e-05\t0.9998\t0.9999\n+FKBP8\t-5.51e-05\t0.9997\t0.9999\n+LRMP\t-3.651e-05\t0.9999\t1\n+OXSM\t8.828e-06\t1\t1\n\\ No newline at end of file\n'
b
diff -r 000000000000 -r 59ebf2c42c0e test-data/labels.tab
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-data/labels.tab Tue Oct 23 06:57:26 2018 -0400
b
@@ -0,0 +1,11 @@
+Gene log2FoldChange pvalue padj
+DOK6 0.51 1.861e-08 0.0003053
+TBX5 -2.129 5.655e-08 0.0004191
+SLC32A1 0.9003 7.664e-08 0.0004191
+IFITM1 -1.687 3.735e-06 0.006809
+NUP93 0.3659 3.373e-06 0.006809
+EMILIN2 1.534 2.976e-06 0.006809
+TPX2 -0.9974 2.097e-06 0.006809
+LAMA2 -1.425 2.39e-06 0.006809
+CAV2 -1.052 3.213e-06 0.006809
+TNN -1.658 8.973e-06 0.01472
b
diff -r 000000000000 -r 59ebf2c42c0e test-data/out.pdf
b
Binary file test-data/out.pdf has changed
b
diff -r 000000000000 -r 59ebf2c42c0e test-data/out2.pdf
b
Binary file test-data/out2.pdf has changed
b
diff -r 000000000000 -r 59ebf2c42c0e volcanoplot.R
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/volcanoplot.R Tue Oct 23 06:57:26 2018 -0400
[
@@ -0,0 +1,88 @@
+# setup R error handling to go to stderr
+options( show.error.messages=F, error = function () { cat( geterrmessage(), file=stderr() ); q( "no", 1, F ) } )
+
+# we need that to not crash galaxy with an UTF8 error on German LC settings.
+loc <- Sys.setlocale("LC_MESSAGES", "en_US.UTF-8")
+
+suppressPackageStartupMessages({
+    library(dplyr)
+    library(getopt)
+    library(ggplot2)
+    library(ggrepel)
+})
+
+options(stringAsFactors = FALSE, useFancyQuotes = FALSE)
+args <- commandArgs(trailingOnly = TRUE)
+
+spec <- matrix(c(
+    "input", "i", 1, "character",
+    "fdr_col", "a", 1, "integer",
+    "pval_col", "p", 1, "integer",
+    "lfc_col", "c", 1, "integer",
+    "label_col", "l", 1, "integer",
+    "signif_thresh", "s", 1, "double",
+    "lfc_thresh", "x", 1, "double",
+    "label_file", "f", 1, "character",
+    "top_num", "t", 1, "integer",
+    "title", "T", 1, "character",
+    "xlab", "X", 1, "character",
+    "ylab", "Y", 1, "character",
+    "legend", "L", 1, "character",
+    "llabs", "z", 1, "character"),
+    byrow=TRUE, ncol=4)
+opt <- getopt(spec)
+
+# Below modified from http://www.gettinggeneticsdone.com/2016/01/repel-overlapping-text-labels-in-ggplot2.html
+
+results <- read.delim(opt$input)
+results$fdr <- results[, opt$fdr_col]
+results$Pvalue <- results[, opt$pval_col]
+results$logFC <- results[, opt$lfc_col]
+results$labels <- results[, opt$label_col]
+label_down <- unlist(strsplit(opt$llabs, split=","))[1]
+label_notsig <- unlist(strsplit(opt$llabs, split=","))[2]
+label_up <- unlist(strsplit(opt$llabs, split=","))[3]
+colours <- setNames(c("cornflowerblue","grey","firebrick"),c(label_down,label_notsig,label_up))
+
+results <- mutate(results, sig=ifelse((fdr<opt$signif_thresh & logFC>opt$lfc_thresh), label_up, ifelse((fdr<opt$signif_thresh & logFC < -opt$lfc_thresh),label_down, label_notsig)))
+results <- results[order(results$Pvalue),]
+if (!is.null(opt$label_file)) {
+    labelfile <- read.delim(opt$label_file)
+    tolabel <- filter(results, labels %in% labelfile[, 1])
+} else if (!is.null(opt$top_num)) {
+    tolabel <- filter(results, fdr<opt$signif_thresh) %>% top_n(opt$top_num)
+} else {
+    tolabel <- filter(results, fdr<opt$signif_thresh)
+}
+
+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(), 
+        panel.grid.minor = element_blank(),
+        panel.background = element_blank(),
+        axis.line = element_line(colour = "black"),
+        legend.key=element_blank())
+if (!is.null(opt$title)) {
+    p <- p + ggtitle(opt$title)
+}
+if (!is.null(opt$xlab)) {
+    p <- p + xlab(opt$xlab)
+}
+if (!is.null(opt$ylab)) {
+    p <- p + ylab(opt$ylab)
+}
+if (!is.null(opt$legend)) {
+    p <- p + labs(colour=opt$legend)
+} else {
+    p <- p + labs(colour="")
+}
+
+print(p)
+dev.off()
+
+cat("Session information:\n\n")
+sessionInfo()
\ No newline at end of file
b
diff -r 000000000000 -r 59ebf2c42c0e volcanoplot.xml
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/volcanoplot.xml Tue Oct 23 06:57:26 2018 -0400
[
b'@@ -0,0 +1,135 @@\n+<tool id="volcanoplot" name="Volcano Plot" version="0.0.1">\n+    <description>create a volcano plot</description>\n+    <requirements>\n+        <requirement type="package" version="3.0.0">r-ggplot2</requirement>\n+        <requirement type="package" version="0.8.0">r-ggrepel</requirement>\n+        <requirement type="package" version="0.7.6">r-dplyr</requirement>\n+        <requirement type="package" version="1.20.2">r-getopt</requirement>\n+    </requirements>\n+    <version_command><![CDATA[\n+echo $(R --version | grep version | grep -v GNU)", ggplot2 version" $(R --vanilla --slave -e "library(ggplot2); cat(sessionInfo()\\$otherPkgs\\$ggplot2\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", ggrepel version" $(R --vanilla --slave -e "library(ggrepel); cat(sessionInfo()\\$otherPkgs\\$ggrepel\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", dplyr version" $(R --vanilla --slave -e "library(dplyr); cat(sessionInfo()\\$otherPkgs\\$dplyr\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")", getopt version" $(R --vanilla --slave -e "library(getopt); cat(sessionInfo()\\$otherPkgs\\$getopt\\$Version)" 2> /dev/null | grep -v -i "WARNING: ")\n+    ]]></version_command>\n+    <command detect_errors="exit_code"><![CDATA[\n+\n+Rscript \'${__tool_directory__}/volcanoplot.R\'\n+\n+    -i \'$input\'\n+    -a $fdr_col\n+    -p $pval_col\n+    -c $lfc_col\n+    -l $label_col\n+    -s $signif_thresh\n+    -x $lfc_thresh\n+    #if $labels.label_select == \'file\':\n+        -f \'$labels.label_file\'\n+    #else if $labels.top_num:\n+        -t $labels.top_num\n+    #end if\n+    #if $plot_options.title:\n+        -T \'$plot_options.title\'\n+    #end if\n+    #if $plot_options.xlab:\n+        -X \'$plot_options.xlab\'\n+    #end if\n+    #if $plot_options.ylab:\n+        -Y \'$plot_options.ylab\'\n+    #end if\n+    #if $plot_options.legend:\n+        -L \'$plot_options.legend\'\n+    #end if\n+    -z \'$plot_options.legend_labs\'\n+\n+]]></command>\n+    <inputs>\n+        <param name="input" type="data" format="tabular" label="Specify an input file" />\n+        <param name="fdr_col" type="data_column" data_ref="input" label="FDR (adjusted P value)" />\n+        <param name="pval_col" type="data_column" data_ref="input" label="P value (raw)" />\n+        <param name="lfc_col" type="data_column" data_ref="input" label="Log Fold Change" />\n+        <param name="label_col" type="data_column" data_ref="input" label="Labels" />\n+        <param name="signif_thresh" type="float" max="1" value="0.05" label="Significance threshold" help="Default: 0.05"/>\n+        <param name="lfc_thresh" type="float" value="0" label="LogFC threshold to colour" help="Default: 0"/>\n+        <conditional name="labels">\n+            <param name="label_select" type="select" label="Points to label" help="Select to label top significant points or input labels from file. All points meeting the significance threshold are labelled by default.">\n+                <option value="signif" selected="True">Significant</option>\n+                <option value="file">Input from file</option>\n+            </param>\n+            <when value="signif">\n+                <param name="top_num" type="integer" optional="True" label="Only label top most significant" help="Specify the top number of points to label by P value significance"/>\n+            </when>\n+            <when value="file">\n+                <param name="label_file" type="data" format="tabular" label="File of labels"/>\n+            </when>\n+        </conditional>\n+        <section name="plot_options" expanded="false" title="Plot Options">\n+            <param name="title" type="text" optional="True" label="Plot title"/>\n+            <param name="xlab" type="text" optional="True" label="Label for x axis"/>\n+            <param name="ylab" type="text" optional="True" label="Label for y axis"/>\n+            <param name="legend" type="text" optional="True" label="Label for Legend Title"/>\n+            <param name="legend_labs" type="text" value="Down,Not Sig,Up" label="Labels for Lege'..b'ts>\n+        <test>\n+            <!-- Ensure default output works -->\n+            <param name="input" ftype="tabular" value="input.tab"/>\n+            <param name="fdr_col" value="4" />\n+            <param name="pval_col" value="3" />\n+            <param name="lfc_col" value="2" />\n+            <param name="label_col" value="1" />\n+            <param name="lfc_thresh" value="0" />\n+            <output name="plot" value= "out.pdf" compare="sim_size" />\n+        </test>\n+        <test>\n+            <!-- Ensure input labels and plot options work -->\n+            <param name="input" ftype="tabular" value="input.tab"/>\n+            <param name="fdr_col" value="4" />\n+            <param name="pval_col" value="3" />\n+            <param name="lfc_col" value="2" />\n+            <param name="label_col" value="1" />\n+            <param name="lfc_thresh" value="0" />\n+            <param name="label_select" value="file"/>\n+            <param name="label_file" ftype="tabular" value="labels.tab" />\n+            <output name="plot" value= "out2.pdf" compare="sim_size" />\n+        </test>\n+    </tests>\n+    <help><![CDATA[\n+.. class:: infomark\n+\n+**What it does**\n+\n+This tool creates a Volcano plot using ggplot2. Points can be labelled via ggrepel.\n+\n+In statistics, a `Volcano plot`_ is a type of scatter-plot that is used to quickly identify changes in large data sets composed of replicate data. It plots significance versus fold-change on the y and x axes, respectively. These plots are increasingly common in omic experiments such as genomics, proteomics, and metabolomics where one often has a list of many thousands of replicate data points between two conditions and one wishes to quickly identify the most meaningful changes. A volcano plot combines a measure of statistical significance from a statistical test (e.g., a p value from an ANOVA model) with the magnitude of the change, enabling quick visual identification of those data-points (genes, etc.) that display large magnitude changes that are also statistically significant.\n+\n+A volcano plot is constructed by plotting the negative log of the p value on the y axis (usually base 10). This results in data points with low p values (highly significant) appearing toward the top of the plot. The x axis is the log of the fold change between the two conditions. The log of the fold change is used so that changes in both directions appear equidistant from the center. Plotting points in this way results in two regions of interest in the plot: those points that are found toward the top of the plot that are far to either the left- or right-hand sides. These represent values that display large magnitude fold changes (hence being left or right of center) as well as high statistical significance (hence being toward the top).\n+\n+Source: Wikipedia\n+\n+-----\n+\n+**Inputs**\n+\n+A tabular file with a header row containing the columns below (additional columns may be present):\n+\n+    * P value\n+    * FDR / adjusted P value\n+    * Log fold change\n+    * Labels (e.g. Gene symbols or IDs)\n+\n+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.\n+\n+**Outputs**\n+\n+A PDF containing a Volcano plot like below.\n+\n+.. image:: $PATH_TO_IMAGES/volcano_plot.png\n+\n+.. _Volcano plot: https://en.wikipedia.org/wiki/Volcano_plot_(statistics)\n+\n+    ]]></help>\n+    <citations>\n+    </citations>\n+</tool>\n\\ No newline at end of file\n'