Class: Bio::HMMER
- Defined in:
- lib/bio/appl/hmmer.rb,
lib/bio/appl/hmmer/report.rb
Overview
Description
A wapper for HMMER programs (hmmsearch or hmmpfam).
Examples
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
References
-
HMMER hmmer.wustl.edu/
Defined Under Namespace
Classes: Report
Instance Attribute Summary collapse
-
#hmmfile ⇒ Object
Name of hmmfile.
-
#options ⇒ Object
Command line options.
-
#output ⇒ Object
readonly
Shows the raw output from the hmmer search.
-
#program ⇒ Object
Prgrams name.
-
#seqfile ⇒ Object
Name of seqfile.
Class Method Summary collapse
-
.reports(multiple_report_text) ⇒ Object
A reader interface for multiple reports text into a report (Bio::HMMER::Report).
Instance Method Summary collapse
-
#initialize(program, hmmfile, seqfile, options = []) ⇒ HMMER
constructor
Sets a program name, a profile hmm file name, a query sequence file name and options in string.
-
#option ⇒ Object
Gets options by String.
-
#option=(str) ⇒ Object
Sets options by String.
-
#query ⇒ Object
Executes the hmmer search and returns the report (Bio::HMMER::Report object).
Constructor Details
#initialize(program, hmmfile, seqfile, options = []) ⇒ HMMER
Sets a program name, a profile hmm file name, a query sequence file name and options in string.
Program names: hmmsearch, hmmpfam
60 61 62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/bio/appl/hmmer.rb', line 60 def initialize(program, hmmfile, seqfile, = []) @program = program @hmmfile = hmmfile @seqfile = seqfile @output = '' begin @options = .to_ary rescue NameError #NoMethodError # backward compatibility @options = Shellwords.shellwords() end end |
Instance Attribute Details
#hmmfile ⇒ Object
Name of hmmfile.
44 45 46 |
# File 'lib/bio/appl/hmmer.rb', line 44 def hmmfile @hmmfile end |
#options ⇒ Object
Command line options.
50 51 52 |
# File 'lib/bio/appl/hmmer.rb', line 50 def @options end |
#output ⇒ Object (readonly)
Shows the raw output from the hmmer search.
53 54 55 |
# File 'lib/bio/appl/hmmer.rb', line 53 def output @output end |
#program ⇒ Object
Prgrams name. (hmmsearch or hmmpfam).
41 42 43 |
# File 'lib/bio/appl/hmmer.rb', line 41 def program @program end |
#seqfile ⇒ Object
Name of seqfile.
47 48 49 |
# File 'lib/bio/appl/hmmer.rb', line 47 def seqfile @seqfile end |
Class Method Details
.reports(multiple_report_text) ⇒ Object
62 63 64 65 66 67 68 69 70 71 72 |
# File 'lib/bio/appl/hmmer/report.rb', line 62 def self.reports(multiple_report_text) ary = [] multiple_report_text.each_line("\n//\n") do |report| if block_given? yield Report.new(report) else ary << Report.new(report) end end return ary end |
Instance Method Details
#option ⇒ Object
Gets options by String. backward compatibility.
77 78 79 |
# File 'lib/bio/appl/hmmer.rb', line 77 def option Bio::Command.make_command_line(@options) end |
#option=(str) ⇒ Object
Sets options by String. backward compatibility.
84 85 86 |
# File 'lib/bio/appl/hmmer.rb', line 84 def option=(str) @options = Shellwords.shellwords(str) end |
#query ⇒ Object
Executes the hmmer search and returns the report (Bio::HMMER::Report object).
91 92 93 94 95 96 97 98 99 100 101 |
# File 'lib/bio/appl/hmmer.rb', line 91 def query cmd = [ @program, *@options ] cmd.concat([ @hmmfile, @seqfile ]) report = nil @output = Bio::Command.query_command(cmd, nil) report = parse_result(@output) return report end |