| Class | Bio::Fasta |
| In: |
lib/bio/appl/fasta/format10.rb
lib/bio/appl/fasta.rb |
| Parent: | Object |
| 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] |
Returns a FASTA factory object (Bio::Fasta) to run FASTA search on local computer.
# File lib/bio/appl/fasta.rb, line 81
81: def self.local(program, db, option = '')
82: self.new(program, db, option, 'local')
83: end
Returns a FASTA factory object (Bio::Fasta).
# 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
Select parser to use (‘format6’ and ‘format10’ is acceptable for now)
This method will import Bio::Fasta::Report class by requiring specified parser and will be useful when you already have fasta output files and want to use appropriate Report class for parsing.
# File lib/bio/appl/fasta.rb, line 75
75: def self.parser(parser)
76: require "bio/appl/fasta/#{parser}"
77: 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.
# File lib/bio/appl/fasta.rb, line 91
91: def self.remote(program, db, option = '', server = 'genomenet')
92: self.new(program, db, option, server)
93: end
# File lib/bio/appl/fasta.rb, line 48
48: def option
49: # backward compatibility
50: Bio::Command.make_command_line(@options)
51: end
# 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).
# File lib/bio/appl/fasta.rb, line 96
96: def query(query)
97: return self.send("exec_#{@server}", query.to_s)
98: end