comparison protein_prophet_wrapper.rb @ 0:a929e27eb203 draft

Uploaded
author iracooke
date Thu, 21 Jun 2012 22:30:48 -0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:a929e27eb203
1 require 'pathname'
2
3 $VERBOSE=nil
4
5 protein_prophet_path=%x[which protein_prophet.rb]
6
7 actual_output_path_string=ARGV.shift
8
9 # Second argument is the original input file name ... we'll change this below
10 original_input_file=ARGV[0]
11
12 # Before doing anything we append create a link to the input file in our working dir with ".pep.xml" appended to the input
13 # name because peptide prophet can't handle anything else
14
15 wd= Dir.pwd
16
17 original_input_path=Pathname.new("#{original_input_file}")
18 actual_input_path_string="#{wd}/#{original_input_path.basename}.pep.xml"
19
20 cmd = "ln -s #{original_input_file} #{actual_input_path_string};"
21
22 cmd << protein_prophet_path.chomp
23
24
25 ARGV[0]="#{actual_input_path_string}"
26
27 ARGV.each { |a|
28
29 cmd << " #{a}"
30 }
31
32 cmd << " -o protein_prophet_results.prot.xml"
33
34 cmd << ";ruby -pi -e \"gsub('#{actual_input_path_string}', '#{original_input_file}.pep.xml')\" protein_prophet_results.prot.xml"
35
36 %x[#{cmd}]
37