search_biomodel

search biomodel is a small ruby gem ready to be used for running queries through the biomodel web service API.

There are (currently) 5 methods implemented here to communicate with the biomodels website (found at www.ebi.ac.uk/biomodels-main/).

These methods are “search_by_chebiid”, “search_by_name”, “get_all_models”, “search_by_person” and “get_model_name_by_id”.

Installation

gem install seach_biomodel

Usage

The first four methods return an array of model IDs (or an empty array if nothing is found) and the 5th returns the name of the model of an ID you search for. The ChEBIID can take quite some time to run on the biomodel servers side.

The “get_all_models” method returns a hash map of :key’s and :value’s which can be retrieved as such:

require 'rubygems'
require 'search_biomodel'

@connection = SysMODB::SearchBiomodel.instance

puts "\n\n ------------------ List All -----------------------------\n"
all_models = @connection.get_all_models
all_models.each { |item| puts "ID = #{item[:key]}    |    NAME = #{item[:value]}\n" }
puts " ----------------------------------------------------------\n\n\n"

puts "\n\n ------------------ By Chebiid --------------------------\n" 
i=0
models_by_chebiid = @connection.search_by_ChEBIID("CHEBI:15422")
models_by_chebiid.each { |item| puts "#{i+=1} #{item.to_s}\n"}
puts " ----------------------------------------------------------\n\n\n"

puts "\n\n ------------------ By Name -----------------------------\n"  
i=0
models_by_name = @connection.search_by_name("Kolomeisky2003")
models_by_name.each { |item| puts "#{i+=1} #{item.to_s}\n"}
puts " ----------------------------------------------------------\n\n\n"

puts "\n\n ------------------ By Person----------------------------\n"  
i=0
models_by_person = @connection.search_by_person("Jim")
models_by_person.each { |item| puts "#{i+=1} #{item.to_s}\n"}
puts " ----------------------------------------------------------\n\n\n"

puts "\n\n ------------------ Model ID by Name---------------------------\n"   
i=0
models_by_person = @connection.get_model_name_by_id("BIOMD0000000190")
models_by_person.each { |item| puts "#{i+=1} #{item.to_s}\n"}
puts " ----------------------------------------------------------\n\n\n"

Fun Fact

You can append the Model ID to the URL www.ebi.ac.uk/biomodels-main/ to load the link eg (continuing from above).

models_by_person.each { |item| puts "http://www.ebi.ac.uk/biomodels-main/#{item.to_s}\n" } 

#=> http://www.ebi.ac.uk/biomodels-main/BIOMD0000000190
#=> http://www.ebi.ac.uk/biomodels-main/BIOMD0000000191

Contributing to search_biomodel

Copyright © 2011 Niall Beard. See LICENSE.txt for further details.