71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
|
# File 'lib/ecf_classify/runner.rb', line 71
def self.hmmscan(infile, outfile, db)
if DBLOCATION.key? db
hmm = Utils.path(DBLOCATION[db])
if File.exists? hmm+".gz"
num = File.read(infile).scan(%r{^>}).count
subout = IO.popen("mkfifo #{hmm}; for i in {1..num}; do gunzip -c #{hmm}.gz > #{hmm}; done; rm #{hmm}")
else
subout = IO.popen("ls")
end
cmd = "hmmscan --noali --domtblout #{outfile} #{Utils.path(DBLOCATION[db])} #{infile} 2>&1"
out = `#{cmd}`
subout.close
return [out,$?.exitstatus]
else
return ["No such database",2]
end
end
|