[BioRuby-cvs] bioruby/lib/bio/appl emboss.rb,1.2,1.3
Katayama Toshiaki
k at pub.open-bio.org
Sat Jan 28 06:46:44 UTC 2006
Update of /home/repository/bioruby/bioruby/lib/bio/appl
In directory pub.open-bio.org:/tmp/cvs-serv4775/lib/bio/appl
Modified Files:
emboss.rb
Log Message:
* entret/seqret commands in EMBOSS are supported
* Bio::EMBOSS.seqret(usa), Bio::EMBOSS.entret(usa)
* bioruby> seqret(usa), entret(usa)
* obj() method is added in addition to seq() and ent() methods.
Index: emboss.rb
===================================================================
RCS file: /home/repository/bioruby/bioruby/lib/bio/appl/emboss.rb,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** emboss.rb 8 Sep 2005 01:22:08 -0000 1.2
--- emboss.rb 28 Jan 2006 06:46:42 -0000 1.3
***************
*** 1,6 ****
#
! # bio/appl/emboss.rb - EMBOSS wrapper
#
! # Copyright (C) 2002 KATAYAMA Toshiaki <k at bioruby.org>
#
# This library is free software; you can redistribute it and/or
--- 1,16 ----
#
! # = bio/appl/emboss.rb - EMBOSS wrapper
#
! # Copyright:: Copyright (C) 2002, 2005
! # KATAYAMA Toshiaki <k at bioruby.org>
! # License:: LGPL
! #
! # $Id$
! #
! # == References
! #
! # * http://www.emboss.org
! #
! #--
#
# This library is free software; you can redistribute it and/or
***************
*** 18,68 ****
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
! # $Id$
#
module Bio
! class EMBOSS
! def initialize(cmd_line)
! @cmd_line = cmd_line + ' -stdout'
! end
! def exec
! begin
! @io = IO.popen(@cmd_line, "w+")
! @result = @io.read
! return @result
! ensure
! @io.close
! end
! end
! attr_reader :io, :result
end
! end
!
! =begin
!
! = Bio::EMBOSS
!
! EMBOSS wrapper.
! #!/usr/bin/env ruby
! require 'bio'
! emboss = Bio::EMBOSS.new("getorf -sequence ~/xlrhodop -outseq stdout")
! puts emboss.exec
! --- Bio::EMBOSS.new(command_line)
! --- Bio::EMBOSS#exec
! --- Bio::EMBOSS#io
! --- Bio::EMBOSS#result
! === SEE ALSO
! * http://www.emboss.org
- =end
--- 28,79 ----
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
#
! #++
#
module Bio
! autoload :Command, 'bio/command'
! class EMBOSS
! extend Bio::Command::Tools
+ def self.seqret(arg)
+ str = self.retrieve('seqret', arg)
end
! def self.entret(arg)
! str = self.retrieve('entret', arg)
! end
! def initialize(cmd_line)
! @cmd_line = cmd_line + ' -stdout -auto'
! end
! def exec
! begin
! @io = IO.popen(@cmd_line, "w+")
! @result = @io.read
! return @result
! ensure
! @io.close
! end
! end
! attr_reader :io, :result
! private
! def self.retrieve(cmd, arg)
! cmd = [ cmd, arg, '-auto', '-stdout' ]
! str = ''
! call_command_local(cmd) do |inn, out|
! inn.close_write
! str = out.read
! end
! return str
! end
! end # EMBOSS
! end # Bio
More information about the bioruby-cvs
mailing list