comparison interactive_tool_rstudio_bioconductor.xml @ 0:8f95c3031339 draft default tip

planemo upload commit e2e44ba8b45bf21c9bf08e2d5e79a985d2c299c9
author enis
date Fri, 30 May 2025 16:50:00 +0000
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:8f95c3031339
1
2 <tool id="interactive_tool_rstudio_bioconductor" tool_type="interactive" name="RStudio" version="4.5.0+3.21" profile="22.01">
3 <icon src="bioconductor.png" />
4 <description>R 4.5.0 with Bioconductor 3.21</description>
5 <requirements>
6 <container type="docker">bioconductor/galaxy-rstudio:RELEASE_3_21</container>
7 </requirements>
8 <entry_points>
9 <entry_point name="RStudio" requires_domain="False" requires_path_in_header_named="X-RStudio-Root-Path">
10 <port>8787</port>
11 <url>/</url>
12 </entry_point>
13 </entry_points>
14 <environment_variables>
15 <environment_variable name="HISTORY_ID" strip="True">${__app__.security.encode_id($rstudio.history_id)}</environment_variable> <!-- FIXME: Warning: The use of __app__ is deprecated and will break backward compatibility in the near future -->
16 <environment_variable name="GALAXY_WEB_PORT">8080</environment_variable>
17 <environment_variable name="GALAXY_URL">$__galaxy_url__</environment_variable>
18 <environment_variable name="DEBUG">true</environment_variable>
19 <environment_variable name="DISABLE_AUTH">true</environment_variable>
20 <environment_variable name="API_KEY" inject="api_key" />
21 </environment_variables>
22 <inputs>
23 <param name="input" multiple="true" type="data" format="data" optional="true" label="Include data into the environment"/>
24 </inputs>
25 <command><![CDATA[
26 #import re
27 echo "[`date`] - Setting up for RStudio as \$(id)." &&
28 ## Match the container user id to the host user/group id if supplied
29 if [ -n "\$USERID" ]; then
30 echo "[`date`] - Setting user id to \$USERID." &&
31 usermod -u "\$USERID" rstudio;
32 fi &&
33 if [ -n "\$GROUPID" ]; then
34 echo "[`date`] - Setting user group to \$GROUPID." &&
35 groupmod -g "\$GROUPID" rstudio;
36 fi &&
37
38 ## This is where GalaxyConnector places files copied from Galaxy
39 mkdir -p /import &&
40 chown rstudio:rstudio /import &&
41 ln -s "/import" /home/rstudio/galaxy_imports &&
42 mkdir -p ./rstudio_outputs && chown rstudio:rstudio ./rstudio_outputs && ln -s "\$PWD/rstudio_outputs" /home/rstudio/galaxy_outputs &&
43
44 echo "[`date`] - Creating Rprofile" &&
45 cp '$__tool_directory__/Rprofile.R' /home/rstudio/.Rprofile &&
46
47 ## Required because of the above usermod command, but before linking the input files
48 chown -R rstudio:rstudio /home/rstudio/ &&
49 chown -R rstudio:rstudio /usr/local/lib/R/library &&
50 chown -R rstudio:rstudio /usr/local/lib/R/doc &&
51
52 #if $input:
53 echo "[`date`] - Linking input files to '/home/rstudio/galaxy_inputs/'" &&
54 mkdir -p /home/rstudio/galaxy_inputs/ &&
55 #for $count, $file in enumerate($input):
56 #set $cleaned_name = str($count + 1) + '_' + re.sub('[^\w\-\.\s]', '_', str($file.element_identifier))
57 echo "[`date`] - Linking '$file' to '/home/rstudio/galaxy_inputs/${cleaned_name}.${file.ext}'" &&
58 ln -sf '$file' '/home/rstudio/galaxy_inputs/${cleaned_name}.${file.ext}' &&
59 #end for
60 #else
61 echo "[`date`] - No input files provided, skipping file linking step." &&
62 #end if
63
64 echo "[`date`] - Starting container processes, including RStudio..." &&
65 /init
66 ]]>
67 </command>
68 <outputs>
69 <data name="rstudio" format="txt" label="RStudio Interactive Tool"></data>
70 <collection name="output_collection" type="list" label="RStudio outputs">
71 <discover_datasets pattern="__name_and_ext__" directory="rstudio_outputs/" assign_primary_output="true" recurse="true"/>
72 </collection>
73 </outputs>
74 <stdio>
75 <exit_code range="129" level="log" description="User shut down the container." />
76 </stdio>
77 <tests>
78 <test expect_num_outputs="1">
79 <param name="mode" value="previous" />
80 <param name="rstudio" value="test.txt" />
81 <param name="run_it" value="true" />
82 <output name="rstudio" file="test.txt" ftype="txt"/>
83 </test>
84 </tests>
85 <help><![CDATA[
86 The RStudio Interactive Tool in Galaxy provides a user-friendly interface
87 for conducting statistical analysis, visualization, and scripting using the
88 R programming language. This tool is ideal for bioinformatics workflows
89 involving data exploration, statistical modeling, and custom script
90 development within the Galaxy ecosystem.
91
92 Use Cases
93 ---------
94 - Exploratory data analysis
95 - Custom script development
96 - Genomic and transcriptomic data visualization
97 - Statistical modeling and hypothesis testing
98
99 Galaxy Integration Functions
100 ----------------------------
101
102 To facilitate seamless data transfer between RStudio and Galaxy, the
103 following built-in functions are available:
104
105 Before launching the tool, you can select datasets from your history to include
106 in the RStudio environment. This allows you to work with your data directly
107 within RStudio without needing to manually transfer files. All files will be
108 located in the `~/galaxy_inputs/` directory. Note that files
109 mapped from a Galaxy history into RStudio like this are read only.
110
111 Any files that you store in the `~/galaxy_outputs/` directory will be
112 automatically transferred back to Galaxy when you finish your session and stop
113 the RStudio Interactive Tool.
114
115 In addition, you can use the following functions within your R session to
116 facilitate interactive data transfer. All imported files will be located in the
117 `~/galaxy_imports` directory.
118
119 **gx_get(history_dataset_number)** – Loads a dataset from your
120 Galaxy history into the R environment. Example:
121
122 .. code-block:: r
123
124 gx_get(1)
125 df <- read.csv("~/galaxy_imports/1")
126 head(df)
127
128 **gx_put("file_name", ["file_type"])** – Saves an R object as a
129 new dataset in your Galaxy history. Example:
130
131 .. code-block:: r
132
133 gx_put("/home/rstudio/output.csv")
134
135 **gx_save("session_name")** – Saves your R script to Galaxy for
136 reproducibility. Example:
137
138 .. code-block:: r
139
140 gx_save("analysis_script.R")
141
142 ]]></help>
143 </tool>