Getting started with BioRuby and Ruby on Rails.
By kenglish
Started messing with Bioruby this week. I went through George Githinji’s excellent tutorial on his biorlated blog, Bio-graphics, BioSQL and Ruby on Rails part 1 and Bio-graphics, BioSQL and Ruby on Rails part 2. This is very helpful. Before you do the stuff below, read through his tutorial so you understand what’s going on. Here’s what I had to do to get it working:
Install the gems
I got started by installing the bio, bioruby gem.
sudo gem install bioruby sudo gem install bio
I discovered that the bio-graphics gem needs cairo. Here’s how to install it on Ubuntu. This had 50-something dependencies. I just sat back and let them install:
sudo apt-get install cairo-clock cairo-dock-dev libcairo-ruby libcairo2
I also had to install ruby support for pango:
sudo apt-get install -y libpango1-ruby
I installed bio-graphics and the cairo gem.
gem install bio-graphics cairoGeorge also uses rails_sql_views so I installed this:
sudo gem install rails_sql_views
As George warned in his blog, I had to comment out these lines in
unless Kernel.respond_to?(:gem) Kernel.send :alias_method, :gem, :require_gem end
in rails_sql_views(0.6.1). Mine was located in /usr/lib/ruby/gems/1.8/gems/rails_sql_views-0.6.1/lib/rails_sql_views.rb. I commented out lines 28-30.
Install the biosql_rails_example application
To get george’s app running, I cloned the biorelate repository into my /home/kenglish/workspace directory:
cd /home/kenglish/workspace git clone git://github.com/georgeG/biosql_rails_example.git
I edited the database.yml file and added my mysql infomration. You can create the database by hand as George explains but I put in the mysql root username and password in the database.yml file and ran:
rake db:create.
Install the biosql database schema
As George explains, I had to download the biosql schema and untared it. I created the tables like this:
cd /home/kenglish/downloads/ tar xzvf biosql-1.0.1.tar.gz cd biosql-1.0.1/sql mysql -uroot -p var_biosql_development < biosqldb-mysql.sql
I put these in the directory biosql-1.0.1/scripts and loaded them with the script load_ncbi_taxonomy.pl.
perl load_ncbi_taxonomy.pl --dbname var_biosql_development --dbuser root --host localhost --download
I don’t have any bio-related data so I downloaded the following files from the Ncbi ftp site (ftp://ftp.ncbi.nih.gov/pub/taxonomy/): gi_taxid_nucl.dmp.gz taxcat.tar.gz and taxdump.tar.gz.
Now I was able to run George’s Rails app! To be continued…
bioruby 


March 5th, 2009