Class Bio::Sim4
In: lib/bio/appl/sim4.rb
lib/bio/appl/sim4/report.rb
Parent: Object

The sim4 execution wrapper class.

Methods

exec   exec_local   log   new   option   query   query_pairwise  

Classes and Modules

Class Bio::Sim4::Report

Attributes

command  [R]  last command-line strings executed by the object
database  [RW]  default file name of database(‘seq2’)
options  [RW]  options
output  [R]  last result text (String)
program  [R]  name of the program (usually ‘sim4’ in UNIX)
report  [R]  last result. Returns a Bio::Sim4::Report object.

Public Class methods

Creates a new sim4 execution wrapper object.

program
Program name. Usually ‘sim4’ in UNIX.
database
Default file name of database(‘seq2’).
option
Options (array of strings).

[Source]

    # File lib/bio/appl/sim4.rb, line 32
32:     def initialize(program = 'sim4', database = nil, opt = [])
33:       @program = program
34:       @options = opt
35:       @database = database #seq2
36:       @command = nil
37:       @output = nil
38:       @report = nil
39:     end

Public Instance methods

exec(filename1, filename2 = nil)

Alias for exec_local

Executes the sim4 program. Perform mRNA-genome alignment between sequences in given files. filename1 and filename2 should be file name strings. If filename2 is not specified, using self.database.

[Source]

     # File lib/bio/appl/sim4.rb, line 109
109:     def exec_local(filename1, filename2 = nil)
110:       @command = [ @program, filename1, (filename2 or @database), *@options ]
111:       @output = nil
112:       @report = nil
113:       Bio::Command.call_command(@command) do |io|
114:         io.close_write
115:         @output = io.read
116:         @report = Bio::Sim4::Report.new(@output)
117:       end
118:       @report
119:     end

log is deprecated (no replacement) and returns empty string.

[Source]

    # File lib/bio/appl/sim4.rb, line 65
65:     def log
66:       warn "log is deprecated (no replacement) and returns empty string."
67:       ''
68:     end

option is deprecated. Instead, please use options.

[Source]

    # File lib/bio/appl/sim4.rb, line 51
51:     def option
52:       warn "option is deprecated. Please use options."
53:       options
54:     end

Executes the sim4 program. seq1 shall be a Bio::Sequence object. Returns a Bio::Sim4::Report object.

[Source]

    # File lib/bio/appl/sim4.rb, line 79
79:     def query(seq1)
80:       tf = Tempfile.open('sim4')
81:       tf.print seq1.to_fasta('seq1', 70)
82:       tf.close(false)
83:       r = exec_local(tf.path)
84:       tf.close(true)
85:       r
86:     end

Executes the sim4 program. Perform mRNA-genome alignment between given sequences. seq1 and seq2 should be Bio::Sequence objects. Returns a Bio::Sim4::Report object.

[Source]

     # File lib/bio/appl/sim4.rb, line 92
 92:     def query_pairwise(seq1, seq2)
 93:       tf = Tempfile.open('sim4')
 94:       tf.print seq1.to_fasta('seq1', 70)
 95:       tf.close(false)
 96:       tf2 = Tempfile.open('seq2')
 97:       tf2.print seq1.to_fasta('seq2', 70)
 98:       tf2.close(false)
 99:       r = exec_local(tf.path, tf2.path)
100:       tf.close(true)
101:       tf2.close(true)
102:       r
103:     end

[Validate]