crb-blast 0.4.0 → 0.4.1
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.
- checksums.yaml +4 -4
- data/crb-blast.gemspec +1 -1
- data/lib/crb-blast/crb-blast.rb +60 -56
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e3caa1fa30a20503163a10776ba9800a13068e37
|
4
|
+
data.tar.gz: 5e175e4cb4289a357b2abf22df61453c495c739b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e9a7283bd2359176e1f8d07a129e97473afeeccc877c99dc139ca8278a76a5504b8ddac7a399cca0b7ec5238a6e59325064380f9e23b764f8a1edf60fdcda2cf
|
7
|
+
data.tar.gz: a645840bcc5d34930022404c3e7452941d3d3fa401ce1d3747434253cabc210b2dab481bbf679b93aebed7ebf735a5bb0aaf6938d407506598cb48161b1827bd
|
data/crb-blast.gemspec
CHANGED
data/lib/crb-blast/crb-blast.rb
CHANGED
@@ -217,68 +217,72 @@ module CRB_Blast
|
|
217
217
|
# @param [String] bin2
|
218
218
|
def run_blast_with_splitting evalue, threads, bin1, bin2
|
219
219
|
# puts "running blast by splitting input into #{threads} pieces"
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
220
|
+
if !File.exist?(@output1)
|
221
|
+
blasts=[]
|
222
|
+
files = split_input(@query, threads)
|
223
|
+
files.threach(threads) do |thread|
|
224
|
+
cmd1 = "#{bin1} -query #{thread} -db #{@working_dir}/#{@target_name} "
|
225
|
+
cmd1 << " -out #{thread}.blast -evalue #{evalue} "
|
226
|
+
cmd1 << " -outfmt \"6 std qlen slen\" "
|
227
|
+
cmd1 << " -max_target_seqs 50 "
|
228
|
+
cmd1 << " -num_threads 1"
|
229
|
+
if !File.exists?("#{thread}.blast")
|
230
|
+
blast1 = Cmd.new(cmd1)
|
231
|
+
blast1.run
|
232
|
+
if !blast1.status.success?
|
233
|
+
raise RuntimeError.new("BLAST Error:\n#{blast1.stderr}")
|
234
|
+
end
|
233
235
|
end
|
236
|
+
blasts << "#{thread}.blast"
|
237
|
+
end
|
238
|
+
cat_cmd = "cat "
|
239
|
+
cat_cmd << blasts.join(" ")
|
240
|
+
cat_cmd << " > #{@output1}"
|
241
|
+
catting = Cmd.new(cat_cmd)
|
242
|
+
catting.run
|
243
|
+
if !catting.status.success?
|
244
|
+
raise RuntimeError.new("Problem catting files:\n#{catting.stderr}")
|
245
|
+
end
|
246
|
+
files.each do |file|
|
247
|
+
File.delete(file) if File.exist?(file)
|
248
|
+
end
|
249
|
+
blasts.each do |b|
|
250
|
+
File.delete(b) # delete intermediate blast output files
|
234
251
|
end
|
235
|
-
blasts << "#{thread}.blast"
|
236
|
-
end
|
237
|
-
cat_cmd = "cat "
|
238
|
-
cat_cmd << blasts.join(" ")
|
239
|
-
cat_cmd << " > #{@output1}"
|
240
|
-
catting = Cmd.new(cat_cmd)
|
241
|
-
catting.run
|
242
|
-
if !catting.status.success?
|
243
|
-
raise RuntimeError.new("Problem catting files:\n#{catting.stderr}")
|
244
|
-
end
|
245
|
-
files.each do |file|
|
246
|
-
File.delete(file) if File.exist?(file)
|
247
|
-
end
|
248
|
-
blasts.each do |b|
|
249
|
-
File.delete(b) # delete intermediate blast output files
|
250
252
|
end
|
251
253
|
|
252
|
-
|
253
|
-
|
254
|
-
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
254
|
+
if !File.exist?(@output2)
|
255
|
+
blasts=[]
|
256
|
+
files = split_input(@target, threads)
|
257
|
+
files.threach(threads) do |thread|
|
258
|
+
cmd2 = "#{bin2} -query #{thread} -db #{@working_dir}/#{@query_name} "
|
259
|
+
cmd2 << " -out #{thread}.blast -evalue #{evalue} "
|
260
|
+
cmd2 << " -outfmt \"6 std qlen slen\" "
|
261
|
+
cmd2 << " -max_target_seqs 50 "
|
262
|
+
cmd2 << " -num_threads 1"
|
263
|
+
if !File.exists?("#{thread}.blast")
|
264
|
+
blast2 = Cmd.new(cmd2)
|
265
|
+
blast2.run
|
266
|
+
if !blast2.status.success?
|
267
|
+
raise RuntimeError.new("BLAST Error:\n#{blast2.stderr}")
|
268
|
+
end
|
265
269
|
end
|
270
|
+
blasts << "#{thread}.blast"
|
271
|
+
end
|
272
|
+
cat_cmd = "cat "
|
273
|
+
cat_cmd << blasts.join(" ")
|
274
|
+
cat_cmd << " > #{@output2}"
|
275
|
+
catting = Cmd.new(cat_cmd)
|
276
|
+
catting.run
|
277
|
+
if !catting.status.success?
|
278
|
+
raise RuntimeError.new("Problem catting files:\n#{catting.stderr}")
|
279
|
+
end
|
280
|
+
files.each do |file|
|
281
|
+
File.delete(file) if File.exist?(file)
|
282
|
+
end
|
283
|
+
blasts.each do |b|
|
284
|
+
File.delete(b) # delete intermediate blast output files
|
266
285
|
end
|
267
|
-
blasts << "#{thread}.blast"
|
268
|
-
end
|
269
|
-
cat_cmd = "cat "
|
270
|
-
cat_cmd << blasts.join(" ")
|
271
|
-
cat_cmd << " > #{@output2}"
|
272
|
-
catting = Cmd.new(cat_cmd)
|
273
|
-
catting.run
|
274
|
-
if !catting.status.success?
|
275
|
-
raise RuntimeError.new("Problem catting files:\n#{catting.stderr}")
|
276
|
-
end
|
277
|
-
files.each do |file|
|
278
|
-
File.delete(file) if File.exist?(file)
|
279
|
-
end
|
280
|
-
blasts.each do |b|
|
281
|
-
File.delete(b) # delete intermediate blast output files
|
282
286
|
end
|
283
287
|
|
284
288
|
end
|