class Bio::Fasta

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

local(program, db, option = '') click to toggle source

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

   # File lib/bio/appl/fasta.rb
80 def self.local(program, db, option = '')
81   self.new(program, db, option, 'local')
82 end
new(program, db, opt = [], server = 'local') click to toggle source

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

   # File lib/bio/appl/fasta.rb
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
parser(parser) click to toggle source

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

   # File lib/bio/appl/fasta.rb
74 def self.parser(parser)
75   warn 'Bio::Fasta.parser is obsoleted and will soon be removed.'
76 end
remote(program, db, option = '', server = 'genomenet') click to toggle source

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.

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

Public Instance Methods

format=(num) click to toggle source

Accessors for the -m option.

   # File lib/bio/appl/fasta.rb
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
option() click to toggle source
   # File lib/bio/appl/fasta.rb
48 def option
49   # backward compatibility
50   Bio::Command.make_command_line(@options)
51 end
option=(str) click to toggle source
   # File lib/bio/appl/fasta.rb
53 def option=(str)
54   # backward compatibility
55   @options = Shellwords.shellwords(str)
56 end
query(query) click to toggle source

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

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