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, line 80
def self.local(program, db, option = '')
  self.new(program, db, option, 'local')
end
new(program, db, opt = [], server = 'local') click to toggle source

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

# 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
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, line 74
def self.parser(parser)
  warn 'Bio::Fasta.parser is obsoleted and will soon be removed.'
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, line 90
def self.remote(program, db, option = '', server = 'genomenet')
  self.new(program, db, option, server)
end

Public Instance Methods

format=(num) click to toggle source

Accessors for the -m option.

# File lib/bio/appl/fasta.rb, line 59
def format=(num)
  @format = num.to_i
  if i = @options.index('-m') then
    @options[i+1, 1] = @format.to_s
  else
    @options << '-m' << @format.to_s
  end
end
option() click to toggle source
# File lib/bio/appl/fasta.rb, line 48
def option
  # backward compatibility
  Bio::Command.make_command_line(@options)
end
option=(str) click to toggle source
# File lib/bio/appl/fasta.rb, line 53
def option=(str)
  # backward compatibility
  @options = Shellwords.shellwords(str)
end
query(query) click to toggle source

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

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