workflow-to-galaxy 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES CHANGED
@@ -1,8 +1,22 @@
1
1
  = Changes log for the Taverna-Galaxy Gem
2
2
 
3
+ == Version 0.3.3
4
+ * Multiline output examples are now displayed better in HTML/Galaxy (similar to inputs)
5
+ * Updated wkf 74 test
6
+ * Fixed default values for output files and taverna server
7
+ * Added an optional parameter (:response) to the config in case we already have the myExp wkf
8
+ - was needed by myExperiment in order to call the myExp REST API beforehand for auth
9
+
10
+
11
+ == Version 0.3.2
12
+ * Automatic filename creation is more robust (all special chars are removed)
13
+ * More workflow tests
14
+
15
+
3
16
  == Version 0.3.1
4
- * Use semver formally... (tag: v0.3.1 semver !!) ????
5
- * For safety default file names substiture ' ' with '_'
17
+ * Used semver formally (taged: v0.3.1 semver)
18
+ * For safety default wkf title substitutes ' ' with '_'
19
+ * Extended workflow tests
6
20
 
7
21
 
8
22
  == Version 0.3.0
data/README CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
  Authors:: Konstantinos Karasavvas
5
- Gem Version:: 0.3.0
5
+ Gem Version:: 0.3.3
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
@@ -7,7 +7,7 @@ require 'rdoc/task'
7
7
 
8
8
  spec = Gem::Specification.new do |s|
9
9
  s.name = 'workflow-to-galaxy'
10
- s.version = '0.3.1'
10
+ s.version = '0.3.3'
11
11
  s.extra_rdoc_files = ['README', 'LICENSE', 'CHANGES']
12
12
  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).'
13
13
  s.description = s.summary
@@ -9,8 +9,8 @@ include WorkflowToGalaxy
9
9
 
10
10
 
11
11
  # Set up and parse arguments
12
- out_file = ""
13
- t2_server = ""
12
+ out_file = nil
13
+ t2_server = nil
14
14
  options = {}
15
15
  opts = OptionParser.new do |opt|
16
16
  opt.banner = "Usage: workflow_to_galaxy [options] <myExperiment-workflow> | <t2flow-file>"
@@ -49,7 +49,7 @@ if url == nil
49
49
  end
50
50
 
51
51
  # Set taverna server if not specified
52
- t2_server ||= "http://localhost:8080/taverna-server"
52
+ t2_server ||= 'http://localhost:8080/taverna-server'
53
53
 
54
54
 
55
55
  #if options[:t2flow]
@@ -59,7 +59,7 @@ t2_server ||= "http://localhost:8080/taverna-server"
59
59
  #end
60
60
 
61
61
  # create file handlers
62
- if out_file != ""
62
+ if out_file != nil
63
63
  xml_out = open("#{out_file}.xml", "w")
64
64
  rb_out = open("#{out_file}.rb", "w")
65
65
  end
@@ -68,7 +68,7 @@ end
68
68
  # create generator or wrapper (could have used url for t2flow key to avoid
69
69
  # if/else but future sources would still need them)
70
70
  if options[:t2flow]
71
- if out_file != ""
71
+ if out_file != nil
72
72
  wkf = GalaxyTool.new(:wkf_source => Workflows::T2FLOW,
73
73
  :params => {:t2_server => t2_server,
74
74
  :t2flow => url,
@@ -80,7 +80,7 @@ if options[:t2flow]
80
80
  :t2flow => url } )
81
81
  end
82
82
  else
83
- if out_file != ""
83
+ if out_file != nil
84
84
  wkf = GalaxyTool.new(:wkf_source => Workflows::MYEXPERIMENT_TAVERNA2,
85
85
  :params => {:t2_server => t2_server,
86
86
  :url => url,
@@ -94,7 +94,7 @@ else
94
94
  end
95
95
 
96
96
  # close file handlers
97
- if out_file != ""
97
+ if out_file != nil
98
98
  xml_out.close
99
99
  rb_out.close
100
100
  end
@@ -70,6 +70,8 @@
70
70
 
71
71
  <li><a href="./WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
72
72
 
73
+ <li><a href="./String.html">String</a></li>
74
+
73
75
  </ul>
74
76
  <div id="no-class-search-results" style="display: none;">No matching classes.</div>
75
77
  </div>
@@ -82,11 +84,37 @@
82
84
 
83
85
  <h1>Changes log for the Taverna-Galaxy Gem</h1>
84
86
 
87
+ <h2>Version 0.3.3</h2>
88
+ <ul><li>
89
+ <p>Multiline output examples are now displayed better in HTML/Galaxy (similar
90
+ to inputs)</p>
91
+ </li><li>
92
+ <p>Updated wkf 74 test</p>
93
+ </li><li>
94
+ <p>Fixed default values for output files and taverna server</p>
95
+ </li><li>
96
+ <p>Added an optional parameter (:response) to the config in case we already
97
+ have the myExp wkf</p>
98
+ <ul><li>
99
+ <p>was needed by myExperiment in order to call the myExp REST API beforehand
100
+ for auth</p>
101
+ </li></ul>
102
+ </li></ul>
103
+
104
+ <h2>Version 0.3.2</h2>
105
+ <ul><li>
106
+ <p>Automatic filename creation is more robust (all special chars are removed)</p>
107
+ </li><li>
108
+ <p>More workflow tests</p>
109
+ </li></ul>
110
+
85
111
  <h2>Version 0.3.1</h2>
86
112
  <ul><li>
87
- <p>Use semver formally (tag: v0.3.1 semver !!) ????</p>
113
+ <p>Used semver formally (taged: v0.3.1 semver)</p>
114
+ </li><li>
115
+ <p>For safety default wkf title substitutes ‘ ’ with ‘_’</p>
88
116
  </li><li>
89
- <p>For safety default file names substiture ‘ ’ with ‘_’</p>
117
+ <p>Extended workflow tests</p>
90
118
  </li></ul>
91
119
 
92
120
  <h2>Version 0.3.0</h2>
@@ -70,6 +70,8 @@
70
70
 
71
71
  <li><a href="./WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
72
72
 
73
+ <li><a href="./String.html">String</a></li>
74
+
73
75
  </ul>
74
76
  <div id="no-class-search-results" style="display: none;">No matching classes.</div>
75
77
  </div>
@@ -70,6 +70,8 @@
70
70
 
71
71
  <li><a href="./WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
72
72
 
73
+ <li><a href="./String.html">String</a></li>
74
+
73
75
  </ul>
74
76
  <div id="no-class-search-results" style="display: none;">No matching classes.</div>
75
77
  </div>
@@ -86,7 +88,7 @@
86
88
  <p>Konstantinos Karasavvas</p>
87
89
  </td></tr><tr><td class="rdoc-term"><p>Gem Version</p></td>
88
90
  <td>
89
- <p>0.3.0</p>
91
+ <p>0.3.3</p>
90
92
  </td></tr><tr><td class="rdoc-term"><p>Contact</p></td>
91
93
  <td>
92
94
  <p><a href="mailto:kostas.karasavvas@nbic.nl">kostas.karasavvas@nbic.nl</a></p>
@@ -0,0 +1,203 @@
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: String</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">Object</p>
54
+
55
+ </div>
56
+
57
+
58
+
59
+
60
+
61
+
62
+
63
+ <!-- Method Quickref -->
64
+ <div id="method-list-section" class="section">
65
+ <h3 class="section-header">Methods</h3>
66
+ <ul class="link-list">
67
+
68
+ <li><a href="#method-i-to_filename">#to_filename</a></li>
69
+
70
+ </ul>
71
+ </div>
72
+
73
+
74
+
75
+ </div>
76
+
77
+ <div id="project-metadata">
78
+
79
+
80
+ <div id="fileindex-section" class="section project-section">
81
+ <h3 class="section-header">Files</h3>
82
+ <ul>
83
+
84
+ <li class="file"><a href="./CHANGES.html">CHANGES</a></li>
85
+
86
+ <li class="file"><a href="./LICENSE.html">LICENSE</a></li>
87
+
88
+ <li class="file"><a href="./README.html">README</a></li>
89
+
90
+ </ul>
91
+ </div>
92
+
93
+
94
+ <div id="classindex-section" class="section project-section">
95
+ <h3 class="section-header">Class/Module Index
96
+ <span class="search-toggle"><img src="./images/find.png"
97
+ height="16" width="16" alt="[+]"
98
+ title="show/hide quicksearch" /></span></h3>
99
+ <form action="#" method="get" accept-charset="utf-8" class="initially-hidden">
100
+ <fieldset>
101
+ <legend>Quicksearch</legend>
102
+ <input type="text" name="quicksearch" value=""
103
+ class="quicksearch-field" />
104
+ </fieldset>
105
+ </form>
106
+
107
+ <ul class="link-list">
108
+
109
+ <li><a href="./WorkflowToGalaxy.html">WorkflowToGalaxy</a></li>
110
+
111
+ <li><a href="./WorkflowToGalaxy/GalaxyTool.html">WorkflowToGalaxy::GalaxyTool</a></li>
112
+
113
+ <li><a href="./WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
114
+
115
+ <li><a href="./String.html">String</a></li>
116
+
117
+ </ul>
118
+ <div id="no-class-search-results" style="display: none;">No matching classes.</div>
119
+ </div>
120
+
121
+
122
+ </div>
123
+ </div>
124
+
125
+ <div id="documentation">
126
+ <h1 class="class">String</h1>
127
+
128
+ <div id="description" class="description">
129
+
130
+ <p>Add methods to the <a href="String.html">String</a> class to operate on
131
+ file paths.</p>
132
+
133
+ </div><!-- description -->
134
+
135
+
136
+ <div id="5Buntitled-5D" class="documentation-section">
137
+
138
+
139
+
140
+
141
+
142
+
143
+
144
+
145
+ <!-- Methods -->
146
+
147
+ <div id="public-instance-method-details" class="method-section section">
148
+ <h3 class="section-header">Public Instance Methods</h3>
149
+
150
+
151
+ <div id="to_filename-method" class="method-detail ">
152
+ <a name="method-i-to_filename"></a>
153
+
154
+
155
+
156
+ <div class="method-heading">
157
+ <span class="method-callseq">to_filename &rarr; string</span>
158
+
159
+ <span class="method-click-advice">click to toggle source</span>
160
+
161
+ </div>
162
+
163
+
164
+
165
+ <div class="method-description">
166
+
167
+ <p>Returns a new <a href="String.html">String</a> with spaces substituted by
168
+ underscores and removes all special characters.</p>
169
+
170
+
171
+
172
+ <div class="method-source-code" id="to_filename-source">
173
+ <pre>
174
+ <span class="ruby-comment"># File lib/workflow-to-galaxy.rb, line 17</span>
175
+ <span class="ruby-keyword">def</span> <span class="ruby-identifier">to_filename</span>
176
+ <span class="ruby-keyword">self</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/ /</span>, <span class="ruby-string">'_'</span>).<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/[^A-Za-z0-9_]/</span>, <span class="ruby-string">''</span>)
177
+ <span class="ruby-keyword">end</span></pre>
178
+ </div><!-- to_filename-source -->
179
+
180
+ </div>
181
+
182
+
183
+
184
+
185
+ </div><!-- to_filename-method -->
186
+
187
+
188
+ </div><!-- public-instance-method-details -->
189
+
190
+ </div><!-- 5Buntitled-5D -->
191
+
192
+
193
+ </div><!-- documentation -->
194
+
195
+ <div id="validator-badges">
196
+ <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
197
+ <p><small>Generated with the <a href="http://deveiate.org/projects/Darkfish-Rdoc/">Darkfish
198
+ Rdoc Generator</a> 2</small>.</p>
199
+ </div>
200
+
201
+ </body>
202
+ </html>
203
+
@@ -124,6 +124,8 @@
124
124
 
125
125
  <li><a href="./WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
126
126
 
127
+ <li><a href="./String.html">String</a></li>
128
+
127
129
  </ul>
128
130
  <div id="no-class-search-results" style="display: none;">No matching classes.</div>
129
131
  </div>
@@ -114,6 +114,8 @@
114
114
 
115
115
  <li><a href="../WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
116
116
 
117
+ <li><a href="../String.html">String</a></li>
118
+
117
119
  </ul>
118
120
  <div id="no-class-search-results" style="display: none;">No matching classes.</div>
119
121
  </div>
@@ -217,7 +219,7 @@ the workflow object that will be used to generate the galaxy tool</p>
217
219
 
218
220
  <div class="method-source-code" id="new-source">
219
221
  <pre>
220
- <span class="ruby-comment"># File lib/workflow-to-galaxy/galaxy.rb, line 39</span>
222
+ <span class="ruby-comment"># File lib/workflow-to-galaxy/galaxy.rb, line 40</span>
221
223
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">config</span>)
222
224
  <span class="ruby-ivar">@config</span> = <span class="ruby-identifier">config</span>
223
225
  <span class="ruby-keyword">end</span></pre>
@@ -260,41 +262,48 @@ the workflow object that will be used to generate the galaxy tool</p>
260
262
 
261
263
  <div class="method-source-code" id="generate-source">
262
264
  <pre>
263
- <span class="ruby-comment"># File lib/workflow-to-galaxy/galaxy.rb, line 575</span>
265
+ <span class="ruby-comment"># File lib/workflow-to-galaxy/galaxy.rb, line 582</span>
264
266
  <span class="ruby-keyword">def</span> <span class="ruby-identifier">generate</span>
265
267
 
266
- <span class="ruby-comment"># check the type of workflow source and acquire the appropriate data</span>
267
- <span class="ruby-keyword">if</span>(<span class="ruby-identifier">config</span>[<span class="ruby-value">:wkf_source</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">Workflows</span><span class="ruby-operator">::</span><span class="ruby-constant">MYEXPERIMENT_TAVERNA2</span>)
268
+ <span class="ruby-keyword">if</span>(<span class="ruby-identifier">config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:response</span>])
268
269
 
269
- <span class="ruby-comment"># TODO: check and add auth stuff -- even more unsafe with session cookies</span>
270
- <span class="ruby-comment"># since the myexp username/passwd will be saved in the galaxy ruby script</span>
271
- <span class="ruby-comment"># for all to see...</span>
270
+ <span class="ruby-ivar">@wkf_object</span> = <span class="ruby-identifier">config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:response</span>]
272
271
 
273
- <span class="ruby-keyword">begin</span>
274
- <span class="ruby-comment"># Get workflow data from myexperiment -- a _MyExperimentWorkflow_ object is returned</span>
275
- <span class="ruby-ivar">@wkf_object</span> = <span class="ruby-constant">MyExperimentREST</span><span class="ruby-operator">::</span><span class="ruby-constant">Workflow</span>.<span class="ruby-identifier">from_uri</span>(<span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:url</span>])
276
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
277
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Problem acquiring workflow data from myExperiment!\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>
278
- <span class="ruby-keyword">end</span>
272
+ <span class="ruby-keyword">else</span>
279
273
 
280
- <span class="ruby-keyword">elsif</span>(<span class="ruby-identifier">config</span>[<span class="ruby-value">:wkf_source</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">Workflows</span><span class="ruby-operator">::</span><span class="ruby-constant">T2FLOW</span>)
274
+ <span class="ruby-comment"># check the type of workflow source and acquire the appropriate data</span>
275
+ <span class="ruby-keyword">if</span>(<span class="ruby-identifier">config</span>[<span class="ruby-value">:wkf_source</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">Workflows</span><span class="ruby-operator">::</span><span class="ruby-constant">MYEXPERIMENT_TAVERNA2</span>)
281
276
 
282
- <span class="ruby-keyword">begin</span>
283
- <span class="ruby-comment"># Get workflow data from t2flow file -- a _MyExperimentWorkflow_ object is returned</span>
284
- <span class="ruby-ivar">@wkf_object</span> = <span class="ruby-identifier">populate_taverna_workflow_from_t2flow</span>(<span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:t2flow</span>])
285
- <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
286
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Problem acquiring workflow data from t2flow file!\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>
287
- <span class="ruby-keyword">end</span>
277
+ <span class="ruby-comment"># TODO: check and add auth stuff -- even more unsafe with session cookies</span>
278
+ <span class="ruby-comment"># since the myexp username/passwd will be saved in the galaxy ruby script</span>
279
+ <span class="ruby-comment"># for all to see...</span>
288
280
 
289
- <span class="ruby-keyword">else</span>
290
- <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;No such workflow source supported!&quot;</span>
281
+ <span class="ruby-keyword">begin</span>
282
+ <span class="ruby-comment"># Get workflow data from myexperiment -- a _MyExperimentWorkflow_ object is returned</span>
283
+ <span class="ruby-ivar">@wkf_object</span> = <span class="ruby-constant">MyExperimentREST</span><span class="ruby-operator">::</span><span class="ruby-constant">Workflow</span>.<span class="ruby-identifier">from_uri</span>(<span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:url</span>])
284
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
285
+ <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Problem acquiring workflow data from myExperiment!\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>
286
+ <span class="ruby-keyword">end</span>
287
+
288
+ <span class="ruby-keyword">elsif</span>(<span class="ruby-identifier">config</span>[<span class="ruby-value">:wkf_source</span>] <span class="ruby-operator">==</span> <span class="ruby-constant">Workflows</span><span class="ruby-operator">::</span><span class="ruby-constant">T2FLOW</span>)
289
+
290
+ <span class="ruby-keyword">begin</span>
291
+ <span class="ruby-comment"># Get workflow data from t2flow file -- a _MyExperimentWorkflow_ object is returned</span>
292
+ <span class="ruby-ivar">@wkf_object</span> = <span class="ruby-identifier">populate_taverna_workflow_from_t2flow</span>(<span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:t2flow</span>])
293
+ <span class="ruby-keyword">rescue</span> <span class="ruby-constant">Exception</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">e</span>
294
+ <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;Problem acquiring workflow data from t2flow file!\n&quot;</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">e</span>
295
+ <span class="ruby-keyword">end</span>
296
+
297
+ <span class="ruby-keyword">else</span>
298
+ <span class="ruby-identifier">raise</span> <span class="ruby-string">&quot;No such workflow source supported!&quot;</span>
299
+ <span class="ruby-keyword">end</span>
291
300
  <span class="ruby-keyword">end</span>
292
301
 
293
302
  <span class="ruby-comment"># if an xml_out file handler was not given provide one with the title as the value</span>
294
303
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:xml_out</span>]
295
304
  <span class="ruby-identifier">generate_xml</span>(<span class="ruby-ivar">@wkf_object</span>, <span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:xml_out</span>])
296
305
  <span class="ruby-keyword">else</span>
297
- <span class="ruby-identifier">xml_out</span> = <span class="ruby-identifier">open</span>(<span class="ruby-ivar">@wkf_object</span>.<span class="ruby-identifier">title</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/ /</span>, <span class="ruby-string">'_'</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;.xml&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>)
306
+ <span class="ruby-identifier">xml_out</span> = <span class="ruby-identifier">open</span>(<span class="ruby-ivar">@wkf_object</span>.<span class="ruby-identifier">title</span>.<span class="ruby-identifier">to_filename</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;.xml&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>)
298
307
  <span class="ruby-identifier">generate_xml</span>(<span class="ruby-ivar">@wkf_object</span>, <span class="ruby-identifier">xml_out</span>)
299
308
  <span class="ruby-identifier">xml_out</span>.<span class="ruby-identifier">close</span>
300
309
  <span class="ruby-keyword">end</span>
@@ -303,7 +312,7 @@ the workflow object that will be used to generate the galaxy tool</p>
303
312
  <span class="ruby-keyword">if</span> <span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:rb_out</span>]
304
313
  <span class="ruby-identifier">generate_rb</span>(<span class="ruby-ivar">@wkf_object</span>, <span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:rb_out</span>], <span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:t2_server</span>])
305
314
  <span class="ruby-keyword">else</span>
306
- <span class="ruby-identifier">rb_out</span> = <span class="ruby-identifier">open</span>(<span class="ruby-ivar">@wkf_object</span>.<span class="ruby-identifier">title</span>.<span class="ruby-identifier">gsub</span>(<span class="ruby-regexp">/ /</span>, <span class="ruby-string">'_'</span>) <span class="ruby-operator">+</span> <span class="ruby-string">&quot;.rb&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>)
315
+ <span class="ruby-identifier">rb_out</span> = <span class="ruby-identifier">open</span>(<span class="ruby-ivar">@wkf_object</span>.<span class="ruby-identifier">title</span>.<span class="ruby-identifier">to_filename</span> <span class="ruby-operator">+</span> <span class="ruby-string">&quot;.rb&quot;</span>, <span class="ruby-string">&quot;w&quot;</span>)
307
316
  <span class="ruby-identifier">generate_rb</span>(<span class="ruby-ivar">@wkf_object</span>, <span class="ruby-identifier">rb_out</span>, <span class="ruby-ivar">@config</span>[<span class="ruby-value">:params</span>][<span class="ruby-value">:t2_server</span>])
308
317
  <span class="ruby-identifier">rb_out</span>.<span class="ruby-identifier">close</span>
309
318
  <span class="ruby-keyword">end</span>
@@ -94,6 +94,8 @@
94
94
 
95
95
  <li><a href="../WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
96
96
 
97
+ <li><a href="../String.html">String</a></li>
98
+
97
99
  </ul>
98
100
  <div id="no-class-search-results" style="display: none;">No matching classes.</div>
99
101
  </div>
@@ -1,7 +1,7 @@
1
- Thu, 27 Oct 2011 11:03:06 +0200
2
- lib/workflow-to-galaxy.rb Thu, 13 Oct 2011 12:51:40 +0200
1
+ Mon, 16 Jan 2012 16:21:48 +0100
2
+ lib/workflow-to-galaxy.rb Tue, 15 Nov 2011 15:48:17 +0100
3
3
  lib/workflow-to-galaxy/constants.rb Mon, 10 Oct 2011 14:10:32 +0200
4
- lib/workflow-to-galaxy/galaxy.rb Thu, 27 Oct 2011 11:03:00 +0200
4
+ lib/workflow-to-galaxy/galaxy.rb Mon, 16 Jan 2012 14:03:11 +0100
5
5
  LICENSE Tue, 26 Jul 2011 16:35:55 +0200
6
- README Thu, 13 Oct 2011 16:23:10 +0200
7
- CHANGES Thu, 27 Oct 2011 10:48:55 +0200
6
+ README Thu, 12 Jan 2012 14:58:21 +0100
7
+ CHANGES Mon, 16 Jan 2012 16:21:32 +0100
@@ -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.3.0</p>
32
+ <p>0.3.3</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>
@@ -131,6 +131,8 @@ href="http://semver.org/.">semver.org/.</a></p>
131
131
 
132
132
  <li class="module"><a href="WorkflowToGalaxy/Workflows.html">WorkflowToGalaxy::Workflows</a></li>
133
133
 
134
+ <li class="class"><a href="String.html">String</a></li>
135
+
134
136
  </ul>
135
137
 
136
138
  <h2 id="methods">Methods</h2>
@@ -140,6 +142,8 @@ href="http://semver.org/.">semver.org/.</a></p>
140
142
 
141
143
  <li><a href="WorkflowToGalaxy/GalaxyTool.html#method-i-generate">#generate &mdash; WorkflowToGalaxy::GalaxyTool</a></li>
142
144
 
145
+ <li><a href="String.html#method-i-to_filename">#to_filename &mdash; String</a></li>
146
+
143
147
  </ul>
144
148
 
145
149
  <div id="validator-badges">
@@ -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">Thu Oct 27 11:03:00 +0200 2011</dd>
27
+ <dd class="modified-date">Mon Jan 16 14:03:11 +0100 2012</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">Thu Oct 13 12:51:40 +0200 2011</dd>
27
+ <dd class="modified-date">Tue Nov 15 15:48:17 +0100 2011</dd>
28
28
 
29
29
 
30
30
  <dt class="requires">Requires</dt>
@@ -5,3 +5,17 @@ require 'workflow-to-galaxy/constants'
5
5
  module WorkflowToGalaxy # TODO rename to WorkflowWrappers?
6
6
 
7
7
  end
8
+
9
+ # Add methods to the String class to operate on file paths.
10
+ class String
11
+
12
+ # :call-seq:
13
+ # str.to_filename -> string
14
+ #
15
+ # Returns a new String with spaces substituted by underscores and
16
+ # removes all special characters.
17
+ def to_filename
18
+ self.gsub(/ /, '_').gsub(/[^A-Za-z0-9_]/, '')
19
+ end
20
+
21
+ end
@@ -28,6 +28,7 @@ module WorkflowToGalaxy
28
28
  # :url (the myexperiment workflow URL)
29
29
  # :xml_out (the file handle for the generated xml -- optional)
30
30
  # :rb_out (the file handle for the generated rb -- optional)
31
+ # :response (the response from myExperiment if already obtained -- optional)
31
32
  #
32
33
  # :params (a hash with the following parameters -- T2FLOW)
33
34
  # :t2flow (the file name and path)
@@ -54,6 +55,8 @@ module WorkflowToGalaxy
54
55
 
55
56
  # Galaxy's XML tool tag
56
57
  def tool_begin_tag(out, name)
58
+ # wkf title is used for id but spaces are changed to underscores
59
+ # TODO: delete other special characters!!
57
60
  out.write("<tool id=\"#{name.gsub(/ /, '_')}_id\" name=\"#{name}\">\n")
58
61
  end
59
62
 
@@ -217,7 +220,10 @@ module WorkflowToGalaxy
217
220
  if o.examples.size >= 1
218
221
  out.write "Examples include:\n\n"
219
222
  o.examples.each do |ex|
220
- out.write " - " + ex.to_s + "\n"
223
+ # We could substitute them with with &#xA; that works for HTML (e.g. wkf 1180)
224
+ # But if an example input is truly multiline then input descr. will
225
+ # display them all as separate inputs...
226
+ out.write " - " + ex.to_s.gsub(/[\n]/, '&#xA; - ') + "\n"
221
227
  end
222
228
  end
223
229
  out.write "\n"
@@ -278,6 +284,7 @@ module WorkflowToGalaxy
278
284
 
279
285
  # Galaxy's script utility methods
280
286
  # TODO: use ruby's flatten instead of our own !!!
287
+ # TODO: add_to_zip_file does not work for multiple files -- with new API??
281
288
  def script_util_methods(out)
282
289
 
283
290
  out.write <<'UTIL_METHODS'
@@ -574,38 +581,45 @@ START_RUN
574
581
  #
575
582
  def generate
576
583
 
577
- # check the type of workflow source and acquire the appropriate data
578
- if(config[:wkf_source] == Workflows::MYEXPERIMENT_TAVERNA2)
584
+ if(config[:params][:response])
579
585
 
580
- # TODO: check and add auth stuff -- even more unsafe with session cookies
581
- # since the myexp username/passwd will be saved in the galaxy ruby script
582
- # for all to see...
586
+ @wkf_object = config[:params][:response]
583
587
 
584
- begin
585
- # Get workflow data from myexperiment -- a _MyExperimentWorkflow_ object is returned
586
- @wkf_object = MyExperimentREST::Workflow.from_uri(@config[:params][:url])
587
- rescue Exception => e
588
- raise "Problem acquiring workflow data from myExperiment!\n" + e
589
- end
588
+ else
590
589
 
591
- elsif(config[:wkf_source] == Workflows::T2FLOW)
590
+ # check the type of workflow source and acquire the appropriate data
591
+ if(config[:wkf_source] == Workflows::MYEXPERIMENT_TAVERNA2)
592
592
 
593
- begin
594
- # Get workflow data from t2flow file -- a _MyExperimentWorkflow_ object is returned
595
- @wkf_object = populate_taverna_workflow_from_t2flow(@config[:params][:t2flow])
596
- rescue Exception => e
597
- raise "Problem acquiring workflow data from t2flow file!\n" + e
598
- end
593
+ # TODO: check and add auth stuff -- even more unsafe with session cookies
594
+ # since the myexp username/passwd will be saved in the galaxy ruby script
595
+ # for all to see...
599
596
 
600
- else
601
- raise "No such workflow source supported!"
597
+ begin
598
+ # Get workflow data from myexperiment -- a _MyExperimentWorkflow_ object is returned
599
+ @wkf_object = MyExperimentREST::Workflow.from_uri(@config[:params][:url])
600
+ rescue Exception => e
601
+ raise "Problem acquiring workflow data from myExperiment!\n" + e
602
+ end
603
+
604
+ elsif(config[:wkf_source] == Workflows::T2FLOW)
605
+
606
+ begin
607
+ # Get workflow data from t2flow file -- a _MyExperimentWorkflow_ object is returned
608
+ @wkf_object = populate_taverna_workflow_from_t2flow(@config[:params][:t2flow])
609
+ rescue Exception => e
610
+ raise "Problem acquiring workflow data from t2flow file!\n" + e
611
+ end
612
+
613
+ else
614
+ raise "No such workflow source supported!"
615
+ end
602
616
  end
603
617
 
604
618
  # if an xml_out file handler was not given provide one with the title as the value
605
619
  if @config[:params][:xml_out]
606
620
  generate_xml(@wkf_object, @config[:params][:xml_out])
607
621
  else
608
- xml_out = open(@wkf_object.title.gsub(/ /, '_') + ".xml", "w")
622
+ xml_out = open(@wkf_object.title.to_filename + ".xml", "w")
609
623
  generate_xml(@wkf_object, xml_out)
610
624
  xml_out.close
611
625
  end
@@ -614,7 +628,7 @@ START_RUN
614
628
  if @config[:params][:rb_out]
615
629
  generate_rb(@wkf_object, @config[:params][:rb_out], @config[:params][:t2_server])
616
630
  else
617
- rb_out = open(@wkf_object.title.gsub(/ /, '_') + ".rb", "w")
631
+ rb_out = open(@wkf_object.title.to_filename + ".rb", "w")
618
632
  generate_rb(@wkf_object, rb_out, @config[:params][:t2_server])
619
633
  rb_out.close
620
634
  end
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: 17
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 1
10
- version: 0.3.1
9
+ - 3
10
+ version: 0.3.3
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-10-27 00:00:00 Z
18
+ date: 2012-01-16 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: myexperiment-rest
@@ -97,7 +97,6 @@ files:
97
97
  - CHANGES
98
98
  - Rakefile
99
99
  - bin/workflow_to_galaxy.rb
100
- - bin/Fetch_PDB_flatfile_from_RCSB_server.xml
101
100
  - lib/workflow-to-galaxy/galaxy.rb
102
101
  - lib/workflow-to-galaxy/constants.rb
103
102
  - lib/workflow-to-galaxy.rb
@@ -122,6 +121,7 @@ files:
122
121
  - doc/rdoc/lib/workflow-to-galaxy/constants_rb.html
123
122
  - doc/rdoc/created.rid
124
123
  - doc/rdoc/CHANGES.html
124
+ - doc/rdoc/String.html
125
125
  - doc/rdoc/images/find.png
126
126
  - doc/rdoc/images/bug.png
127
127
  - doc/rdoc/images/bullet_toggle_minus.png