Class | Bio::Alignment::FactoryTemplate::Simple
In: | lib/bio/alignment.rb
Parent: | Object

Template class for alignment application factory. The program acts: input: stdin or file, format = fasta format output: stdout (parser should be specified by DEFAULT_PARSER)

### Methods

new query query_align query_alignment query_by_filename query_string reset

### Attributes

command | [R] | Last command-line string. Returns nil or an array of String. Note that filenames described in the command-line may already be removed because these files may be temporary files.
data_stdout | [RW] | Last output to the stdout.
exit_status | [R] | Last exit status
options | [RW] | options
output | [R] | Last raw result of the program. Return a string (or nil).
program | [RW] | program name
report | [R] | Last result object performed by the factory.

### Public Class methods

new(program = self.class::DEFAULT_PROGRAM, options = [])

Creates a new alignment factory

[Source]

          # File lib/bio/alignment.rb, line 2221
    2221:         def initialize(program = self.class::DEFAULT_PROGRAM, options = [])
    2222:           @program = program
    2223:           @options = options
    2224:           @command = nil
    2225:           @output = nil
    2226:           @report = nil
    2227:           @exit_status = nil
    2228:           @data_stdout = nil
    2229:         end

### Public Instance methods

query(seqs)

Executes the program. If `seqs` is not nil, perform alignment for seqs. If `seqs` is nil, simply executes the program.

Compatibility note: When seqs is nil, returns true if the program exits normally, and returns false if the program exits abnormally.

[Source]

          # File lib/bio/alignment.rb, line 2271
    2271:         def query(seqs)
    2272:           if seqs then
    2273:             query_alignment(seqs)
    2274:           else
    2275:             exec_local(@options)
    2276:             @exit_status.exitstatus == 0 ? true : false
    2277:           end
    2278:         end

query_align(seqs)

alias of query_alignment.

Compatibility Note: query_align will renamed to query_alignment.

[Source]

          # File lib/bio/alignment.rb, line 2292
    2292:         def query_align(seqs)
    2293:           #warn 'query_align is renamed to query_alignment.'
    2294:           query_alignment(seqs)
    2295:         end

query_alignment(seqs)

Performs alignment for seqs. `seqs` should be Bio::Alignment or Array of sequences or nil.

[Source]

          # File lib/bio/alignment.rb, line 2282
    2282:         def query_alignment(seqs)
    2283:           unless seqs.respond_to?(:output_fasta) then
    2284:             seqs = Bio::Alignment.new(seqs)
    2285:           end
    2286:           query_string(seqs.output_fasta(:width => 70))
    2287:         end

query_by_filename(filename_in)

Performs alignment of sequences in the file named `fn`.

[Source]

          # File lib/bio/alignment.rb, line 2305
    2305:         def query_by_filename(filename_in)
    2306:           _query_local(filename_in, @options)
    2307:           @report
    2308:         end

query_string(str)

Performs alignment for `str`. The `str` should be a string that can be recognized by the program.

[Source]

          # File lib/bio/alignment.rb, line 2299
    2299:         def query_string(str)
    2300:           _query_string(str, @options)
    2301:           @report
    2302:         end

reset()

Clear the internal data and status, except program and options.

[Source]

          # File lib/bio/alignment.rb, line 2256
    2256:         def reset
    2257:           @command = nil
    2258:           @output = nil
    2259:           @report = nil
    2260:           @exit_status = nil
    2261:           @data_stdout = nil
    2262:         end

[Validate]