class Bio::EMBOSS

Pre-requisites

You must have the EMBOSS suite installed locally. You can download from the project website (see References below).

Rereferences

Attributes

io[R]

Pipe for the command

result[R]

Result of the executed command

Public Class Methods

entret(arg) click to toggle source

Combines the initialization and execution for the emboss entret command.

puts Bio::EMBOSS.entret('embl:xlrhodop')

is equivalent to:

object = Bio::EMBOSS.new('entret embl:xlrhodop')
puts object.exec

Arguments:

  • (required) arg: argument given to the emboss entret command

Returns

String

    # File lib/bio/appl/emboss.rb
109 def self.entret(arg)
110   str = self.retrieve('entret', arg)
111 end
new(cmd_line) click to toggle source

WARNING: Bio::EMBOSS.new will be changed in the future because Bio::EMBOSS.new(cmd_line) is inconvenient and potential security hole. Using Bio::EMBOSS.run(program, options...) is strongly recommended.

Initializes a new Bio::EMBOSS object. This provides a holder that can subsequently be executed (see Bio::EMBOSS.exec). The object does not hold any actual data when initialized.

e = Bio::EMBOSS.new('seqret embl:xlrhodop')

For e to actually hold data, it has to be executed:

puts e.exec

For an overview of commands that can be used with this method, see the emboss website.


Arguments:

  • (required) command: emboss command

Returns

Bio::EMBOSS object

    # File lib/bio/appl/emboss.rb
132 def initialize(cmd_line)
133   warn 'Bio::EMBOSS.new(cmd_line) is inconvenient and potential security hole. Using Bio::EMBOSS.run(program, options...) is strongly recommended.'
134   @cmd_line = cmd_line + ' -stdout -auto'
135 end
run(program, *options) click to toggle source

Runs an emboss program and get the result as string. Note that “-auto -stdout” are automatically added to the options.

Example 1:

result = Bio::EMBOSS.run('seqret', 'embl:xlrhodop')

Example 2:

result = Bio::EMBOSS.run('water',
                          '-asequence', 'swissprot:slpi_human',
                          '-bsequence', 'swissprot:slpi_mouse')

Example 3:

options = %w( -asequence swissprot:slpi_human
              -bsequence swissprot:slpi_mouse )
result = Bio::EMBOSS.run('needle', *options)

For an overview of commands that can be used with this method, see the emboss website.


Arguments:

  • (required) program: command name, or filename of an emboss program

  • options: options given to the emboss program

Returns

String

    # File lib/bio/appl/emboss.rb
187 def self.run(program, *options)
188   cmd = [ program, *options ]
189   cmd.push '-auto'
190   cmd.push '-stdout'
191   return Bio::Command.query_command(cmd)
192 end
seqret(arg) click to toggle source

Combines the initialization and execution for the emboss seqret command.

puts Bio::EMBOSS.seqret('embl:xlrhodop')

is equivalent to:

object = Bio::EMBOSS.new('seqret embl:xlrhodop')
puts object.exec

Arguments:

  • (required) arg: argument given to the emboss seqret command

Returns

String

   # File lib/bio/appl/emboss.rb
93 def self.seqret(arg)
94   str = self.retrieve('seqret', arg)
95 end

Public Instance Methods

exec() click to toggle source

A Bio::EMBOSS object has to be executed before it can return any result.

obj_A = Bio::EMBOSS.new('transeq -sbegin 110 -send 1171 embl:xlrhodop')
puts obj_A.result                   #=> nil
obj_A.exec
puts obj_A.result                   #=> a FASTA-formatted sequence

obj_B = Bio::EMBOSS.new('showfeat embl:xlrhodop')
obj_B.exec
puts obj_B.result
    # File lib/bio/appl/emboss.rb
146 def exec
147   begin
148     @io = IO.popen(@cmd_line, "w+")
149     @result = @io.read
150     return @result
151   ensure
152     @io.close
153   end
154 end