annotate rgToolFactory.xml @ 25:8cc3f3c0e539 default tip

Now uses admin_users to check that the user is authorized to run this tool Docs adjusted.
author Ross Lazarus <ross.lazarus@gmail.com>
date Wed, 06 Jun 2012 14:16:25 +1000
parents 8289ebc513ab
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
11
a0a5d0757e39 Minor tool help changes and fixes to tests - still no code
ross lazarus ross.lazarus@gmail.com
parents: 10
diff changeset
1 <tool id="rgTF" name="Tool Factory" version="0.05">
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
2 <description>Makes scripts into tools</description>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
3 <command interpreter="python">
25
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
4 #if ( $__user_email__ not in $__admin_users__ ):
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
5 rgToolFactory.py --bad_user $__user_email__
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
6 #else:
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
7 rgToolFactory.py --script_path "$runme" --interpreter "$interpreter"
9
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
8 --tool_name "$tool_name"
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
9 #if $make_TAB.value=="yes":
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
10 --output_tab "$tab_file"
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
11 #end if
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
12 #if $makeMode.make_Tool=="yes":
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
13 --make_Tool "$makeMode.make_Tool"
23
6146509c9c2d mostly working again
ross lazarus ross.lazarus@gmail.com
parents: 22
diff changeset
14 --help_text "$helpme"
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
15 --tool_desc "tool_desc"
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
16 --new_tool "$new_tool"
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
17 #end if
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
18 #if $make_HTML.value=="yes":
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
19 --output_dir "$html_file.files_path" --output_html "$html_file" --make_HTML "yes"
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
20 #end if
10
71f2ac0eee95 Updated tarball with some test material - still need code generated...
ross lazarus ross.lazarus@gmail.com
parents: 9
diff changeset
21 #if $input1 != 'None':
9
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
22 --input_tab "$input1"
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
23 #end if
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
24 #end if
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
25 </command>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
26 <inputs>
19
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
27 <param name="input1" type="data" label="Select an input file from your history" optional="true"
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
28 help="Most scripts will need an input - your script MUST be ready for whatever format you choose"/>
24
8289ebc513ab More tweaks to docs and installation notes
Ross Lazarus <ross.lazarus@gmail.com>
parents: 23
diff changeset
29 <param name="tool_name" type="text" value="My dynamic script" size="80" label="Title for job outputs and new tool ID"
8289ebc513ab More tweaks to docs and installation notes
Ross Lazarus <ross.lazarus@gmail.com>
parents: 23
diff changeset
30 help="This will become the toolshed repository name so please choose thoughtfully">
8289ebc513ab More tweaks to docs and installation notes
Ross Lazarus <ross.lazarus@gmail.com>
parents: 23
diff changeset
31 <sanitizer invalid_char="">
8289ebc513ab More tweaks to docs and installation notes
Ross Lazarus <ross.lazarus@gmail.com>
parents: 23
diff changeset
32 <valid initial="string.letters,string.digits"/>
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
33 </sanitizer>
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
34 </param>
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
35 <conditional name="makeMode">
8
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
36 <param name="make_Tool" type="select" label="Create a tar.gz file ready for local toolshed entry" help="Ready to deploy securely!">
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
37 <option value="yes">Yes</option>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
38 <option value="" selected="true">Not yet, it's still broken</option>
8
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
39 </param>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
40 <when value = "yes">
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
41 <param name="tool_desc" type="text" width="120" value="" help="Supply a brief tool description for the Galaxy tool menu entry (optional - appears after the tool name)" />
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
42 <param name="help_text" type="text" area="true" size="8x80" width="120" value="**What it Does**" help="Supply the brief user documentation to appear on the new tool form as reStructured text" >
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
43 <sanitizer>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
44 <valid initial="string.printable">
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
45 </valid>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
46 <mapping initial="none"/>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
47 </sanitizer>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
48 </param>
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
49 </when>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
50 <when value = "">
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
51
8
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
52 </when>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
53 </conditional>
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
54 <param name="make_HTML" type="select" label="Create an HTML report with links to all output files and thumbnail links to PDF images"
19
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
55 help="Recommended for presenting complex outputs in an accessible manner. Turn off for simple tools so they just create one output">
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
56 <option value="yes" selected="true">Yes</option>
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
57 <option value="">No</option>
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
58 </param>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
59
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
60
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
61 <param name="make_TAB" type="select" label="Create a new (default tabular) history output"
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
62 help="This is useful if your script creates a single new tabular file you want to appear in the history after the tool executes">
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
63 <option value="yes" selected="true">Make a new history output file</option>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
64 <option value="">No new history output file. Will use an HTML file</option>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
65 </param>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
66 <param name="out_format" type="select" label="Galaxy datatype for your tool's output file" help="You may need to edit the xml to extend this list">
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
67 <option value="tabular" selected="true">Tabular</option>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
68 <option value="interval">Interval</option>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
69 <option value="gz">gz</option>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
70 <option value="text">text</option>
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
71 </param>
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
72 <param name="interpreter" type="select" label="Select the interpreter for your code. This must be available on the path of the execution host">
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
73 <option value="Rscript" selected="true">Rscript</option>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
74 <option value="python">python</option>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
75 <option value="perl (ugh)">perl</option>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
76 </param>
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
77 <param name="dynScript" label="Cut and paste the script to be executed here" type="text" value="" area="True" size="8x80" width="80"
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
78 help="Script must deal with two command line parameters: Path to input tabular file path (or 'None' if none selected) and path to output tabular history file (or 'None').">
8
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
79 <sanitizer>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
80 <valid initial="string.printable">
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
81 </valid>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
82 <mapping initial="none"/>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
83 </sanitizer>
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
84 </param>
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
85 </inputs>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
86 <outputs>
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
87 <data format="tabular" name="tab_file" label="${tool_name}.${out_format}">
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
88 <filter>make_TAB=="yes"</filter>
19
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
89 <change_format>
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
90 <when input="out_format" value="interval" format="interval" />
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
91 <when input="out_format" value="gz" format="gz" />
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
92 <when input="out_format" value="text" format="text" />
19
a87a262220a4 Adding proof of concept for optional output formats.
ross lazarus ross.lazarus@gmail.com
parents: 15
diff changeset
93 </change_format>
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
94 </data>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
95 <data format="html" name="html_file" label="${tool_name}.html">
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
96 <filter>make_HTML == "yes"</filter>
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
97 </data>
23
6146509c9c2d mostly working again
ross lazarus ross.lazarus@gmail.com
parents: 22
diff changeset
98 <data format="toolshed.gz" name="new_tool" label="${tool_name}.toolshed.gz">
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
99 <filter>makeMode['make_Tool'] == "yes"</filter>
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
100 </data>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
101 </outputs>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
102 <configfiles>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
103 <configfile name="runme">
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
104 ${dynScript}
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
105 </configfile>
9
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
106
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
107 <configfile name="helpme">
22
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
108 #if $makeMode.make_Tool == "yes":
c23e53f768ed Think I finally got the output selection stuff working..
ross lazarus ross.lazarus@gmail.com
parents: 19
diff changeset
109 ${makeMode.help_text}
9
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
110 #end if
8
220885b2d7ee End to end test works. Add tests next
ross lazarus ross.lazarus@gmail.com
parents: 7
diff changeset
111 </configfile>
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
112 </configfiles>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
113 <help>
25
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
114
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
115 .. class:: warningmark
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
116
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
117 **Local Admins ONLY** Only users whose IDs found in the local admin_user configuration setting in universe_wsgi.ini can run this tool.
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
118
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
119 **What it does** This tool enables a user to paste and submit an arbitrary R/python/perl script to Galaxy.
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
120
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
121 **Input options** This version is limited to simple transformation or reporting requiring only a single input file selected from the history.
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
122
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
123 **Output options** Optional script outputs include one single new history tabular file, or for scripts that create multiple outputs,
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
124 a new HTML report linking all the files and images created by the script can be automatically generated.
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
125
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
126 **Tool Generation option** Once the script is working with test data, this tool will optionally generate a new Galaxy tool in a gzip file
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
127 ready to upload to your local toolshed for sharing and installation.
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
128
10
71f2ac0eee95 Updated tarball with some test material - still need code generated...
ross lazarus ross.lazarus@gmail.com
parents: 9
diff changeset
129 .. class:: warningmark
71f2ac0eee95 Updated tarball with some test material - still need code generated...
ross lazarus ross.lazarus@gmail.com
parents: 9
diff changeset
130
25
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
131 **Note to system administrators** This tool offers *NO* built in protection against malicious scripts. It should only be installed on private/personnal Galaxy instances.
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
132 Admin_users will have the power to do anything they want as the Galaxy user if you install this tool.
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
133
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
134 The tools generated by this tool will run just as securely as any other normal installed Galaxy tool but like any other new tools, should always be checked carefully before installation.
25
8cc3f3c0e539 Now uses admin_users to check that the user is authorized to run this tool
Ross Lazarus <ross.lazarus@gmail.com>
parents: 24
diff changeset
135 We recommend that you follow the good code hygiene practices associated with safe toolshed.
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
136
10
71f2ac0eee95 Updated tarball with some test material - still need code generated...
ross lazarus ross.lazarus@gmail.com
parents: 9
diff changeset
137 .. class:: warningmark
71f2ac0eee95 Updated tarball with some test material - still need code generated...
ross lazarus ross.lazarus@gmail.com
parents: 9
diff changeset
138
71f2ac0eee95 Updated tarball with some test material - still need code generated...
ross lazarus ross.lazarus@gmail.com
parents: 9
diff changeset
139 **Use on public servers** is STRONGLY discouraged for obvious reasons
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
140
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
141 **Scripting conventions** The pasted script will be executed with the path to the (optional) input tabular data file path or NONE if you do not select one, and the path to the optional
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
142 output file or None if none is wanted, as the first and second command line parameters. The script must deal appropriately with these - see Rscript examples below.
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
143 Note that if an optional HTML output is selected, all the output files created by the script will be nicely presented as links, with pdf images linked as thumbnails in that output.
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
144 This can be handy for complex scripts creating lots of output.
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
145
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
146 **Simple examples**
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
147
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
148 A simple Rscript "filter" showing how the command line parameters can be handled, takes an input file, does something (transpose in this case) and writes the results to a new tabular file::
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
149
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
150 # transpose a tabular input file and write as a tabular output file
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
151 ourargs = commandArgs(TRUE)
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
152 inf = ourargs[1]
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
153 outf = ourargs[2]
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
154 inp = read.table(inf,head=F,row.names=NULL,sep='\t')
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
155 outp = t(inp)
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
156 write.table(outp,outf, quote=FALSE, sep="\t",row.names=F,col.names=F)
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
157
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
158 A more complex Rscript example takes no input file but generates a random heatmap pdf - you must make sure the option to create an HTML output file is
9
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
159 turned on for this to work. The heatmap will be presented as a thumbnail linked to the pdf in the resulting HTML page::
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
160
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
161 # note this script takes NO input or output because it generates random data
9
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
162 foo = data.frame(a=runif(100),b=runif(100),c=runif(100),d=runif(100),e=runif(100),f=runif(100))
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
163 bar = as.matrix(foo)
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
164 pdf( "heattest.pdf" )
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
165 heatmap(bar,main='Random Heatmap')
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
166 dev.off()
e09c76551bed Can run without input or output or either..
ross lazarus ross.lazarus@gmail.com
parents: 8
diff changeset
167
12
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
168 A Python example that reverses each row of a tabular file (you'll need to remove the leading spaces for this to work if cut and pasted into the script box)::
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
169
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
170 # reverse order of columns in a tabular file
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
171 import sys
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
172 inp = sys.argv[1]
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
173 outp = sys.argv[2]
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
174 i = open(inp,'r')
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
175 o = open(outp,'w')
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
176 for row in i:
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
177 rs = row.rstrip().split('\t')
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
178 rs.reverse()
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
179 o.write('\t'.join(rs))
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
180 o.write('\n')
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
181 i.close()
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
182 o.close()
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
183
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
184
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
185 **Attribution** Copyright Ross Lazarus (ross period lazarus at gmail period com) May 2012
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
186
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
187 All rights reserved.
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
188
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
189 Licensed under the LGPL_
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
190
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
191 .. _LGPL: http://www.gnu.org/copyleft/lesser.html
d12728e33c3d Changed to deliver a gz file - requires a new datatypes_conf.xml entry:
ross lazarus ross.lazarus@gmail.com
parents: 11
diff changeset
192
7
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
193 </help>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
194
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
195 </tool>
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
196
7221619caefa Updated name and added crude gzip generator for toolshed
ross lazarus ross.lazarus@gmail.com
parents:
diff changeset
197