Module: EcfClassify::HMMER

Defined in:
lib/ecf_classify/runner.rb

Constant Summary collapse

DBLOCATION =
{
  :general => "data/HMM_general/all.hmm",
  :sigma3 => "data/HMM_s3/Sigma70_r3.hmm",
  :pfam => "data/Pfam_domains/sigma2and4.hmm",
  :groups => "data/HMM_groups/all_models.hmm",
  :subgroups => "data/HMM_subgroups/all_models.hmm",
}

Class Method Summary collapse

Class Method Details

.hmmscan(infile, outfile, db) ⇒ Object



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