module Bio::FANTOM

Public Class Methods

get_by_id(idstr, http_proxy = nil) click to toggle source
# File lib/bio/db/fantom.rb, line 30
def get_by_id(idstr, http_proxy = nil)
  addr = 'fantom.gsc.riken.go.jp'
  port = 80
  path = "/db/maxml/maxmlseq.cgi?masterid=#{CGI.escape(idstr.to_s)}&style=xml"
  xml = ''
  if http_proxy then
    proxy = URI.parse(http_proxy.to_s)
    Net::HTTP.start(addr, port, proxy.host, proxy.port) do |http|
      response = http.get(path)
      xml = response.body
    end
  else
    Bio::Command.start_http(addr, port) do |http|
      response = http.get(path)
      xml = response.body
    end
  end
  xml
end
query(idstr, http_proxy = nil) click to toggle source
# File lib/bio/db/fantom.rb, line 23
def query(idstr, http_proxy = nil)
  xml = get_by_id(idstr, http_proxy)
  seqs = MaXML::Sequences.new(xml.to_s)
  seqs[0]
end