protk 1.1.16 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/msgfplus_search.rb +21 -2
- metadata +1 -1
data/bin/msgfplus_search.rb
CHANGED
@@ -12,7 +12,7 @@ require 'protk/search_tool'
|
|
12
12
|
require 'protk/galaxy_stager'
|
13
13
|
require 'protk/galaxy_util'
|
14
14
|
|
15
|
-
for_galaxy = GalaxyUtil.for_galaxy
|
15
|
+
for_galaxy = GalaxyUtil.for_galaxy?
|
16
16
|
input_stager = nil
|
17
17
|
|
18
18
|
# Setup specific command-line options for this tool. Other options are inherited from SearchTool
|
@@ -76,9 +76,22 @@ genv=Constants.new
|
|
76
76
|
#
|
77
77
|
msgf_bin="#{genv.msgfplusjar}"
|
78
78
|
|
79
|
+
make_msgfdb_cmd=""
|
80
|
+
|
79
81
|
case
|
80
82
|
when Pathname.new(search_tool.database).exist? # It's an explicitly named db
|
81
83
|
current_db=Pathname.new(search_tool.database).realpath.to_s
|
84
|
+
|
85
|
+
# Must have fasta extension
|
86
|
+
if ( Pathname.new(current_db).extname.to_s.downcase != ".fasta" )
|
87
|
+
make_msgfdb_cmd << "ln -s #{current_db} #{current_db}.fasta;"
|
88
|
+
current_db="#{current_db}.fasta"
|
89
|
+
end
|
90
|
+
|
91
|
+
if(not FileTest.exists?("#{current_db}.canno"))
|
92
|
+
dbdir = Pathname.new(current_db).dirname.realpath.to_s
|
93
|
+
make_msgfdb_cmd << "cd #{dbdir}; java -Xmx3500M -cp #{genv.msgfplusjar} edu.ucsd.msjava.msdbsearch.BuildSA -d #{current_db} -tda 0; "
|
94
|
+
end
|
82
95
|
else
|
83
96
|
current_db=search_tool.current_database :fasta
|
84
97
|
end
|
@@ -123,7 +136,7 @@ ARGV.each do |filename|
|
|
123
136
|
|
124
137
|
# The basic command
|
125
138
|
#
|
126
|
-
cmd= "java -Xmx#{search_tool.java_mem} -jar #{msgf_bin} -d #{current_db} -s #{input_path} -o #{mzid_output_path} "
|
139
|
+
cmd= "#{make_msgfdb_cmd} java -Xmx#{search_tool.java_mem} -jar #{msgf_bin} -d #{current_db} -s #{input_path} -o #{mzid_output_path} "
|
127
140
|
#Missed cleavages
|
128
141
|
#
|
129
142
|
throw "Maximum value for missed cleavages is 2" if ( search_tool.missed_cleavages.to_i > 2)
|
@@ -188,10 +201,16 @@ ARGV.each do |filename|
|
|
188
201
|
job_params= {:jobid => search_tool.jobid_from_filename(filename) }
|
189
202
|
search_tool.run(cmd,genv,job_params)
|
190
203
|
|
204
|
+
if for_galaxy
|
191
205
|
input_stager.restore_references(output_path)
|
206
|
+
end
|
192
207
|
|
193
208
|
else
|
194
209
|
genv.log("Skipping search on existing file #{output_path}",:warn)
|
195
210
|
end
|
196
211
|
|
212
|
+
# Reset this. We only want to index the database at most once
|
213
|
+
#
|
214
|
+
make_msgfdb_cmd=""
|
215
|
+
|
197
216
|
end
|