Changeset 173

Show
Ignore:
Timestamp:
16-01-12 16:21:39 (2 years ago)
Author:
kostas.karasavvas@…
Message:

Added an optional parameter (:response) to the config in case we already have the myExp wkf

Location:
galaxy-taverna/workflow-to-galaxy/trunk
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • galaxy-taverna/workflow-to-galaxy/trunk/bin/workflow_to_galaxy.rb

    r162 r173  
    1010 
    1111# Set up and parse arguments 
    12 out_file = "" 
    13 t2_server = "" 
     12out_file = nil 
     13t2_server = nil 
    1414options = {} 
    1515opts = OptionParser.new do |opt| 
     
    5050 
    5151# Set taverna server if not specified 
    52 t2_server ||= "http://localhost:8080/taverna-server" 
     52t2_server ||= 'http://localhost:8080/taverna-server' 
    5353 
    5454 
     
    6060 
    6161# create file handlers 
    62 if out_file != "" 
     62if out_file != nil 
    6363  xml_out = open("#{out_file}.xml", "w") 
    6464  rb_out = open("#{out_file}.rb", "w") 
     
    6969# if/else but future sources would still need them) 
    7070if options[:t2flow] 
    71   if out_file != "" 
     71  if out_file != nil 
    7272    wkf = GalaxyTool.new(:wkf_source => Workflows::T2FLOW, 
    7373                         :params => {:t2_server => t2_server, 
     
    8181  end 
    8282else 
    83   if out_file != "" 
     83  if out_file != nil 
    8484    wkf = GalaxyTool.new(:wkf_source => Workflows::MYEXPERIMENT_TAVERNA2, 
    8585                         :params => {:t2_server => t2_server, 
     
    9595 
    9696# close file handlers 
    97 if out_file != "" 
     97if out_file != nil 
    9898  xml_out.close 
    9999  rb_out.close 
  • galaxy-taverna/workflow-to-galaxy/trunk/CHANGES

    r171 r173  
    44* Multiline output examples are now displayed better in HTML/Galaxy (similar to inputs) 
    55* 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 
    69 
    710 
  • galaxy-taverna/workflow-to-galaxy/trunk/lib/workflow-to-galaxy/galaxy.rb

    r170 r173  
    2929    #   :xml_out    (the file handle for the generated xml -- optional) 
    3030    #   :rb_out    (the file handle for the generated rb -- optional) 
     31    #   :response  (the response from myExperiment if already obtained -- optional) 
    3132    # 
    3233    # :params     (a hash with the following parameters -- T2FLOW) 
     
    581582    def generate 
    582583 
    583       # check the type of workflow source and acquire the appropriate data 
    584       if(config[:wkf_source] == Workflows::MYEXPERIMENT_TAVERNA2) 
    585  
    586         # TODO: check and add auth stuff -- even more unsafe with session cookies 
    587         # since the myexp username/passwd will be saved in the galaxy ruby script 
    588         # for all to see... 
    589  
    590         begin 
    591           # Get workflow data from myexperiment -- a _MyExperimentWorkflow_ object is returned 
    592           @wkf_object = MyExperimentREST::Workflow.from_uri(@config[:params][:url]) 
    593         rescue Exception => e 
    594           raise "Problem acquiring workflow data from myExperiment!\n" + e 
     584      if(config[:params][:response]) 
     585 
     586        @wkf_object = config[:params][:response] 
     587 
     588      else 
     589 
     590        # check the type of workflow source and acquire the appropriate data 
     591        if(config[:wkf_source] == Workflows::MYEXPERIMENT_TAVERNA2) 
     592 
     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... 
     596 
     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!" 
    595615        end 
    596  
    597       elsif(config[:wkf_source] == Workflows::T2FLOW) 
    598  
    599         begin 
    600           # Get workflow data from t2flow file -- a _MyExperimentWorkflow_ object is returned 
    601           @wkf_object = populate_taverna_workflow_from_t2flow(@config[:params][:t2flow]) 
    602         rescue Exception => e 
    603           raise "Problem acquiring workflow data from t2flow file!\n" + e 
    604         end 
    605  
    606       else 
    607         raise "No such workflow source supported!" 
    608616      end 
    609617