module Bio::Blast::Remote::DDBJ

Remote BLAST factory using DDBJ Web API for Biology (xml.nig.ac.jp/).

Public Class Methods

new(program, db, options = []) click to toggle source

Creates a remote BLAST factory using DDBJ. Returns Bio::Blast object.

Note for future improvement: In the future, it might return Bio::Blast::Remote::DDBJ or other object.

# File lib/bio/appl/blast/ddbj.rb, line 23
def self.new(program, db, options = [])
  Bio::Blast.new(program, db, options, 'ddbj')
end

Public Instance Methods

exec_ddbj(query) click to toggle source

executes BLAST and returns result as a string

# File lib/bio/appl/blast/ddbj.rb, line 103
def exec_ddbj(query)
  options = make_command_line_options
  opt = Bio::Blast::NCBIOptions.new(options)

  # REST objects are cached
  @ddbj_remote_blast ||= Bio::DDBJ::REST::Blast.new
  @ddbj_request_manager ||= Bio::DDBJ::REST::RequestManager.new

  program = opt.delete('-p')
  db = opt.delete('-d')
  optstr = Bio::Command.make_command_line_unix(opt.options)

  # using searchParamAsync 
  qid = @ddbj_remote_blast.searchParamAsync(program, db, query, optstr)
  @output = qid

  result = @ddbj_request_manager.wait_getAsyncResult(qid)

  @output = result
  return @output
end