workflow-to-galaxy 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,5 +1,10 @@
1
1
  = Changes log for the Taverna-Galaxy Gem
2
2
 
3
+ == Version 0.2.9
4
+ * Fixed minor bug when workflow had empty description
5
+ * Added instructions to generated scripts on how to run them without Galaxy.
6
+
7
+
3
8
  == Version 0.2.8
4
9
  * Clean up of documentation
5
10
  * Added rubyzip dependency to gemspec
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  Authors:: Konstantinos Karasavvas
5
- Gem Version:: 0.2.8
5
+ Gem Version:: 0.2.9
6
6
  Contact:: mailto:kostas.karasavvas@nbic.nl
7
7
  Licence:: MIT (See LICENCE or http://www.opensource.org/licenses/mit-license)
8
8
  Copyright:: (c) 2010 Netherlands Bioinformatics Centre, The Netherlands
data/Rakefile CHANGED
@@ -12,7 +12,7 @@ require 'rdoc/task'
12
12
 
13
13
  spec = Gem::Specification.new do |s|
14
14
  s.name = 'workflow-to-galaxy'
15
- s.version = '0.2.8'
15
+ s.version = '0.2.9'
16
16
  s.extra_rdoc_files = ['README', 'LICENSE', 'CHANGES']
17
17
  s.summary = 'This script acquires information for a taverna 2 workflow from myExperiment (or from a file) and generates a Galaxy tool (.xml and .rb files).'
18
18
  s.description = s.summary
@@ -66,6 +66,8 @@
66
66
 
67
67
  <li><a href="./Generator.html">Generator</a></li>
68
68
 
69
+ <li><a href="./Object.html">Object</a></li>
70
+
69
71
  <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
70
72
 
71
73
  </ul>
@@ -80,6 +82,13 @@
80
82
 
81
83
  <h1>Changes log for the Taverna-Galaxy Gem</h1>
82
84
 
85
+ <h2>Version 0.2.9</h2>
86
+ <ul><li>
87
+ <p>Fixed minor bug when workflow had empty description</p>
88
+ </li><li>
89
+ <p>Added instructions to generated scripts on how to run them without Galaxy.</p>
90
+ </li></ul>
91
+
83
92
  <h2>Version 0.2.8</h2>
84
93
  <ul><li>
85
94
  <p>Clean up of documentation</p>
@@ -34,6 +34,9 @@
34
34
  <div class="section-body">
35
35
  <ul>
36
36
 
37
+ <li><a href="./lib/generator_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/generator.rb">lib/generator.rb</a></li>
39
+
37
40
  <li><a href="./lib/workflow-to-galaxy/generator_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
41
  class="thickbox" title="lib/workflow-to-galaxy/generator.rb">lib/workflow-to-galaxy/generator.rb</a></li>
39
42
 
@@ -102,6 +105,8 @@
102
105
 
103
106
  <li><a href="./Generator.html">Generator</a></li>
104
107
 
108
+ <li><a href="./Object.html">Object</a></li>
109
+
105
110
  <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
106
111
 
107
112
  </ul>
@@ -117,6 +122,9 @@
117
122
 
118
123
  <div id="description" class="description">
119
124
 
125
+ <p>Contains code to generate the Galaxy’s tool xml and script files</p>
126
+ <hr style="height: 1px">
127
+
120
128
  <p>The <a href="Generator.html">Generator</a> module contains two public
121
129
  methods that generate a Galaxy’s tool XML and script files</p>
122
130
 
@@ -129,6 +137,19 @@ methods that generate a Galaxy’s tool XML and script files</p>
129
137
 
130
138
 
131
139
 
140
+ <!-- Constants -->
141
+ <div id="constants-list" class="section">
142
+ <h3 class="section-header">Constants</h3>
143
+ <dl>
144
+
145
+ <dt><a name="INDENT">INDENT</a></dt>
146
+
147
+ <dd class="description"></dd>
148
+
149
+
150
+ </dl>
151
+ </div>
152
+
132
153
 
133
154
 
134
155
 
@@ -142,45 +163,33 @@ methods that generate a Galaxy’s tool XML and script files</p>
142
163
  <a name="method-i-generate_script"></a>
143
164
 
144
165
 
145
-
146
166
  <div class="method-heading">
147
- <span class="method-callseq">generate_script(my_exp_rest, t2_server, script_file) &rarr; nil</span>
148
-
167
+ <span class="method-name">generate_script</span><span
168
+ class="method-args">(me_rest, t2_server, script_file)</span>
149
169
  <span class="method-click-advice">click to toggle source</span>
150
-
151
170
  </div>
152
171
 
153
-
154
172
 
155
173
  <div class="method-description">
156
174
 
157
175
  <p>Generates the Galaxy tool’s script file responsible for talking to the
158
176
  taverna server</p>
159
- <dl class="rdoc-list"><dt><tt>my_exp_rest</tt></dt>
160
- <dd>
161
- <p>a <em>Workflow</em> object as returned from
162
- <em>MyExperimentREST.ReadWorkflow.new(url)</em></p>
163
- </dd><dt><tt>t2_server</tt></dt>
164
- <dd>
165
- <p>a string containing the URL of the taverna 2 server</p>
166
- </dd><dt><tt>script_out</tt></dt>
167
- <dd>
168
- <p>the file handler to write the generated script code</p>
169
- </dd></dl>
170
177
 
171
178
 
172
179
 
173
180
  <div class="method-source-code" id="generate_script-source">
174
181
  <pre>
175
- <span class="ruby-comment"># File lib/workflow-to-galaxy/generator.rb, line 487</span>
176
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">generate_script</span>(<span class="ruby-identifier">t2_workflow</span>, <span class="ruby-identifier">t2_server</span>, <span class="ruby-identifier">script_out</span>)
177
- <span class="ruby-identifier">script_preample</span>(<span class="ruby-identifier">script_out</span>)
178
- <span class="ruby-identifier">script_util_methods</span>(<span class="ruby-identifier">script_out</span>)
179
- <span class="ruby-identifier">script_create_t2_run</span>(<span class="ruby-identifier">script_out</span>, <span class="ruby-identifier">t2_workflow</span>, <span class="ruby-identifier">t2_server</span>)
180
- <span class="ruby-identifier">script_init_inputs</span>(<span class="ruby-identifier">script_out</span>, <span class="ruby-identifier">t2_workflow</span>)
181
- <span class="ruby-identifier">script_start_run</span>(<span class="ruby-identifier">script_out</span>)
182
- <span class="ruby-identifier">script_get_outputs</span>(<span class="ruby-identifier">script_out</span>, <span class="ruby-identifier">t2_workflow</span>)
183
- <span class="ruby-identifier">script_finish_run</span>(<span class="ruby-identifier">script_out</span>)
182
+ <span class="ruby-comment"># File lib/generator.rb, line 253</span>
183
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">generate_script</span>(<span class="ruby-identifier">me_rest</span>, <span class="ruby-identifier">t2_server</span>, <span class="ruby-identifier">script_file</span>)
184
+ <span class="ruby-identifier">out</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">script_file</span>, <span class="ruby-string">&quot;w&quot;</span>)
185
+ <span class="ruby-identifier">script_preample</span>(<span class="ruby-identifier">out</span>)
186
+ <span class="ruby-identifier">script_util_methods</span>(<span class="ruby-identifier">out</span>)
187
+ <span class="ruby-identifier">script_create_t2_run</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>.<span class="ruby-identifier">uri</span>, <span class="ruby-identifier">t2_server</span>)
188
+ <span class="ruby-identifier">script_init_inputs</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>)
189
+ <span class="ruby-identifier">script_start_run</span>(<span class="ruby-identifier">out</span>)
190
+ <span class="ruby-identifier">script_get_outputs</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>)
191
+ <span class="ruby-identifier">script_finish_run</span>(<span class="ruby-identifier">out</span>)
192
+ <span class="ruby-identifier">out</span>.<span class="ruby-identifier">close</span>
184
193
  <span class="ruby-keyword">end</span></pre>
185
194
  </div><!-- generate_script-source -->
186
195
 
@@ -196,43 +205,31 @@ taverna server</p>
196
205
  <a name="method-i-generate_xml"></a>
197
206
 
198
207
 
199
-
200
208
  <div class="method-heading">
201
- <span class="method-callseq">generate_xml(my_exp_rest, xml_file) &rarr; nil</span>
202
-
209
+ <span class="method-name">generate_xml</span><span
210
+ class="method-args">(me_rest, xml_file)</span>
203
211
  <span class="method-click-advice">click to toggle source</span>
204
-
205
212
  </div>
206
213
 
207
-
208
214
 
209
215
  <div class="method-description">
210
216
 
211
217
  <p>Generates the Galaxy tool’s xml file responsible for the UI.</p>
212
- <dl class="rdoc-list"><dt><tt>t2_workflow</tt></dt>
213
- <dd>
214
- <p>a <em>Workflow</em> object as returned from
215
- <em>MyExperimentREST::Workflows.new.read(url)</em></p>
216
- </dd><dt><tt>xml_file</tt></dt>
217
- <dd>
218
- <p>a string containing the name of the generated XML file</p>
219
- </dd><dt><tt>xml_out</tt></dt>
220
- <dd>
221
- <p>the file handler to write the generated XML tags</p>
222
- </dd></dl>
223
218
 
224
219
 
225
220
 
226
221
  <div class="method-source-code" id="generate_xml-source">
227
222
  <pre>
228
- <span class="ruby-comment"># File lib/workflow-to-galaxy/generator.rb, line 468</span>
229
- <span class="ruby-keyword">def</span> <span class="ruby-identifier">generate_xml</span>(<span class="ruby-identifier">t2_workflow</span>, <span class="ruby-identifier">xml_file</span>, <span class="ruby-identifier">xml_out</span>)
230
- <span class="ruby-identifier">tool_begin_tag</span>(<span class="ruby-identifier">xml_out</span>, <span class="ruby-identifier">t2_workflow</span>.<span class="ruby-identifier">title</span>)
231
- <span class="ruby-identifier">command_tag</span>(<span class="ruby-identifier">xml_out</span>, <span class="ruby-identifier">t2_workflow</span>, <span class="ruby-identifier">xml_file</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'.xml'</span>, <span class="ruby-string">'.rb'</span>))
232
- <span class="ruby-identifier">inputs_tag</span>(<span class="ruby-identifier">xml_out</span>, <span class="ruby-identifier">t2_workflow</span>.<span class="ruby-identifier">inputs</span>)
233
- <span class="ruby-identifier">outputs_tag</span>(<span class="ruby-identifier">xml_out</span>, <span class="ruby-identifier">t2_workflow</span>.<span class="ruby-identifier">outputs</span>)
234
- <span class="ruby-identifier">help_tag</span>(<span class="ruby-identifier">xml_out</span>, <span class="ruby-identifier">t2_workflow</span>)
235
- <span class="ruby-identifier">tool_end_tag</span>(<span class="ruby-identifier">xml_out</span>)
223
+ <span class="ruby-comment"># File lib/generator.rb, line 238</span>
224
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">generate_xml</span>(<span class="ruby-identifier">me_rest</span>, <span class="ruby-identifier">xml_file</span>)
225
+ <span class="ruby-identifier">out</span> = <span class="ruby-constant">File</span>.<span class="ruby-identifier">open</span>(<span class="ruby-identifier">xml_file</span>, <span class="ruby-string">&quot;w&quot;</span>)
226
+ <span class="ruby-identifier">tool_b</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>.<span class="ruby-identifier">workflow</span>.<span class="ruby-identifier">title</span>)
227
+ <span class="ruby-identifier">command_be</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>, <span class="ruby-identifier">xml_file</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-string">'.xml'</span>, <span class="ruby-string">'.rb'</span>))
228
+ <span class="ruby-identifier">inputs_be</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>.<span class="ruby-identifier">workflow</span>.<span class="ruby-identifier">inputs</span>)
229
+ <span class="ruby-identifier">outputs_be</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>.<span class="ruby-identifier">workflow</span>.<span class="ruby-identifier">outputs</span>)
230
+ <span class="ruby-identifier">help_be</span>(<span class="ruby-identifier">out</span>, <span class="ruby-identifier">me_rest</span>)
231
+ <span class="ruby-identifier">tool_e</span>(<span class="ruby-identifier">out</span>)
232
+ <span class="ruby-identifier">out</span>.<span class="ruby-identifier">close</span>
236
233
  <span class="ruby-keyword">end</span></pre>
237
234
  </div><!-- generate_xml-source -->
238
235
 
@@ -66,6 +66,8 @@
66
66
 
67
67
  <li><a href="./Generator.html">Generator</a></li>
68
68
 
69
+ <li><a href="./Object.html">Object</a></li>
70
+
69
71
  <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
70
72
 
71
73
  </ul>
@@ -0,0 +1,161 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
5
+ <head>
6
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
7
+
8
+ <title>Class: Object</title>
9
+
10
+ <link rel="stylesheet" href="./rdoc.css" type="text/css" media="screen" />
11
+
12
+ <script src="./js/jquery.js" type="text/javascript" charset="utf-8"></script>
13
+ <script src="./js/thickbox-compressed.js" type="text/javascript" charset="utf-8"></script>
14
+ <script src="./js/quicksearch.js" type="text/javascript" charset="utf-8"></script>
15
+ <script src="./js/darkfish.js" type="text/javascript" charset="utf-8"></script>
16
+
17
+ </head>
18
+ <body id="top" class="class">
19
+
20
+ <div id="metadata">
21
+ <div id="home-metadata">
22
+ <div id="home-section" class="section">
23
+ <h3 class="section-header">
24
+ <a href="./index.html">Home</a>
25
+ <a href="./index.html#classes">Classes</a>
26
+ <a href="./index.html#methods">Methods</a>
27
+ </h3>
28
+ </div>
29
+ </div>
30
+
31
+ <div id="file-metadata">
32
+ <div id="file-list-section" class="section">
33
+ <h3 class="section-header">In Files</h3>
34
+ <div class="section-body">
35
+ <ul>
36
+
37
+ <li><a href="./lib/workflow_to_galaxy_rb.html?TB_iframe=true&amp;height=550&amp;width=785"
38
+ class="thickbox" title="lib/workflow_to_galaxy.rb">lib/workflow_to_galaxy.rb</a></li>
39
+
40
+ </ul>
41
+ </div>
42
+ </div>
43
+
44
+
45
+ </div>
46
+
47
+ <div id="class-metadata">
48
+
49
+ <!-- Parent Class -->
50
+ <div id="parent-class-section" class="section">
51
+ <h3 class="section-header">Parent</h3>
52
+
53
+ <p class="link"></p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+
64
+
65
+ <!-- Included Modules -->
66
+ <div id="includes-section" class="section">
67
+ <h3 class="section-header">Included Modules</h3>
68
+ <ul class="link-list">
69
+
70
+
71
+ <li><span class="include">MyExperimentREST</span></li>
72
+
73
+
74
+
75
+ <li><a class="include" href="Generator.html">Generator</a></li>
76
+
77
+
78
+ </ul>
79
+ </div>
80
+
81
+ </div>
82
+
83
+ <div id="project-metadata">
84
+
85
+
86
+ <div id="fileindex-section" class="section project-section">
87
+ <h3 class="section-header">Files</h3>
88
+ <ul>
89
+
90
+ <li class="file"><a href="./CHANGES.html">CHANGES</a></li>
91
+
92
+ <li class="file"><a href="./LICENSE.html">LICENSE</a></li>
93
+
94
+ <li class="file"><a href="./README.html">README</a></li>
95
+
96
+ </ul>
97
+ </div>
98
+
99
+
100
+ <div id="classindex-section" class="section project-section">
101
+ <h3 class="section-header">Class/Module Index
102
+ <span class="search-toggle"><img src="./images/find.png"
103
+ height="16" width="16" alt="[+]"
104
+ title="show/hide quicksearch" /></span></h3>
105
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
106
+ <fieldset>
107
+ <legend>Quicksearch</legend>
108
+ <input type="text" name="quicksearch" value=""
109
+ class="quicksearch-field" />
110
+ </fieldset>
111
+ </form>
112
+
113
+ <ul class="link-list">
114
+
115
+ <li><a href="./Generator.html">Generator</a></li>
116
+
117
+ <li><a href="./Object.html">Object</a></li>
118
+
119
+ <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
120
+
121
+ </ul>
122
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
123
+ </div>
124
+
125
+
126
+ </div>
127
+ </div>
128
+
129
+ <div id="documentation">
130
+ <h1 class="class">Object</h1>
131
+
132
+ <div id="description" class="description">
133
+
134
+ </div><!-- description -->
135
+
136
+
137
+ <div id="5Buntitled-5D" class="documentation-section">
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+
146
+ <!-- Methods -->
147
+
148
+ </div><!-- 5Buntitled-5D -->
149
+
150
+
151
+ </div><!-- documentation -->
152
+
153
+ <div id="validator-badges">
154
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
155
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
156
+ Rdoc Generator</a> 2</small>.</p>
157
+ </div>
158
+
159
+ </body>
160
+ </html>
161
+
@@ -66,6 +66,8 @@
66
66
 
67
67
  <li><a href="./Generator.html">Generator</a></li>
68
68
 
69
+ <li><a href="./Object.html">Object</a></li>
70
+
69
71
  <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
70
72
 
71
73
  </ul>
@@ -84,7 +86,7 @@
84
86
  <p>Konstantinos Karasavvas</p>
85
87
  </td></tr><tr><td class="rdoc-term"><p>Gem Version</p></td>
86
88
  <td>
87
- <p>0.2.8</p>
89
+ <p>0.2.9</p>
88
90
  </td></tr><tr><td class="rdoc-term"><p>Contact</p></td>
89
91
  <td>
90
92
  <p><a href="mailto:kostas.karasavvas@nbic.nl">kostas.karasavvas@nbic.nl</a></p>
@@ -90,6 +90,8 @@
90
90
 
91
91
  <li><a href="./Generator.html">Generator</a></li>
92
92
 
93
+ <li><a href="./Object.html">Object</a></li>
94
+
93
95
  <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
94
96
 
95
97
  </ul>
@@ -1,6 +1,8 @@
1
- Fri, 22 Jul 2011 15:00:07 +0200
2
- lib/workflow-to-galaxy.rb Mon, 13 Dec 2010 15:22:40 +0100
3
- LICENSE Wed, 06 Apr 2011 16:41:53 +0200
4
- README Fri, 22 Jul 2011 14:51:41 +0200
5
- CHANGES Fri, 22 Jul 2011 14:46:31 +0200
6
- lib/workflow-to-galaxy/generator.rb Mon, 04 Jul 2011 16:13:08 +0200
1
+ Tue, 26 Jul 2011 16:38:29 +0200
2
+ lib/generator.rb Tue, 26 Jul 2011 16:35:55 +0200
3
+ lib/workflow-to-galaxy.rb Tue, 26 Jul 2011 16:35:55 +0200
4
+ LICENSE Tue, 26 Jul 2011 16:35:55 +0200
5
+ lib/workflow_to_galaxy.rb Tue, 26 Jul 2011 16:35:55 +0200
6
+ README Tue, 26 Jul 2011 16:35:55 +0200
7
+ CHANGES Tue, 26 Jul 2011 16:35:55 +0200
8
+ lib/workflow-to-galaxy/generator.rb Tue, 26 Jul 2011 16:35:55 +0200
@@ -29,7 +29,7 @@
29
29
  <p>Konstantinos Karasavvas</p>
30
30
  </td></tr><tr><td class="rdoc-term"><p>Gem Version</p></td>
31
31
  <td>
32
- <p>0.2.8</p>
32
+ <p>0.2.9</p>
33
33
  </td></tr><tr><td class="rdoc-term"><p>Contact</p></td>
34
34
  <td>
35
35
  <p><a href="mailto:kostas.karasavvas@nbic.nl">kostas.karasavvas@nbic.nl</a></p>
@@ -122,6 +122,8 @@ href="https://trac.nbic.nl/elabfactory/wiki/eGalaxy">trac.nbic.nl/elabfactory/wi
122
122
 
123
123
  <li class="module"><a href="Generator.html">Generator</a></li>
124
124
 
125
+ <li class="class"><a href="Object.html">Object</a></li>
126
+
125
127
  <li class="module"><a href="WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
126
128
 
127
129
  </ul>
@@ -0,0 +1,54 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: generator.rb [workflow-to-galaxy Docs]</title>
10
+
11
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Tue Jul 26 16:35:55 +0200 2011</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ </ul>
35
+ </dd>
36
+
37
+
38
+
39
+ </dl>
40
+ </div>
41
+
42
+ <div id="documentation">
43
+
44
+ <div class="description">
45
+ <h2>Description</h2>
46
+
47
+ <p>Contains code to generate the Galaxy’s tool xml and script files</p>
48
+
49
+ </div>
50
+
51
+ </div>
52
+ </body>
53
+ </html>
54
+
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">Mon Jul 04 16:13:08 +0200 2011</dd>
27
+ <dd class="modified-date">Tue Jul 26 16:35:55 +0200 2011</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -24,7 +24,7 @@
24
24
  <div id="metadata">
25
25
  <dl>
26
26
  <dt class="modified-date">Last Modified</dt>
27
- <dd class="modified-date">Mon Dec 13 15:22:40 +0100 2010</dd>
27
+ <dd class="modified-date">Tue Jul 26 16:35:55 +0200 2011</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -0,0 +1,60 @@
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
4
+
5
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6
+ <head>
7
+ <meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
8
+
9
+ <title>File: workflow_to_galaxy.rb [workflow-to-galaxy Docs]</title>
10
+
11
+ <link type="text/css" media="screen" href="../rdoc.css" rel="stylesheet" />
12
+
13
+ <script src="../js/jquery.js" type="text/javascript"
14
+ charset="utf-8"></script>
15
+ <script src="../js/thickbox-compressed.js" type="text/javascript"
16
+ charset="utf-8"></script>
17
+ <script src="../js/quicksearch.js" type="text/javascript"
18
+ charset="utf-8"></script>
19
+ <script src="../js/darkfish.js" type="text/javascript"
20
+ charset="utf-8"></script>
21
+ </head>
22
+
23
+ <body class="file file-popup">
24
+ <div id="metadata">
25
+ <dl>
26
+ <dt class="modified-date">Last Modified</dt>
27
+ <dd class="modified-date">Tue Jul 26 16:35:55 +0200 2011</dd>
28
+
29
+
30
+ <dt class="requires">Requires</dt>
31
+ <dd class="requires">
32
+ <ul>
33
+
34
+ <li>rubygems</li>
35
+
36
+ <li>optparse</li>
37
+
38
+ <li>myexperiment-rest</li>
39
+
40
+ <li>generator</li>
41
+
42
+ </ul>
43
+ </dd>
44
+
45
+
46
+
47
+ </dl>
48
+ </div>
49
+
50
+ <div id="documentation">
51
+
52
+ <div class="description">
53
+ <h2>Description</h2>
54
+
55
+ </div>
56
+
57
+ </div>
58
+ </body>
59
+ </html>
60
+
@@ -0,0 +1,265 @@
1
+
2
+ # Contains code to generate the Galaxy's tool xml and script files
3
+ module Generator
4
+
5
+ INDENT = " "
6
+
7
+
8
+ # private methods
9
+ private
10
+
11
+ def tool_b(out, name)
12
+ out.write("<tool id=\"#{name}_id\" name=\"#{name}\">\n")
13
+ end
14
+
15
+ def command_be(out, me_rest, script)
16
+ out.write "#{INDENT}<command interpreter=\"ruby\">"
17
+ out.write script + " "
18
+ me_rest.workflow.inputs.each do |i|
19
+ out.write "\"$#{i.name}\" "
20
+ end
21
+ me_rest.workflow.outputs.each do |o|
22
+ out.write "$#{o.name} "
23
+ end
24
+ out.write "</command>\n"
25
+ end
26
+
27
+ def inputs_be(out, inputs)
28
+ out.write "#{INDENT}<inputs>\n"
29
+ if inputs.size >= 1
30
+ inputs.each do |i|
31
+ 2.times { out.write "#{INDENT}" }
32
+ out.write "<param name=\"#{i.name}\" type=\"text\" size=\"30\" "
33
+ if i.examples.size >= 1
34
+ # escape double quotes characters for galaxy's xml file
35
+ ex = i.examples[0].to_s.gsub('"', '&quot;')
36
+ out.write "value=\"#{ex}\" "
37
+ end
38
+ out.write "label=\"Enter #{i.name}\"/>\n"
39
+ end
40
+ else
41
+ 2.times { out.write "#{INDENT}" }
42
+ out.write "<param name=\"input\" type=\"select\" display=\"radio\" size=\"250\" label=\"This workflow has no inputs\" />\n"
43
+ end
44
+ out.write "#{INDENT}</inputs>\n"
45
+ end
46
+
47
+ def outputs_be(out, outputs)
48
+ out.write "#{INDENT}<outputs>\n"
49
+ outputs.each do |o|
50
+ 2.times { out.write "#{INDENT}" }
51
+ out.write "<data format=\"tabular\" name=\"#{o.name}\" label=\"#{o.name}\"/>\n"
52
+ end
53
+ out.write "#{INDENT}</outputs>\n"
54
+ end
55
+
56
+ def help_be(out, me_rest)
57
+ out.write "#{INDENT}<help>\n"
58
+ out.write "**What it does**\n\n"
59
+
60
+ # Sometimes the workflow description contains HTML tags that are not allowed
61
+ # in Galaxy's xml interface specification and thus are removed! Same for
62
+ # HTML entities!
63
+ out.write me_rest.workflow.description.gsub(/<.*?>|&.*?;/, '') + "\n\n"
64
+
65
+ if me_rest.workflow.inputs.size >= 1
66
+ out.write "-----\n\n"
67
+ out.write "**Inputs**\n\n"
68
+ me_rest.workflow.inputs.each do |i|
69
+ out.write "- **#{i.name}** "
70
+ if i.descriptions.size >= 1
71
+ i.descriptions.each do |desc|
72
+ out.write desc.to_s + " "
73
+ end
74
+ end
75
+ if i.examples.size >= 1
76
+ out.write "Examples include:\n\n"
77
+ i.examples.each do |ex|
78
+ out.write " - " + ex.to_s + "\n"
79
+ end
80
+ end
81
+ out.write "\n"
82
+ end
83
+ out.write "\n"
84
+ end
85
+
86
+ # TODO this code is identical to the inputs code above -- method?
87
+ if me_rest.workflow.outputs.size >= 1
88
+ out.write "-----\n\n"
89
+ out.write "**Outputs**\n\n"
90
+ me_rest.workflow.outputs.each do |o|
91
+ out.write "- **#{o.name}** "
92
+ if o.descriptions.size >= 1
93
+ o.descriptions.each do |desc|
94
+ out.write desc.to_s + " "
95
+ end
96
+ end
97
+ if o.examples.size >= 1
98
+ out.write "Examples include:\n\n"
99
+ o.examples.each do |ex|
100
+ out.write " - " + ex.to_s + "\n"
101
+ end
102
+ end
103
+ out.write "\n"
104
+ end
105
+ out.write "\n"
106
+ end
107
+
108
+
109
+ out.write "-----\n\n"
110
+ out.write "For more information on that workflow please visit #{me_rest.uri.gsub(/(.*workflows\/\d+)[\/.].*/, '\1')}.\n"
111
+
112
+ out.write "#{INDENT}</help>\n"
113
+ end
114
+
115
+ def tool_e(out)
116
+ out.write("</tool>\n")
117
+ end
118
+
119
+
120
+
121
+
122
+ def script_preample(out)
123
+ out.write("#!/usr/bin/env ruby\n\n")
124
+ out.write("require 'rubygems'\n")
125
+ out.write("require 't2-server'\n")
126
+ out.write("require 'open-uri'\n\n")
127
+ end
128
+
129
+ def script_util_methods(out)
130
+
131
+ out.write <<UTIL_METHODS
132
+
133
+ # method that flattens the list of list of list ... result of get_output
134
+ def print_flattened_result(out, data_lists)
135
+ data_lists.each do |l|
136
+ if l.instance_of? Array
137
+ print_flattened_result(out, l)
138
+ else
139
+ out.puts l
140
+ end
141
+ end
142
+ end
143
+
144
+
145
+ # method that acquires all the results of the specified output
146
+ def get_outputs(run, refs, outfile, dir)
147
+ data_lists = run.get_output(dir, refs)
148
+ print_flattened_result(outfile, data_lists)
149
+ end
150
+
151
+
152
+ #
153
+ # Sanitize single and double quotes in str. E.g. galaxy substitures them to
154
+ # __sq__ and __dq__ respectively. This methods turns them back to their
155
+ # original values before using them
156
+ #
157
+ def sanitize(string)
158
+ string.gsub(/(__sq__|__dq__|__at__)/) do
159
+ if $1 == '__sq__'
160
+ "'"
161
+ elsif $1 == '__dq__'
162
+ '\\\"'
163
+ else
164
+ '@'
165
+ end
166
+ end
167
+ end
168
+
169
+ UTIL_METHODS
170
+
171
+ end
172
+
173
+
174
+ def script_create_t2_run(out, wkf_uri, t2_uri)
175
+ out.write <<CREATE_T2_RUN
176
+
177
+ # use the uri reference to download the workflow locally
178
+ wkf_file = URI.parse('#{wkf_uri}')
179
+ in_wkf = open(wkf_file)
180
+ wkf = in_wkf.read()
181
+
182
+ # create run
183
+ begin
184
+ run = T2Server::Run.create('#{t2_uri}', wkf)
185
+ rescue T2Server::T2ServerError => e
186
+ exit 1
187
+ end
188
+
189
+ CREATE_T2_RUN
190
+
191
+ end
192
+
193
+
194
+ def script_init_inputs(out, me_rest)
195
+ out.write "# get input arguments\n"
196
+ 0.upto(me_rest.workflow.inputs.size-1) do |i|
197
+ out.write "input#{i}_arg = ARGV[#{i}].chomp\n"
198
+ out.write "run.set_input('" + me_rest.workflow.inputs[i].name.to_s + "', sanitize(input#{i}_arg))\n"
199
+ end
200
+
201
+ end
202
+
203
+
204
+ def script_start_run(out)
205
+ out.write <<START_RUN
206
+
207
+ # start run and wait until it is finished
208
+ run.start
209
+ run.wait(:progress => true)
210
+
211
+ START_RUN
212
+ end
213
+
214
+
215
+ def script_get_outputs(out, me_rest)
216
+ outputs_start_index = me_rest.workflow.inputs.size
217
+ outputs_end_index = outputs_start_index + me_rest.workflow.outputs.size - 1
218
+ out.write "# get output arguments and associated them with a file\n"
219
+ outputs_start_index.upto(outputs_end_index) do |o|
220
+ out.write "output#{o} = File.open(ARGV[#{o}], \"w\")\n"
221
+ out.write "get_outputs(run, false, output#{o}, '" + me_rest.workflow.outputs[o - outputs_start_index].name.to_s + "')\n"
222
+ end
223
+
224
+ end
225
+
226
+
227
+ def script_finish_run(out)
228
+ out.write "\n# delete run\n"
229
+ out.write "run.delete\n"
230
+ end
231
+
232
+
233
+
234
+ # public methods from here onwards
235
+ public
236
+
237
+ # Generates the Galaxy tool's xml file responsible for the UI.
238
+ def generate_xml(me_rest, xml_file)
239
+ out = File.open(xml_file, "w")
240
+ tool_b(out, me_rest.workflow.title)
241
+ command_be(out, me_rest, xml_file.gsub('.xml', '.rb'))
242
+ inputs_be(out, me_rest.workflow.inputs)
243
+ outputs_be(out, me_rest.workflow.outputs)
244
+ help_be(out, me_rest)
245
+ tool_e(out)
246
+ out.close
247
+ end
248
+
249
+ #
250
+ # Generates the Galaxy tool's script file responsible for talking to the
251
+ # taverna server
252
+ #
253
+ def generate_script(me_rest, t2_server, script_file)
254
+ out = File.open(script_file, "w")
255
+ script_preample(out)
256
+ script_util_methods(out)
257
+ script_create_t2_run(out, me_rest.uri, t2_server)
258
+ script_init_inputs(out, me_rest)
259
+ script_start_run(out)
260
+ script_get_outputs(out, me_rest)
261
+ script_finish_run(out)
262
+ out.close
263
+ end
264
+
265
+ end
@@ -1,7 +1,8 @@
1
1
  #
2
2
  # The Generator module contains two public methods that generate a Galaxy's tool
3
3
  # XML and script files
4
- #
4
+ #--
5
+ # Add appropriate requires here. Currently they are all in the executable!
5
6
  module Generator
6
7
 
7
8
  # private methods
@@ -106,27 +107,30 @@ module Generator
106
107
  # Galaxy's XML help tag
107
108
  def help_tag(out, t2_workflow)
108
109
  out.write indent(1) + "<help>\n"
109
- out.write "**What it does**\n\n"
110
110
 
111
- description = t2_workflow.description + "\n\n"
111
+ if t2_workflow.description
112
+ out.write "**What it does**\n\n"
112
113
 
113
- # Sometimes the workflow description contains HTML tags that are not allowed
114
- # in Galaxy's xml interface specification and thus are removed! Same for
115
- # HTML entities!
116
- # TODO go through tags and find Galaxy's equivalent to include
117
- description.gsub!(/<.*?>|&.*?;/, '')
114
+ description = t2_workflow.description + "\n\n"
118
115
 
119
- # To remove ^M (cntl-v + cntl-m) characters that DOS files might have
120
- description.gsub!(/\r/, '')
121
-
122
- # TODO that works as a literal too but font changes to courier!
123
- #out.write "::\n\n" # Start Galaxy's literal block to ignore indendation
116
+ # Sometimes the workflow description contains HTML tags that are not allowed
117
+ # in Galaxy's xml interface specification and thus are removed! Same for
118
+ # HTML entities!
119
+ # TODO go through tags and find Galaxy's equivalent to include
120
+ description.gsub!(/<.*?>|&.*?;/, '')
121
+
122
+ # To remove ^M (cntl-v + cntl-m) characters that DOS files might have
123
+ description.gsub!(/\r/, '')
124
+
125
+ # TODO that works as a literal too but font changes to courier!
126
+ #out.write "::\n\n" # Start Galaxy's literal block to ignore indendation
124
127
 
125
- # remove indendation from all description lines since Galaxy is confused by it
126
- description.split(/[\n]/).each { |l| out.write "#{l.gsub(/^\s+/, '')}\n" }
128
+ # remove indendation from all description lines since Galaxy is confused by it
129
+ description.split(/[\n]/).each { |l| out.write "#{l.gsub(/^\s+/, '')}\n" }
127
130
 
128
- # endline makes the following be parsed as a Galaxy GUI construct
129
- out.write "\n"
131
+ # endline makes the following be parsed as a Galaxy GUI construct
132
+ out.write "\n"
133
+ end
130
134
 
131
135
  # if at least one input add it to tool's UI help description
132
136
  if t2_workflow.inputs.size >= 1
@@ -218,6 +222,16 @@ module Generator
218
222
  # Galaxy's script preample
219
223
  def script_preample(out)
220
224
  out.write("#!/usr/bin/env ruby\n\n")
225
+
226
+ out.write("# This script can be tested without Galaxy. You can run from the shell as follows:\n#\n")
227
+ out.write("# $ script_name.rb <input1> true|false <input2> true|false yes|no <output1> <output2>\n#\n")
228
+ out.write("# After each input value a boolean specifies if the value is literal (false) or if\n")
229
+ out.write("# it specifies a file name to read as input.\n#\n")
230
+ out.write("# After all workflow inputs a yes or no input specifies if we also want our results zipped.\n#\n")
231
+ out.write("# Finally, all the output files follow. Note that if you selected to also get a zip\n")
232
+ out.write("# then you need to specify an additional output in the end after the normal workflow\n")
233
+ out.write("# outputs.\n\n")
234
+
221
235
  out.write("require 'rubygems'\n")
222
236
  out.write("require 't2-server'\n")
223
237
  out.write("require 'open-uri'\n")
@@ -0,0 +1,65 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'rubygems'
4
+ require 'optparse'
5
+ require 'myexperiment-rest'
6
+ require 'generator'
7
+
8
+ include MyExperimentREST
9
+ include Generator
10
+
11
+
12
+ # Set up and parse arguments
13
+ out_file = ""
14
+ t2_server = ""
15
+ opts = OptionParser.new do |opt|
16
+ opt.banner = "Usage: workflow_to_galaxy [options] <myExperiement-workflow>"
17
+ opt.separator ""
18
+ opt.separator "Generates a Galaxy tool (a UI xml definition plus a script) for the "
19
+ opt.separator "specified Taverna2 workflow, where <myExperiment-workflow> is "
20
+ opt.separator "the full URL of the workflow in the myExperiment website. Available "
21
+ opt.separator "options are:"
22
+
23
+ opt.on("-o OUTPUT", "--output=OUTPUT", "The file name(s) of the generated tool. " +
24
+ "If it is not specified then the workflow's name will be used.") do |val|
25
+ out_file = val if val != nil
26
+ end
27
+
28
+ opt.on("-s SERVER", "--server=SERVER", "The taverna server that the script will request execution from. " +
29
+ "If it is not specified then 'http://localhost:8980/taverna-server' will be used.") do |val|
30
+ t2_server = val if val != nil
31
+ end
32
+ end
33
+
34
+ opts.parse!
35
+
36
+ # Read and check workflow URL
37
+ url = ARGV.shift
38
+ if url == nil
39
+ puts opts
40
+ exit 1
41
+ end
42
+
43
+ # Get workflow data from myexperiment
44
+ me_rest = ReadWorkflow.new(url)
45
+
46
+ # Set output files
47
+ if out_file != ""
48
+ xml_file = "#{out_file}.xml"
49
+ script_file = "#{out_file}.rb"
50
+ else
51
+ xml_file = "#{me_rest.workflow.title}".gsub(/\W/, '') + ".xml"
52
+ script_file = "#{me_rest.workflow.title}".gsub(/\W/, '') + ".rb"
53
+ end
54
+
55
+ # Set taverna server
56
+ if t2_server == ""
57
+ t2_server = "http://localhost:8980/taverna-server"
58
+ end
59
+
60
+
61
+
62
+ generate_xml(me_rest, xml_file)
63
+ generate_script(me_rest, t2_server, script_file)
64
+
65
+
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workflow-to-galaxy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 8
10
- version: 0.2.8
9
+ - 9
10
+ version: 0.2.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Kostas Karasavvas
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2011-07-22 00:00:00 Z
18
+ date: 2011-07-26 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: myexperiment-rest
@@ -97,6 +97,8 @@ files:
97
97
  - CHANGES
98
98
  - Rakefile
99
99
  - bin/workflow_to_galaxy.rb
100
+ - lib/workflow_to_galaxy.rb
101
+ - lib/generator.rb
100
102
  - lib/workflow-to-galaxy/generator.rb
101
103
  - lib/workflow-to-galaxy.rb
102
104
  - doc/rdoc/WorkflowToGalaxy.html
@@ -109,7 +111,10 @@ files:
109
111
  - doc/rdoc/js/darkfish.js
110
112
  - doc/rdoc/js/quicksearch.js
111
113
  - doc/rdoc/README.html
114
+ - doc/rdoc/Object.html
115
+ - doc/rdoc/lib/workflow_to_galaxy_rb.html
112
116
  - doc/rdoc/lib/workflow-to-galaxy_rb.html
117
+ - doc/rdoc/lib/generator_rb.html
113
118
  - doc/rdoc/lib/workflow-to-galaxy/generator_rb.html
114
119
  - doc/rdoc/created.rid
115
120
  - doc/rdoc/CHANGES.html