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

Changeset 10:99ace6c1ff57 (2024-12-11)
Previous changeset 9:ab01e379d29e (2024-12-09) Next changeset 11:5e08a1e22dbc (2025-01-29)
Commit message:
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 086dfdddb6fbf8acb98fdcc3654b0afee6eff442-dirty
modified:
test-data/out.rscript
volcanoplot.xml
removed:
test-data/category.tab
b
diff -r ab01e379d29e -r 99ace6c1ff57 test-data/category.tab
--- a/test-data/category.tab Mon Dec 09 16:04:24 2024 +0000
+++ /dev/null Thu Jan 01 00:00:00 1970 +0000
b
@@ -1,11 +0,0 @@
-Gene log2FoldChange pvalue padj category
-DOK6 0.51 1.861e-08 0.0003053 Category A
-TBX5 -2.129 5.655e-08 0.0004191 Category B
-SLC32A1 0.9003 7.664e-08 0.0004191 Category C
-IFITM1 -1.687 3.735e-06 0.006809 Category A
-NUP93 0.3659 3.373e-06 0.006809 Category B
-EMILIN2 1.534 2.976e-06 0.006809 Category C
-TPX2 -0.9974 2.097e-06 0.006809 Category A
-LAMA2 -1.425 2.39e-06 0.006809 Category B
-CAV2 -1.052 3.213e-06 0.006809 Category C
-TNN -1.658 8.973e-06 0.01472 Category A
\ No newline at end of file
b
diff -r ab01e379d29e -r 99ace6c1ff57 test-data/out.rscript
--- a/test-data/out.rscript Mon Dec 09 16:04:24 2024 +0000
+++ b/test-data/out.rscript Wed Dec 11 20:36:56 2024 +0000
[
@@ -20,20 +20,16 @@
 
 # Import data  ------------------------------------------------------------
 
-results <- read.delim('/tmp/tmpl4o1f_bf/files/5/2/5/dataset_52538741-d085-42da-817b-263bd4f7cf98.dat', header = TRUE)
+results <- read.delim('/private/var/folders/zn/m_qvr9zd7tq0wdtsbq255f8xypj_zg/T/tmprh4qip75/files/d/2/2/dataset_d2255b46-f0f6-4900-8b9e-bd352e34f303.dat', header = TRUE)
 
 
 # Format data  ------------------------------------------------------------
 
-# Create columns from the column numbers specified and use the existing category_symbol column for shapes
-results <- results %>% mutate(
-    fdr = .[[4]],
-    pvalue = .[[3]],
-    logfc = .[[2]],
-    labels = .[[1]],
-)
-
-# Check if shape_col is provided 
+# Create columns from the column numbers specified
+results <- results %>% mutate(fdr = .[[4]],
+                              pvalue = .[[3]],
+                              logfc = .[[2]],
+                              labels = .[[1]])
 
 # Get names for legend
 down <- unlist(strsplit('Down,Not Sig,Up', split = ","))[1]
@@ -53,7 +49,7 @@
 # Specify genes to label --------------------------------------------------
 
 # Import file with genes of interest
-labelfile <- read.delim('/tmp/tmpl4o1f_bf/files/5/d/4/dataset_5d401b02-f6af-4ed9-b853-992fd4a4d044.dat', header = TRUE)
+labelfile <- read.delim('/private/var/folders/zn/m_qvr9zd7tq0wdtsbq255f8xypj_zg/T/tmprh4qip75/files/5/e/5/dataset_5e5b8fb0-bf65-438e-9b5b-03a540d9aa5d.dat', header = TRUE)
 
 # Label the genes of interest in results table
 results <- mutate(results, labels = ifelse(labels %in% labelfile[, 1], labels, ""))
@@ -65,17 +61,15 @@
 # Open file to save plot as PDF
 pdf("volcano_plot.pdf")
 
-# Set up base plot with faceting by category_symbol instead of shapes
+# Set up base plot
 p <- ggplot(data = results, aes(x = logfc, y = -log10(pvalue))) +
+    geom_point(aes(colour = sig)) +
     scale_color_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()) 
-
-# Conditional logic to use either shape or facet based on user selection
-p <- p + geom_point(aes(colour = sig)) #only add color
+        panel.grid.minor = element_blank(),
+        panel.background = element_blank(),
+        axis.line = element_line(colour = "black"),
+        legend.key = element_blank())
 
 # Add gene labels
 p <- p + geom_text_repel(data = filter(results, labels != ""), aes(label = labels),
b
diff -r ab01e379d29e -r 99ace6c1ff57 volcanoplot.xml
--- a/volcanoplot.xml Mon Dec 09 16:04:24 2024 +0000
+++ b/volcanoplot.xml Wed Dec 11 20:36:56 2024 +0000
[
b'@@ -64,18 +64,11 @@\n \n # Format data  ------------------------------------------------------------\n \n-# Create columns from the column numbers specified and use the existing category_symbol column for shapes\n-results <- results %>% mutate(\n-    fdr = .[[$fdr_col]],\n-    pvalue = .[[$pval_col]],\n-    logfc = .[[$lfc_col]],\n-    labels = .[[$label_col]],\n-)\n-\n-# Check if shape_col is provided \n-#if $shape_col:\n-results <- results %>% mutate(category_symbol = .[[$shape_col]])  # Use the shape column if it exists\n-#end if\n+# Create columns from the column numbers specified\n+results <- results %>% mutate(fdr = .[[$fdr_col]],\n+                              pvalue = .[[$pval_col]],\n+                              logfc = .[[$lfc_col]],\n+                              labels = .[[$label_col]])\n \n # Get names for legend\n down <- unlist(strsplit(\'$plot_options.legend_labs\', split = ","))[1]\n@@ -127,25 +120,15 @@\n # Open file to save plot as PDF\n pdf("volcano_plot.pdf")\n \n-# Set up base plot with faceting by category_symbol instead of shapes\n+# Set up base plot\n p <- ggplot(data = results, aes(x = logfc, y = -log10(pvalue))) +\n+    geom_point(aes(colour = sig)) +\n     scale_color_manual(values = colours) +\n     theme(panel.grid.major = element_blank(),\n-          panel.grid.minor = element_blank(),\n-          panel.background = element_blank(),\n-          axis.line = element_line(colour = "black"),\n-          legend.key = element_blank()) \n-\n-# Conditional logic to use either shape or facet based on user selection\n-#if $shape_col:\n-if (\'$shape_or_facet\' == \'facet\') {\n-    p <- p + facet_wrap(~ category_symbol)  # Facet the plot based on category_symbol\n-} else {\n-    p <- p + geom_point(aes(colour = sig, shape = factor(category_symbol)))  # Use shapes for categories\n-}\n-#else:\n-p <- p + geom_point(aes(colour = sig)) #only add color\n-#end if\n+        panel.grid.minor = element_blank(),\n+        panel.background = element_blank(),\n+        axis.line = element_line(colour = "black"),\n+        legend.key = element_blank())\n \n #if $labels.label_select != "none"\n # Add gene labels\n@@ -212,11 +195,6 @@\n         <param name="pval_col" type="data_column" data_ref="input" label="P value (raw) column number" />\n         <param name="lfc_col" type="data_column" data_ref="input" label="Log Fold Change column number" />\n         <param name="label_col" type="data_column" data_ref="input" label="Labels column number" />\n-        <param name="shape_col" type="data_column" data_ref="input" label="Categories that can be used to plot different shapes or facet (useful if multivariable associations are investigated)" optional="true" />\n-        <param name="shape_or_facet" type="select" label="Display categories by:" help="Choose whether to display categories by faceting the plot or using shape." optional="true">\n-            <option value="facet">Facet</option>\n-            <option value="shape">Shape</option>\n-        </param>\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@@ -270,7 +248,6 @@\n                 </assert_contents>\n             </output>\n         </test>\n-\n         <test expect_num_outputs="1">\n             <!-- Ensure input labels and plot options work -->\n             <param name="input" ftype="tabular" value="input.tab"/>\n@@ -306,45 +283,6 @@\n             </output>\n             <output name="rscript" value= "out.rscript" lines_diff="4"/>\n         </test>\n-\n-    <test expect_num_outputs="1">\n-        <!-- Ensure input labels and plot options work with faceting -->\n-        <param name="input" ftype="tabular" value="category.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-        <para'..b' 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-Additionally, users can specify a `shape_col`, which allows the differentiation of points in the plot based on categorical variables. The shapes of the points can represent distinct groups or categories within the data, providing another layer of visual information. This feature is particularly useful when comparing multiple groups or conditions in the same plot.\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@@ -367,13 +303,12 @@\n \n A tabular file 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-* Shape (optional; categorical data for point shapes)\n+    * P value\n+    * FDR / adjusted P value\n+    * Log fold change\n+    * Labels (e.g. Gene symbols or IDs)\n \n-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.\n+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.\n \n **Outputs**\n \n@@ -384,7 +319,6 @@\n .. _Volcano plot: https://en.wikipedia.org/wiki/Volcano_plot_(statistics)\n .. _blog post: https://gettinggeneticsdone.blogspot.com/2016/01/\n \n-\n     ]]></help>\n     <citations>\n         <citation type="doi">10.1007/978-3-319-24277-4</citation>\n'