Class: Bio::UniChem::REST

Inherits:
Object
  • Object
show all
Defined in:
lib/bio-unichem/unichem.rb

Overview

UniChem REST Web service API Client.

# URI
Bio::UniChem::REST::UniChem_URI

Defined Under Namespace

Modules: UniChem_URI

Constant Summary collapse

HOST_NAME =
"www.ebi.ac.uk"
API_ROOT =
"unichem/rest"
BASE_URL =
"https://" + HOST_NAME + "/" + API_ROOT

Instance Method Summary collapse

Constructor Details

#initializeREST

Bio::UniChem::REST.new



99
100
101
102
103
104
105
# File 'lib/bio-unichem/unichem.rb', line 99

def initialize
  @header = {
    'User-Agent' => "Bio::UniChem, BioRuby/#{Bio::BIORUBY_VERSION_ID}"
  }
  @debug = false
  @status = ""
end

Instance Method Details

#inchikey(inchikey) ⇒ Object



128
129
130
# File 'lib/bio-unichem/unichem.rb', line 128

def inchikey(inchikey)
  get(Bio::UniChem::REST::UniChem_URI.inchikey(inchikey))
end

#inchikey_all(inchikey) ⇒ Object



132
133
134
# File 'lib/bio-unichem/unichem.rb', line 132

def inchikey_all(inchikey)
  get(Bio::UniChem::REST::UniChem_URI. inchikey_all(inchikey))
end

#mapping(src_id, to_src_id) ⇒ Object



124
125
126
# File 'lib/bio-unichem/unichem.rb', line 124

def mapping(src_id, to_src_id)
  get(Bio::UniChem::REST::UniChem_URI.mapping(src_id, to_src_id))
end

#sources(src_id) ⇒ Object



140
141
142
# File 'lib/bio-unichem/unichem.rb', line 140

def sources(src_id)
  get(Bio::UniChem::REST::UniChem_URI.sources(src_id))
end

#src_compound_id(src_compound_id, src_id, to_src_id = nil) ⇒ Object



116
117
118
# File 'lib/bio-unichem/unichem.rb', line 116

def src_compound_id(src_compound_id, src_id, to_src_id = nil)
  get(Bio::UniChem::REST::UniChem_URI.src_compound_id(src_compound_id, src_id, to_src_id))
end

#src_compound_id_all(src_compound_id, src_id, to_src_id = nil) ⇒ Object



120
121
122
# File 'lib/bio-unichem/unichem.rb', line 120

def src_compound_id_all(src_compound_id, src_id, to_src_id = nil)
  get(Bio::UniChem::REST::UniChem_URI.src_compound_id_all(src_compound_id, src_id, to_src_id))
end

#src_compound_id_all_obsolete(src_compound_id, src_id, to_src_id = nil) ⇒ Object



156
157
158
# File 'lib/bio-unichem/unichem.rb', line 156

def src_compound_id_all_obsolete(src_compound_id, src_id, to_src_id = nil)
  get(Bio::UniChem::REST::UniChem_URI.src_compound_id_all_obsolete(src_compound_id, src_id, to_src_id = nil))
end

#src_compound_id_url(src_compound_id, src_id, to_src_id) ⇒ Object



152
153
154
# File 'lib/bio-unichem/unichem.rb', line 152

def src_compound_id_url(src_compound_id, src_id, to_src_id)
  get(Bio::UniChem::REST::UniChem_URI.src_compound_id_url(src_compound_id, src_id, to_src_id))
end

#src_idsObject



136
137
138
# File 'lib/bio-unichem/unichem.rb', line 136

def src_ids
  get(Bio::UniChem::REST::UniChem_URI.src_ids)
end

#structure(src_compound_id, src_id) ⇒ Object



144
145
146
# File 'lib/bio-unichem/unichem.rb', line 144

def structure(src_compound_id, src_id)
  get(Bio::UniChem::REST::UniChem_URI.structure(src_compound_id, src_id))
end

#structure_all(src_compound_id, src_id) ⇒ Object



148
149
150
# File 'lib/bio-unichem/unichem.rb', line 148

def structure_all(src_compound_id, src_id)
  get(Bio::UniChem::REST::UniChem_URI.structure_all(src_compound_id, src_id))
end

#verbose_inchikey(inchikey) ⇒ Object



160
161
162
# File 'lib/bio-unichem/unichem.rb', line 160

def verbose_inchikey(inchikey)
  get(Bio::UniChem::REST::UniChem_URI.verbose_inchikey(inchikey))
end