crb-blast 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8ae488cec70a923add9cbe9e6f4a4fe0d69471d8
4
- data.tar.gz: 7628e84ef78228bcc268d7deb6eb2a667131d405
3
+ metadata.gz: e3caa1fa30a20503163a10776ba9800a13068e37
4
+ data.tar.gz: 5e175e4cb4289a357b2abf22df61453c495c739b
5
5
  SHA512:
6
- metadata.gz: f52df39062d0adf04187fca27635a4822fd2cdfb41944518773985bc08504243c02bd63564fa44656cf910909c9d3d1004c56a6f251d9918d07d2ef88f38eb2f
7
- data.tar.gz: 1e46630e56d52f9056ab92a27eb33171aee066885b418855f9c9b61afccba31b5f34f2de2b53a0592d564e710cef3cf7f1f46a6eb148e57ffbb76b1025f24110
6
+ metadata.gz: e9a7283bd2359176e1f8d07a129e97473afeeccc877c99dc139ca8278a76a5504b8ddac7a399cca0b7ec5238a6e59325064380f9e23b764f8a1edf60fdcda2cf
7
+ data.tar.gz: a645840bcc5d34930022404c3e7452941d3d3fa401ce1d3747434253cabc210b2dab481bbf679b93aebed7ebf735a5bb0aaf6938d407506598cb48161b1827bd
data/crb-blast.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |gem|
2
2
  gem.name = 'crb-blast'
3
- gem.version = '0.4.0'
3
+ gem.version = '0.4.1'
4
4
  gem.date = '2014-07-23'
5
5
  gem.summary = "Run conditional reciprocal best blast"
6
6
  gem.description = "See summary"
@@ -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
- blasts=[]
221
- files = split_input(@query, threads)
222
- files.threach(threads) do |thread|
223
- cmd1 = "#{bin1} -query #{thread} -db #{@working_dir}/#{@target_name} "
224
- cmd1 << " -out #{thread}.blast -evalue #{evalue} "
225
- cmd1 << " -outfmt \"6 std qlen slen\" "
226
- cmd1 << " -max_target_seqs 50 "
227
- cmd1 << " -num_threads 1"
228
- if !File.exists?("#{thread}.blast")
229
- blast1 = Cmd.new(cmd1)
230
- blast1.run
231
- if !blast1.status.success?
232
- raise RuntimeError.new("BLAST Error:\n#{blast1.stderr}")
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
- blasts=[]
253
- files = split_input(@target, threads)
254
- files.threach(threads) do |thread|
255
- cmd2 = "#{bin2} -query #{thread} -db #{@working_dir}/#{@query_name} "
256
- cmd2 << " -out #{thread}.blast -evalue #{evalue} "
257
- cmd2 << " -outfmt \"6 std qlen slen\" "
258
- cmd2 << " -max_target_seqs 50 "
259
- cmd2 << " -num_threads 1"
260
- if !File.exists?("#{thread}.blast")
261
- blast2 = Cmd.new(cmd2)
262
- blast2.run
263
- if !blast2.status.success?
264
- raise RuntimeError.new("BLAST Error:\n#{blast2.stderr}")
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
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crb-blast
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Boursnell