Class Bio::Fasta
In: lib/bio/appl/fasta.rb
lib/bio/appl/fasta/format10.rb
Parent: Object

Methods

format=   local   new   option   option=   parser   query   remote  

Classes and Modules

Class Bio::Fasta::Report

Attributes

db  [RW] 
format  [R] 
ktup  [RW] 
matrix  [RW] 
options  [RW] 
output  [R]  Returns a String containing fasta execution output in as is format.
program  [RW] 
server  [RW] 

Public Class methods

Returns a FASTA factory object (Bio::Fasta) to run FASTA search on local computer.

[Source]

    # File lib/bio/appl/fasta.rb, line 80
80:   def self.local(program, db, option = '')
81:     self.new(program, db, option, 'local')
82:   end

Returns a FASTA factory object (Bio::Fasta).

[Source]

    # File lib/bio/appl/fasta.rb, line 23
23:   def initialize(program, db, opt = [], server = 'local')
24:     @format     = 10
25: 
26:     @program    = program
27:     @db = db
28:     @server     = server
29: 
30:     @ktup       = nil
31:     @matrix     = nil
32: 
33:     @output     = ''
34: 
35:     begin
36:       a = opt.to_ary
37:     rescue NameError #NoMethodError
38:       # backward compatibility
39:       a = Shellwords.shellwords(opt)
40:     end
41:     @options    = [ '-Q', '-H', '-m', @format.to_s, *a ] # need -a ?
42:   end

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).

[Source]

    # File lib/bio/appl/fasta.rb, line 74
74:   def self.parser(parser)
75:     warn 'Bio::Fasta.parser is obsoleted and will soon be removed.'
76:   end

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.

[Source]

    # File lib/bio/appl/fasta.rb, line 90
90:   def self.remote(program, db, option = '', server = 'genomenet')
91:     self.new(program, db, option, server)
92:   end

Public Instance methods

Accessors for the -m option.

[Source]

    # File lib/bio/appl/fasta.rb, line 59
59:   def format=(num)
60:     @format = num.to_i
61:     if i = @options.index('-m') then
62:       @options[i+1, 1] = @format.to_s
63:     else
64:       @options << '-m' << @format.to_s
65:     end
66:   end

[Source]

    # File lib/bio/appl/fasta.rb, line 48
48:   def option
49:     # backward compatibility
50:     Bio::Command.make_command_line(@options)
51:   end

[Source]

    # File lib/bio/appl/fasta.rb, line 53
53:   def option=(str)
54:     # backward compatibility
55:     @options = Shellwords.shellwords(str)
56:   end

Execute FASTA search and returns Report object (Bio::Fasta::Report).

[Source]

    # File lib/bio/appl/fasta.rb, line 95
95:   def query(query)
96:     return self.send("exec_#{@server}", query.to_s)
97:   end

[Validate]