Class: Bio::Fasta
- Defined in:
- lib/bio/appl/fasta.rb,
lib/bio/appl/fasta/format10.rb
Defined Under Namespace
Classes: Report
Instance Attribute Summary collapse
-
#db ⇒ Object
Returns the value of attribute db.
-
#format ⇒ Object
Returns the value of attribute format.
-
#ktup ⇒ Object
Returns the value of attribute ktup.
-
#matrix ⇒ Object
Returns the value of attribute matrix.
-
#options ⇒ Object
Returns the value of attribute options.
-
#output ⇒ Object
readonly
Returns a String containing fasta execution output in as is format.
-
#program ⇒ Object
Returns the value of attribute program.
-
#server ⇒ Object
Returns the value of attribute server.
Class Method Summary collapse
-
.local(program, db, option = '') ⇒ Object
Returns a FASTA factory object (Bio::Fasta) to run FASTA search on local computer.
-
.parser(parser) ⇒ Object
Select parser to use (‘format6’ and ‘format10’ is acceptable for now).
-
.remote(program, db, option = '', server = 'genomenet') ⇒ Object
Returns a FASTA factory object (Bio::Fasta) to execute FASTA search on remote server.
Instance Method Summary collapse
-
#initialize(program, db, opt = [], server = 'local') ⇒ Fasta
constructor
Returns a FASTA factory object (Bio::Fasta).
- #option ⇒ Object
- #option=(str) ⇒ Object
-
#query(query) ⇒ Object
Execute FASTA search and returns Report object (Bio::Fasta::Report).
Constructor Details
#initialize(program, db, opt = [], server = 'local') ⇒ Fasta
Returns a FASTA factory object (Bio::Fasta).
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/bio/appl/fasta.rb', line 23 def initialize(program, db, opt = [], server = 'local') @format = 10 @program = program @db = db @server = server @ktup = nil @matrix = nil @output = '' begin a = opt.to_ary rescue NameError #NoMethodError # backward compatibility a = Shellwords.shellwords(opt) end = [ '-Q', '-H', '-m', @format.to_s, *a ] # need -a ? end |
Instance Attribute Details
#db ⇒ Object
Returns the value of attribute db.
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def db @db end |
#format ⇒ Object
Returns the value of attribute format.
67 68 69 |
# File 'lib/bio/appl/fasta.rb', line 67 def format @format end |
#ktup ⇒ Object
Returns the value of attribute ktup.
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def ktup @ktup end |
#matrix ⇒ Object
Returns the value of attribute matrix.
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def matrix @matrix end |
#options ⇒ Object
Returns the value of attribute options.
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def end |
#output ⇒ Object (readonly)
Returns a String containing fasta execution output in as is format.
46 47 48 |
# File 'lib/bio/appl/fasta.rb', line 46 def output @output end |
#program ⇒ Object
Returns the value of attribute program.
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def program @program end |
#server ⇒ Object
Returns the value of attribute server.
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def server @server end |
Class Method Details
.local(program, db, option = '') ⇒ Object
Returns a FASTA factory object (Bio::Fasta) to run FASTA search on local computer.
81 82 83 |
# File 'lib/bio/appl/fasta.rb', line 81 def self.local(program, db, option = '') self.new(program, db, option, 'local') end |
.parser(parser) ⇒ Object
Select parser to use (‘format6’ and ‘format10’ is acceptable for now)
This method will import Bio::Fasta::Report class by requiring specified parser and will be useful when you already have fasta output files and want to use appropriate Report class for parsing.
75 76 77 |
# File 'lib/bio/appl/fasta.rb', line 75 def self.parser(parser) require "bio/appl/fasta/#{parser}" end |
.remote(program, db, option = '', server = 'genomenet') ⇒ Object
Returns a FASTA factory object (Bio::Fasta) to execute FASTA search on remote server.
For the develpper, you can add server ‘hoge’ by adding exec_hoge(query) method.
91 92 93 |
# File 'lib/bio/appl/fasta.rb', line 91 def self.remote(program, db, option = '', server = 'genomenet') self.new(program, db, option, server) end |
Instance Method Details
#option ⇒ Object
48 49 50 51 |
# File 'lib/bio/appl/fasta.rb', line 48 def option # backward compatibility Bio::Command.make_command_line() end |
#option=(str) ⇒ Object
53 54 55 56 |
# File 'lib/bio/appl/fasta.rb', line 53 def option=(str) # backward compatibility = Shellwords.shellwords(str) end |
#query(query) ⇒ Object
Execute FASTA search and returns Report object (Bio::Fasta::Report).
96 97 98 |
# File 'lib/bio/appl/fasta.rb', line 96 def query(query) return self.send("exec_#{@server}", query.to_s) end |