annotate interprophet_wrapper.rb @ 3:4c2e97f928d7

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