Class: Bio::Fasta
- Inherits:
-
Object
- Object
- Bio::Fasta
- Defined in:
- lib/bio/appl/fasta.rb,
lib/bio/appl/fasta/format10.rb
Defined Under Namespace
Classes: Report
Instance Attribute Summary (collapse)
-
- (Object) db
Returns the value of attribute db.
-
- (Object) format
Returns the value of attribute format.
-
- (Object) ktup
Returns the value of attribute ktup.
-
- (Object) matrix
Returns the value of attribute matrix.
-
- (Object) options
Returns the value of attribute options.
-
- (Object) output
readonly
Returns a String containing fasta execution output in as is format.
-
- (Object) program
Returns the value of attribute program.
-
- (Object) server
Returns the value of attribute server.
Class Method Summary (collapse)
-
+ (Object) local(program, db, option = '')
Returns a FASTA factory object (Bio::Fasta) to run FASTA search on local computer.
-
+ (Object) parser(parser)
OBSOLETE.
-
+ (Object) remote(program, db, option = '', server = 'genomenet')
Returns a FASTA factory object (Bio::Fasta) to execute FASTA search on remote server.
Instance Method Summary (collapse)
-
- (Fasta) initialize(program, db, opt = [], server = 'local')
constructor
Returns a FASTA factory object (Bio::Fasta).
- - (Object) option
- - (Object) option=(str)
-
- (Object) query(query)
Execute FASTA search and returns Report object (Bio::Fasta::Report).
Constructor Details
- (Fasta) initialize(program, db, opt = [], server = 'local')
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
- (Object) db
Returns the value of attribute db
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def db @db end |
- (Object) format
Returns the value of attribute format
67 68 69 |
# File 'lib/bio/appl/fasta.rb', line 67 def format @format end |
- (Object) ktup
Returns the value of attribute ktup
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def ktup @ktup end |
- (Object) matrix
Returns the value of attribute matrix
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def matrix @matrix end |
- (Object) options
Returns the value of attribute options
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def @options end |
- (Object) output (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 |
- (Object) program
Returns the value of attribute program
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def program @program end |
- (Object) server
Returns the value of attribute server
43 44 45 |
# File 'lib/bio/appl/fasta.rb', line 43 def server @server end |
Class Method Details
+ (Object) local(program, db, option = '')
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 |
+ (Object) parser(parser)
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 |
+ (Object) remote(program, db, option = '', server = 'genomenet')
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
- (Object) option
48 49 50 51 |
# File 'lib/bio/appl/fasta.rb', line 48 def option # backward compatibility Bio::Command.make_command_line(@options) end |
- (Object) option=(str)
53 54 55 56 |
# File 'lib/bio/appl/fasta.rb', line 53 def option=(str) # backward compatibility @options = Shellwords.shellwords(str) end |
- (Object) query(query)
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 |