Module: Generator

Defined in:
lib/workflow-to-galaxy/generator.rb

Overview

The Generator module contains two public methods that generate a Galaxy’s tool XML and script files

Instance Method Summary collapse

Instance Method Details

#generate_script(t2_workflow, t2_server, script_out) ⇒ Object

Generates the Galaxy tool’s script file responsible for talking to the taverna server

:call-seq:

Generator.generate_script(my_exp_rest, t2_server, script_file) -> nil
my_exp_rest

a Workflow object as returned from MyExperimentREST.ReadWorkflow.new(url)

t2_server

a string containing the URL of the taverna 2 server

script_out

the file handler to write the generated script code



487
488
489
490
491
492
493
494
495
# File 'lib/workflow-to-galaxy/generator.rb', line 487

def generate_script(t2_workflow, t2_server, script_out)
  script_preample(script_out)
  script_util_methods(script_out)
  script_create_t2_run(script_out, t2_workflow, t2_server)
  script_init_inputs(script_out, t2_workflow)
  script_start_run(script_out)
  script_get_outputs(script_out, t2_workflow)
  script_finish_run(script_out)
end

#generate_xml(t2_workflow, xml_file, xml_out) ⇒ Object

Generates the Galaxy tool’s xml file responsible for the UI.

:call-seq:

Generator.generate_xml(my_exp_rest, xml_file) -> nil
t2_workflow

a Workflow object as returned from MyExperimentREST::Workflows.new.read(url)

xml_file

a string containing the name of the generated XML file

xml_out

the file handler to write the generated XML tags



468
469
470
471
472
473
474
475
# File 'lib/workflow-to-galaxy/generator.rb', line 468

def generate_xml(t2_workflow, xml_file, xml_out)
  tool_begin_tag(xml_out, t2_workflow.title)
  command_tag(xml_out, t2_workflow, xml_file.gsub('.xml', '.rb'))
  inputs_tag(xml_out, t2_workflow.inputs)
  outputs_tag(xml_out, t2_workflow.outputs)
  help_tag(xml_out, t2_workflow)
  tool_end_tag(xml_out)
end