Module: Sylfy::Service::Biocyc::REST

Defined in:
lib/sylfy/service/biocycrest.rb

Constant Summary collapse

@@baseuri =
'http://websvc.biocyc.org/apixml?'

Class Method Summary collapse

Class Method Details

.apixml(apifn, id, detail = 'none') ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/sylfy/service/biocycrest.rb', line 21

def apixml(apifn, id, detail = 'none')
	detail = 'none' if !['none', 'low', 'full'].include?(detail)
	uri = "#{@@baseuri}fn=#{apifn}&id=#{id}&detail=#{detail}"
	begin
		doc = REXML::Document.new(URI.parse(uri).read().strip())
	rescue OpenURI::HTTPError
		raise Unisys::ServiceException, "Id #{id} not found."
	end
	
	return doc
	
end

.reaction_reactants_and_products(id, detail = 'none') ⇒ Object



34
35
36
37
# File 'lib/sylfy/service/biocycrest.rb', line 34

def reaction_reactants_and_products(id, detail = 'none')
	RESTBioCyc.apixml('enzymes-of-reaction', id, detail)
	#~ RESTBioCyc.apixml('reaction-reactants-and-products', id, detail)
end