Mercurial > repos > mbernt > singularity_scriptrunner
comparison macros.xml @ 0:9512201417a5 draft
planemo upload for repository https://github.com/bernt-matthias/mb-galaxy-tools/tree/master/tools/scripting/ commit 9e9a0860d255a1fd6c43edd0fde9ea538ee679de
author | mbernt |
---|---|
date | Sun, 06 Aug 2023 15:21:11 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:9512201417a5 |
---|---|
1 <macros> | |
2 <xml name="command_macro"> | |
3 <command detect_errors="aggressive"><![CDATA[ | |
4 #import re | |
5 mkdir inputs && | |
6 #for $p in $parameters | |
7 #if $p.type_cond.type_sel == "data" | |
8 #if $p.type_cond.filename != '' | |
9 #set fname = $p.type_cond.filename | |
10 #else | |
11 #set fname=re.sub('[^\s\w\.]', '_', str($p.type_cond.param.element_identifier)) + "." + $p.type_cond.param.ext | |
12 #end if | |
13 ln -s '$p.type_cond.param' inputs/'$fname' && | |
14 #end if | |
15 #end for | |
16 | |
17 @COMMAND_AND_SETUP@ | |
18 '$script' | |
19 #for $p in $parameters | |
20 #if $p.type_cond.type_sel == "data" | |
21 #if $p.type_cond.filename != '' | |
22 #set fname = $p.type_cond.filename | |
23 #else | |
24 #set fname=re.sub('[^\s\w\.]', '_', str($p.type_cond.param.element_identifier)) + "." + $p.type_cond.param.ext | |
25 #end if | |
26 inputs/'$fname' | |
27 #else | |
28 '$p.type_cond.param' | |
29 #end if | |
30 #end for | |
31 ]]></command> | |
32 <configfiles> | |
33 <configfile name="script">$code</configfile> | |
34 </configfiles> | |
35 </xml> | |
36 <xml name="inputs_macro"> | |
37 <inputs> | |
38 <repeat name="parameters" title="Parameters" min="1" default="1" help="Supply one or more parameters"> | |
39 <conditional name="type_cond"> | |
40 <param name="type_sel" type="select" label="Parameter type"> | |
41 <option value="data">Dataset</option> | |
42 <option value="text">Text</option> | |
43 <!-- Not sure if int/float make sense .. can they be connected to text in WFs? --> | |
44 </param> | |
45 <when value="data"> | |
46 <param name="param" type="data" label="Dataset"/> | |
47 <param name="filename" type="text" label="File name" help="Set if you want to access the data set with a specific file name. Only alphanumeric characters, dash and underscore are allowed (all other characters are replaced by an undercore). Default is Galaxy's data set name."> | |
48 <sanitizer invalid_char="_"> | |
49 <valid initial="string.ascii_letters,string.digits"> | |
50 <add value="_" /> | |
51 <add value="-" /> | |
52 <add value="." /> | |
53 </valid> | |
54 </sanitizer> | |
55 <!-- file names must not start with dash --> | |
56 <validator type="regex" negate="true" message="Filenames must not start with a dash">^[-].*$</validator> | |
57 </param> | |
58 </when> | |
59 <when value="text"> | |
60 <param name="param" type="text" label="Text parameter" help=""/> | |
61 </when> | |
62 </conditional> | |
63 </repeat> | |
64 <param name="code" type="text" area="true" label="@LANGUAGE@ program" help=""> | |
65 <sanitizer> | |
66 <valid initial="string.printable"/> | |
67 </sanitizer> | |
68 </param> | |
69 </inputs> | |
70 </xml> | |
71 <xml name="outputs_macro"> | |
72 <outputs> | |
73 <collection name="output" type="list" label="Outputs"> | |
74 <discover_datasets pattern="__designation_and_ext__"/> | |
75 </collection> | |
76 </outputs> | |
77 </xml> | |
78 | |
79 <xml name="help_macro"> | |
80 <help><![CDATA[ | |
81 **Warning** | |
82 | |
83 .. class:: warningmark | |
84 | |
85 **Make sure that you know what you are doing. When used wrong the tool may lead to | |
86 data loss of files that you can write to.** | |
87 | |
88 .. class:: warningmark | |
89 | |
90 This tool is only intended to serve for single-use, ad-hoc exploratory analysis | |
91 of data sets with small @LANGUAGE@ scripts. | |
92 | |
93 .. class:: warningmark | |
94 | |
95 If you use this tool repeatedly with the same script and/or have the impression | |
96 that other Galaxy users could profit from this script then contact your local | |
97 Galaxy administrator or the Galaxy community, e.g. at https://github.com/galaxyproject/tools-iuc/, | |
98 and ask if your script can be turned into a proper Galaxy tool. | |
99 One of the main advantages of a proper Galaxy tool is that they are tested and | |
100 maintained. Furthermore the whole Galaxy community may profit. | |
101 | |
102 **What it does** | |
103 | |
104 Executes an **@LANGUAGE@** script (in a @CONTAINER@ container). | |
105 | |
106 An arbitrary number of data or text parameters can be given to the script. | |
107 Data parameters are by default named like the datasets name and the datatype | |
108 is used as extension. This can be overwritten with the filename parameter | |
109 for the corresponding dataset. | |
110 | |
111 @HELP_PARAMETERS@ | |
112 | |
113 @HELP_READ_FROM_STDIN@ | |
114 | |
115 Output datasets are read from the current working directory and put into a | |
116 single collection. The collection elements will be named as the file names | |
117 (without the extension). The file extension determines the datatype of the | |
118 datasets (or Galaxy will try to autodetect the data type). | |
119 ]]></help> | |
120 </xml> | |
121 </macros> |