workflow-to-galaxy 0.2.9 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,65 +0,0 @@
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
-