diff protein_prophet_wrapper.rb @ 2:25261529840c

Uploaded
author iracooke
date Mon, 04 Mar 2013 17:11:46 -0500
parents
children 3f0cb90824f1
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/protein_prophet_wrapper.rb	Mon Mar 04 17:11:46 2013 -0500
@@ -0,0 +1,35 @@
+require 'pathname'
+
+$VERBOSE=nil
+
+actual_output_path_string=ARGV.shift
+
+# Second argument is the original input file name ... we'll change this below
+original_input_file=ARGV[0]
+
+# Before doing anything we append create a link to the input file in our working dir with ".pep.xml" appended to the input 
+# name because peptide prophet can't handle anything else
+
+wd= Dir.pwd
+
+original_input_path=Pathname.new("#{original_input_file}")
+actual_input_path_string="#{wd}/#{original_input_path.basename}.pep.xml"
+
+cmd = "ln -s #{original_input_file} #{actual_input_path_string};"
+
+cmd << "rvm 1.9.3@protk-1.1.9 do protein_prophet.rb"
+
+
+ARGV[0]="#{actual_input_path_string}"
+
+ARGV.each { |a| 
+    
+  cmd << " #{a}" 
+}
+
+cmd << " -o protein_prophet_results.prot.xml"
+
+cmd << ";ruby -pi -e \"gsub('#{actual_input_path_string}', '#{original_input_file}.pep.xml')\" protein_prophet_results.prot.xml"
+
+%x[#{cmd}]
+