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
OBSOLETE.
-
.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 @options = [ '-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 @options 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.
80 81 82 |
# File 'lib/bio/appl/fasta.rb', line 80 def self.local(program, db, option = '') self.new(program, db, option, 'local') end |
.parser(parser) ⇒ Object
OBSOLETE. Does nothing and shows warning messages.
Historically, selecting parser to use (‘format6’ or ‘format10’ were expected, but only ‘format10’ was available as a working parser).
74 75 76 |
# File 'lib/bio/appl/fasta.rb', line 74 def self.parser(parser) warn 'Bio::Fasta.parser is obsoleted and will soon be removed.' 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.
90 91 92 |
# File 'lib/bio/appl/fasta.rb', line 90 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(@options) end |
#option=(str) ⇒ Object
53 54 55 56 |
# File 'lib/bio/appl/fasta.rb', line 53 def option=(str) # backward compatibility @options = Shellwords.shellwords(str) end |
#query(query) ⇒ Object
Execute FASTA search and returns Report object (Bio::Fasta::Report).
95 96 97 |
# File 'lib/bio/appl/fasta.rb', line 95 def query(query) return self.send("exec_#{@server}", query.to_s) end |