Class | Bio::HMMER |
In: |
lib/bio/appl/hmmer.rb
lib/bio/appl/hmmer/report.rb |
Parent: | Object |
A wapper for HMMER programs (hmmsearch or hmmpfam).
require 'bio' program = 'hmmsearch' # or 'hmmpfam' hmmfile = 'test.hmm' seqfile = 'test.faa' factory = Bio::HMMER.new(program, hmmfile, seqfile) report = factory.query report.class # => Bio::HMMER::Report
hmmfile | [RW] | Name of hmmfile. |
options | [RW] | Command line options. |
output | [R] | Shows the raw output from the hmmer search. |
program | [RW] | Prgrams name. (hmmsearch or hmmpfam). |
seqfile | [RW] | Name of seqfile. |
Sets a program name, a profile hmm file name, a query sequence file name and options in string.
Program names: hmmsearch, hmmpfam
# File lib/bio/appl/hmmer.rb, line 60 60: def initialize(program, hmmfile, seqfile, options = []) 61: @program = program 62: @hmmfile = hmmfile 63: @seqfile = seqfile 64: @output = '' 65: 66: begin 67: @options = options.to_ary 68: rescue NameError #NoMethodError 69: # backward compatibility 70: @options = Shellwords.shellwords(options) 71: end 72: end
A reader interface for multiple reports text into a report (Bio::HMMER::Report).
# Iterator Bio::HMMER.reports(reports_text) do |report| report end # Array reports = Bio::HMMER.reports(reports_text)
# File lib/bio/appl/hmmer/report.rb, line 62 62: def self.reports(multiple_report_text) 63: ary = [] 64: multiple_report_text.each_line("\n//\n") do |report| 65: if block_given? 66: yield Report.new(report) 67: else 68: ary << Report.new(report) 69: end 70: end 71: return ary 72: end
Executes the hmmer search and returns the report (Bio::HMMER::Report object).
# File lib/bio/appl/hmmer.rb, line 91 91: def query 92: cmd = [ @program, *@options ] 93: cmd.concat([ @hmmfile, @seqfile ]) 94: 95: report = nil 96: 97: @output = Bio::Command.query_command(cmd, nil) 98: report = parse_result(@output) 99: 100: return report 101: end