annotate protein_prophet_wrapper.rb @ 2:418f42b34049 draft

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