Sha256: b5999d927691ff7a320fb474e3d2376e0d302feefb657efa9bc3e2d544967407

Contents?: true

Size: 870 Bytes

Versions: 29

Compression:

Stored size: 870 Bytes

Contents

#
# = bio/shell/plugin/obda.rb - plugin for OBDA
#
# Copyright::   Copyright (C) 2005
#               Toshiaki Katayama <k@bioruby.org>
# License::     The Ruby License 
#
# $Id: obda.rb,v 1.10 2007/04/05 23:45:11 trevor Exp $
#

module Bio::Shell

  private

  def obda
    @obda ||= Bio::Registry.new
  end

  def obdaentry(dbname, entry_id)
    db = obda.get_database(dbname)
    unless db
      warn "Error: No such database (#{dbname})"
      return
    end
    entry = db.get_by_id(entry_id)
    if block_given?
      yield entry
    else
      return entry
    end
  end

  def obdadbs
    result = obda.databases.map {|db| db.database}
    return result
  end

  def biofetch(db, id, style = 'raw', format = 'default')
    serv = Bio::Fetch.new("http://www.ebi.ac.uk/cgi-bin/dbfetch")
    result = serv.fetch(db, id, style, format)
    return result
  end

end

Version data entries

29 entries across 29 versions & 6 rubygems

Version Path
bio-shell-1.0.1 lib/bio/shell/plugin/obda.rb
bio-shell-1.0.0 lib/bio/shell/plugin/obda.rb
bio-1.5.2 lib/bio/shell/plugin/obda.rb
bio-shell-0.0.0 lib/bio/shell/plugin/obda.rb
bio-1.5.1 lib/bio/shell/plugin/obda.rb
bio-1.5.0 lib/bio/shell/plugin/obda.rb
bioruby-bio-1.2.9.9001 lib/bio/shell/plugin/obda.rb
bioruby-bio-1.2.9.9501 lib/bio/shell/plugin/obda.rb
bioruby-bio-1.3.0.5000 lib/bio/shell/plugin/obda.rb
bioruby-bio-1.3.0.9901 lib/bio/shell/plugin/obda.rb
bioruby-bio-1.3.0 lib/bio/shell/plugin/obda.rb
bioruby-bio-1.3.1.5000 lib/bio/shell/plugin/obda.rb
jandot-bio-1.2.1 lib/bio/shell/plugin/obda.rb
ngoto-bio-1.2.9.9001 lib/bio/shell/plugin/obda.rb
ngoto-bio-1.2.9.9501 lib/bio/shell/plugin/obda.rb
ngoto-bio-1.3.0.5000 lib/bio/shell/plugin/obda.rb
ngoto-bio-1.3.0 lib/bio/shell/plugin/obda.rb
ngoto-bio-1.3.1.5000 lib/bio/shell/plugin/obda.rb
wwood-bioruby-1.2.11 lib/bio/shell/plugin/obda.rb
bio-1.4.3.0001 lib/bio/shell/plugin/obda.rb