Changeset 84

Show
Ignore:
Timestamp:
28-01-11 16:45:13 (3 years ago)
Author:
kostas.karasavvas@…
Message:

updated test files for new generated output

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • galaxy-taverna/workflow-to-galaxy/test/Expected_BioAID_ProteinDiscovery_rb

    r75 r84  
    2626 
    2727# 
    28 # Sanitize single and double quotes in str. E.g. galaxy substitutes them to 
    29 # __sq__ and __dq__ respectively. This methods turns them back to their 
    30 # original values before using them 
     28# Sanitize single quotes, double quotes, at symbol and newline in str. E.g. Galaxy 
     29# substitutes them to __sq__, __dq__, __at__ and __cr____cn__ respectively. This 
     30# methods turns them back to their original values before using them (i.e. 
     31# sending them to the taverna server 
    3132# 
    3233def sanitize(string) 
    33   string.gsub(/(__sq__|__dq__|__at__)/) do 
     34  string.gsub(/(__sq__|__dq__|__at__|__cr____cn__)/) do 
    3435    if $1 == '__sq__' 
    3536      "'" 
    3637    elsif $1 == '__dq__' 
    3738      '\"' 
     39    elsif $1 == '__cr____cn__' 
     40      '
' 
    3841    else 
    3942      '@' 
     
    4144  end 
    4245end 
     46 
     47# 
     48# Deletes last new line of file if it exists! It is needed for t2 workflows that 
     49# do not sanitize properly, i.e. via a user-provided beanshell script 
     50# 
     51def chomp_last_newline(file) 
     52 
     53  if File.file?(file) and File.size(file) > 1 
     54    f = open(file, "rb+") 
     55    f.seek(-1, File::SEEK_END) 
     56    f.truncate(File.size(file) - 1) if f.read(1) == "\n" 
     57    f.close 
     58  end 
     59 
     60end 
     61 
    4362 
    4463 
     
    6079Query_tmp = ARGV[1].chomp 
    6180if Query_from_history == "true" 
     81  chomp_last_newline(Query_tmp) 
    6282  run.upload_input_file('Query', Query_tmp) 
    6383else 
     
    6787maxHits_parameter_tmp = ARGV[3].chomp 
    6888if maxHits_parameter_from_history == "true" 
     89  chomp_last_newline(maxHits_parameter_tmp) 
    6990  run.upload_input_file('maxHits_parameter', maxHits_parameter_tmp) 
    7091else 
     
    7899# get output arguments and associated them with a file 
    79100output4 = File.open(ARGV[4], "w") 
    80 get_outputs(run, false, output4, 'ValidatedProtein') 
     101begin 
     102  get_outputs(run, false, output4, 'ValidatedProtein') 
     103rescue Exception => err 
     104  get_outputs(run, false, output4, 'ValidatedProtein.error') 
     105end 
    81106output5 = File.open(ARGV[5], "w") 
    82 get_outputs(run, false, output5, 'UniProtID') 
     107begin 
     108  get_outputs(run, false, output5, 'UniProtID') 
     109rescue Exception => err 
     110  get_outputs(run, false, output5, 'UniProtID.error') 
     111end 
    83112 
    84113# delete run