diff test-data/out.rscript @ 11:5e08a1e22dbc draft default tip

planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/volcanoplot commit 8031afb306afd728f682d754e9270dc22c64c61c
author iuc
date Wed, 29 Jan 2025 10:37:54 +0000
parents 99ace6c1ff57
children
line wrap: on
line diff
--- a/test-data/out.rscript	Wed Dec 11 20:36:56 2024 +0000
+++ b/test-data/out.rscript	Wed Jan 29 10:37:54 2025 +0000
@@ -20,16 +20,20 @@
 
 # Import data  ------------------------------------------------------------
 
-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)
+results <- read.delim('/tmp/tmpl4o1f_bf/files/5/2/5/dataset_52538741-d085-42da-817b-263bd4f7cf98.dat', header = TRUE)
 
 
 # Format data  ------------------------------------------------------------
 
-# Create columns from the column numbers specified
-results <- results %>% mutate(fdr = .[[4]],
-                              pvalue = .[[3]],
-                              logfc = .[[2]],
-                              labels = .[[1]])
+# 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 
 
 # Get names for legend
 down <- unlist(strsplit('Down,Not Sig,Up', split = ","))[1]
@@ -49,7 +53,7 @@
 # Specify genes to label --------------------------------------------------
 
 # Import file with genes of interest
-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)
+labelfile <- read.delim('/tmp/tmpl4o1f_bf/files/5/d/4/dataset_5d401b02-f6af-4ed9-b853-992fd4a4d044.dat', header = TRUE)
 
 # Label the genes of interest in results table
 results <- mutate(results, labels = ifelse(labels %in% labelfile[, 1], labels, ""))
@@ -61,15 +65,17 @@
 # Open file to save plot as PDF
 pdf("volcano_plot.pdf")
 
-# Set up base plot
+# Set up base plot with faceting by category_symbol instead of shapes
 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())
+          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
 
 # Add gene labels
 p <- p + geom_text_repel(data = filter(results, labels != ""), aes(label = labels),