1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
|
From: Michael R. Crusoe <michael.crusoe@gmail.com>
Subject: Use non-deprecated form of File.exists
--- a/lib/crb-blast/crb-blast.rb
+++ b/lib/crb-blast/crb-blast.rb
@@ -110,7 +110,7 @@
make_query_db_cmd << " -out #{@working_dir}/#{query_name}"
db_query = "#{query_name}.nsq" if !@query_is_prot
db_query = "#{query_name}.psq" if @query_is_prot
- if !File.exists?("#{@working_dir}/#{db_query}")
+ if !File.exist?("#{@working_dir}/#{db_query}")
make_db = Cmd.new(make_query_db_cmd)
make_db.run
if !make_db.status.success?
@@ -129,7 +129,7 @@
db_target = "#{target_name}.nsq" if !@target_is_prot
db_target = "#{target_name}.psq" if @target_is_prot
- if !File.exists?("#{@working_dir}/#{db_target}")
+ if !File.exist?("#{@working_dir}/#{db_target}")
make_db = Cmd.new(make_target_db_cmd)
make_db.run
if !make_db.status.success?
@@ -249,7 +249,7 @@
cmd1 << " -soft_masking false "
cmd1 << " -max_target_seqs 50 "
cmd1 << " -num_threads 1"
- if !File.exists?("#{thread}.blast")
+ if !File.exist?("#{thread}.blast")
blast1 = Cmd.new(cmd1)
blast1.run
if !blast1.status.success?
@@ -284,7 +284,7 @@
cmd2 << " -outfmt \"6 std qlen slen\" "
cmd2 << " -max_target_seqs 50 "
cmd2 << " -num_threads 1"
- if !File.exists?("#{thread}.blast")
+ if !File.exist?("#{thread}.blast")
blast2 = Cmd.new(cmd2)
blast2.run
if !blast2.status.success?
@@ -367,13 +367,13 @@
@target_results = Hash.new
q_count=0
t_count=0
- if !File.exists?("#{@output1}")
+ if !File.exist?("#{@output1}")
raise RuntimeError.new("can't find #{@output1}")
end
- if !File.exists?("#{@output2}")
+ if !File.exist?("#{@output2}")
raise RuntimeError.new("can't find #{@output2}")
end
- if File.exists?("#{@output1}") and File.exists?("#{@output2}")
+ if File.exist?("#{@output1}") and File.exist?("#{@output2}")
File.open("#{@output1}").each_line do |line|
cols = line.chomp.split("\t")
hit = Hit.new(cols, @query_is_prot, @target_is_prot)
|