comparison interprophet_wrapper.rb @ 2:25261529840c

Uploaded
author iracooke
date Mon, 04 Mar 2013 17:11:46 -0500
parents
children 3f0cb90824f1
comparison
equal deleted inserted replaced
1:49d15d40117d 2:25261529840c
1 require 'pathname'
2
3 $VERBOSE=nil
4
5 # Hard-Coded argument order and number of arguments
6 #
7 actual_output_path_string=ARGV[0]
8 use_nss=ARGV[1]
9 use_nrs=ARGV[2]
10 use_nse=ARGV[3]
11 use_nsi=ARGV[4]
12 use_nsm=ARGV[5]
13 minprob=ARGV[6]
14 minprob_val=ARGV[7]
15
16 wd= Dir.pwd
17 original_input_files=ARGV.drop(7)
18 # End hard coded args #
19
20 cmd=""
21
22 output_substitution_cmds=""
23
24 input_files=original_input_files.collect do |input|
25
26 # We append ".pep.xml" to the input file name because interprophet can't handle anything else
27 # In order for this to work properly we need to create a symbolic link our working directory
28 #
29 original_input_path=Pathname.new("#{input}")
30 actual_input_path_string="#{wd}/#{original_input_path.basename}.pep.xml"
31
32 cmd << "ln -s #{input} #{actual_input_path_string};"
33 output_substitution_cmds << "ruby -pi -e \"gsub('#{actual_input_path_string}', '#{input}.pep.xml')\" interprophet_output.pep.xml;"
34 actual_input_path_string
35 end
36
37 cmd << "rvm 1.9.3@protk-1.1.9 do interprophet.rb"
38
39 cmd << " --no-nss" unless use_nss=="blank"
40 cmd << " --no-nrs" unless use_nrs=="blank"
41 cmd << " --no-nse" unless use_nse=="blank"
42 cmd << " --no-nsi" unless use_nsi=="blank"
43 cmd << " --no-nsm" unless use_nsm=="blank"
44
45
46 input_files.each { |input|
47 cmd << " #{input}"
48 }
49
50
51 cmd << " -o interprophet_output.pep.xml -r"
52
53 cmd << ";#{output_substitution_cmds}"
54
55 %x[#{cmd}]
56