<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Biorelated</title>
	<atom:link href="http://biorelated.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://biorelated.wordpress.com</link>
	<description>[bioinformatics,biology,ruby,rails].each do &#124;b&#124; puts b.blog end</description>
	<lastBuildDate>Fri, 21 Aug 2009 21:42:26 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='biorelated.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/41054b22bbe7debbf1d63972772e21fa?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Biorelated</title>
		<link>http://biorelated.wordpress.com</link>
	</image>
			<item>
		<title>Bio-graphics, BioSQL and Rails part 2</title>
		<link>http://biorelated.wordpress.com/2009/01/08/bio-graphics-biosql-and-rails-part-2/</link>
		<comments>http://biorelated.wordpress.com/2009/01/08/bio-graphics-biosql-and-rails-part-2/#comments</comments>
		<pubDate>Thu, 08 Jan 2009 12:23:50 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[biographics]]></category>
		<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[bioruby]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[technology]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/?p=114</guid>
		<description><![CDATA[In  part 1 of this series we created a rails application and connected it to a BioSQL database. We also overwrote the rails convections to accommodate our legacy schema.
To understand the BioSQL schema, please review the documentation here. A brief overview of is as follows. Every record we enter into our database is a &#8216;bioentry&#8217; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=114&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In  <a title="biographics,biosql and rails" href="http://biorelated.wordpress.com/2009/01/07/bio-graphics-biosql-and-rails-part-1/" target="_blank">part 1 of this series</a> we created a rails application and connected it to a BioSQL database. We also overwrote the rails convections to accommodate our legacy schema.</p>
<p>To understand the BioSQL schema, <a title="biosql overview" href="http://www.biosql.org/wiki/Schema_Overview" target="_blank">please review the documentation</a> here. A brief overview of is as follows. Every record we enter into our database is a &#8216;bioentry&#8217; and goes to the <span style="color:#0000ff;">bioenty table.</span> A bioentry can be composed of the following entities: the record&#8217;s <em>public name</em>, public accession and version, its description and an identifier field.</p>
<p>The actual sequence data is stored in the <span style="color:#0000ff;">biosequence table</span> which contains raw sequence information associated with a bioentry, and alphabet information (&#8216;protein&#8217;, &#8216;dna&#8217;, &#8216;rna&#8217;). This is because not all records in our database need to be associated with a raw sequence. Additional sequence information is stored in the <span style="color:#0000ff;">seqfeature table</span> together with other qualifiers.</p>
<p>The location of each <span style="color:#0000ff;">seqfeature</span> (or sub-seqfeature) is defined by a location entity, describing the stop and start coordinates and strand. This information is stored in the <span style="color:#0000ff;">location table. </span></p>
<p><span style="color:#0000ff;"><span style="color:#000000;">In our rails application we are going to create some models and a few controllers. In RESTful language, we are actually creating resources. In this example we will be very simplistic and just create a biodatabase, taxon, bioentry, biosequence, seqfeature, location resources. We will also create associations between them in their model classes. But before that </span></span> delete the <span style="color:#0000ff;">index.html</span> file from your rails application public folder and add the following line to your configurations/routes.rb file</p>
<pre> <span style="color:#993366;">map.root :controller =&gt; "biosequences"</span></pre>
<p><span style="color:#0000ff;"><span style="color:#000000;">To quickly create the models, controllers, associated views and a test suite for each of our resources, just run the rails generate scaffold command, passing the name of the model as an argument. For example,</span></span></p>
<pre><span style="color:#993366;">generate scaffold Bioentry</span></pre>
<p><span style="color:#0000ff;"><span style="color:#000000;">will create a </span></span><span style="color:#0000ff;"><span style="color:#000000;">bioentry </span></span><span style="color:#0000ff;"><span style="color:#000000;">model, a bioentries_controller, associated views (index,show,edit and new), a migration file, though in our case we do not need it. When you finish scaffolding, the routes.rb file should have the following resources declared.<br />
</span></span></p>
<pre><span style="color:#0000ff;"><span style="color:#000000;">  <span style="color:#993366;">map.resources :seqfeatures
  map.resources :locations
  map.resources :bioentries
  map.resources :biosequences
  map.resources :taxon
  map.resources :biodatabases

</span></span></span></pre>
<p>Let us create some mandatory associations for the models.</p>
<p>Edit the /models/biodatabase.rb file by adding the following</p>
<pre> <span style="color:#993366;">has_many :bioentries #a biodatabase is associated with many bioentries
 validates_uniqueness_of :name  #The name foe each biodatabase is unique!</span></pre>
<p>Edit the /models/bioentry.rb file by adding the following</p>
<pre>    <span style="color:#993366;">belongs_to :biodatabase
    belongs_to :taxon
    has_one :biosequence</span></pre>
<p>Edit the /models/taxon.rb and add</p>
<pre>   <span style="color:#993366;">has_one :bioentry</span></pre>
<p>Edit the /models/biosequence.rb file by adding:</p>
<pre>  <span style="color:#993366;">set_primary_key :bioentry_id</span> #biosequence uses bioentry_id as a primary key!
<span style="color:#993366;">  belongs_to :bioentry</span></pre>
<p>edit the /models/location.rb file by adding:</p>
<pre> <span style="color:#993366;">belongs_to :seqfeature</span></pre>
<p>Edit the /models/seqfeature.rb file by adding:</p>
<pre>  <span style="color:#993366;">belongs_to :bioentry
  has_many :locations</span></pre>
<p>Note that most likely you will be adding huge files to the database. BioSQL comes with a set of  perl scripts to enable you do that. Until bioruby 1.3 is released you will have to use the perl scripts to add huge datasets. All the documentation to do that is available from the BioSQL website. I used a perl script load_ncbi_taxonomy.pl to load taxon data to my database. This script comes with the BioSQL. (It did not seem to work on my system, I will sort that later)</p>
<p>To make this post shorter and get to the meat of it, i will assume that you have some existing data in your biosql database. If not, create some dummy data to populate, the biodatabase, bioentry,biosequence, seqfeature and location tables. In Part 3, I will show you how to create the necessary views to populate the database. After all biologists don&#8217;t want to interact with raw SQL queries and sometimes have no idea of running scripts, however they are very web savy!</p>
<p>Edit the /biosequences/show.html.erb to look as follows:</p>
<pre><span style="color:#993366;">&lt;h2&gt;&lt;%= @biosequence.bioentry.name%&gt;(&lt;%= @biosequence.alphabet %&gt;)&lt;/h2&gt;</span>
<span style="color:#993366;">&lt;p&gt;Sequence&lt;/p&gt;</span>
<span style="color:#993366;">&lt;%= @biosequence.seq %&gt;&lt;br/&gt;</span>
<span style="color:#993366;">
</span>
<span style="color:#993366;">&lt;%= link_to 'Edit', edit_biosequence_path(@biosequence) %&gt; </span></pre>
<p>Now navigate to http://localhost:3000/biosequences/1</p>
<p>and then navigate to http://locahost:3000/biosequences/1.xml The XML version of your sequence is also available!</p>
<p>Lets add some ability to render graphics for the sequences.</p>
<p>Add the following lines at the top of the <strong>biosequence.rb </strong>model file</p>
<pre> <span style="color:#993366;">require 'stringio'
 require 'base64' </span></pre>
<p>In the <strong>biosequence.rb</strong> model class, create a new method called <span style="color:#993366;">draw_graphic</span>.</p>
<pre><span style="color:#993366;">def self.draw_graphic(value)
      #get the name and length of the main feature to be drawn
     main_feature = Bioentry.find(value)
     len = main_feature.biosequence.length.to_i
     name = main_feature.name

    #create a Biographics panel and add a track
      </span><span style="color:#993366;">@my_panel = Bio::Graphics::Panel.new(len,:width=&gt; 900)</span><span style="color:#993366;">
      @track = @my_panel.add_track("#{name}",:glyph=&gt;'directed_generic')

     #specify the range for the main feature
     main_feature_range = "1..#{len}"
      @track.add_feature(Bio::Feature.new("#{name}",main_feature_range), :label=&gt;" ")

    #write the output to memory
        output = StringIO.new
        @my_panel.draw(output)
        return output.string
  end

</span></pre>
<p>This method will be called by an action method in <strong>biosequence_controller.rb</strong> file.</p>
<pre>  <span style="color:#993366;">def to_image
    begin
      image = Biosequence.draw_graphic(Biosequence.find(params[:id]))
      send_data(image, :filename =&gt; "graphic.svg", :disposition =&gt; "inline")
    rescue  ActiveRecord::RecordNotFound
      add_error("Error:Attempt to call image without specifying a biosequence  ID")
      redirect_to :action=&gt;'index'
    end
  end</span></pre>
<p>We add a rescue block to capture record not found errors. In RESTful applications a controller is limited to seven actions. So we need to add a collection to our biosequence resource in <strong>routes.rb. </strong>This is how we do it<strong>.<br />
</strong></p>
<pre><strong>  </strong><span style="color:#993366;">map.resources :biosequences,:collection=&gt;{:to_image=&gt;:get}</span><strong>
</strong></pre>
<p>Now we need to modify our /biosequences/show.html.erb file, to enable rendering of the graphic. For that we will create a helper method so that our show.html.erb view is &#8216;clean&#8217;. In helpers/<strong>biosequences_helper.rb</strong> file, add the following code</p>
<pre>  <span style="color:#993366;">def render_image(feature_obj)
     image_tag(url_for({:action=&gt;'to_image',:id=&gt;feature_obj}))
  end</span></pre>
<p>And in the /views/biosequences/show.html.erb file add the following line of code</p>
<pre><span style="color:#993366;">&lt;%= render_image(@biosequence) %&gt;&lt;br/&gt;</span></pre>
<p>Now assuming  that you have a biosql database with valid data, navigate to</p>
<p>http://localhost:3000/biosequences/show/1</p>
<div id="attachment_145" class="wp-caption aligncenter" style="width: 310px"><img class="size-medium wp-image-145" title="screenshot-biosequences-show-mozilla-firefox" src="http://biorelated.files.wordpress.com/2009/01/screenshot-biosequences-show-mozilla-firefox.png?w=300&#038;h=221" alt="screenshort" width="300" height="221" /><p class="wp-caption-text">screenshort</p></div>
<p>The above is a screen shot from my example application while I was writing this tutorial.</p>
<p>The source code for this example  application<a title="source code" href="http://github.com/georgeG/biosql_rails_example/tree/master" target="_blank"> is available from github</a></p>
<p>For a full review of the methods available for <a title="bio-graphics git repository" href="http://github.com/jandot/bio-graphics/tree/master" target="_blank">biographics please check the project&#8217;s git repository and the rdoc. </a></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/114/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/114/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/114/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=114&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2009/01/08/bio-graphics-biosql-and-rails-part-2/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>

		<media:content url="http://biorelated.files.wordpress.com/2009/01/screenshot-biosequences-show-mozilla-firefox.png?w=300" medium="image">
			<media:title type="html">screenshot-biosequences-show-mozilla-firefox</media:title>
		</media:content>
	</item>
		<item>
		<title>Bio-graphics, BioSQL and Rails part 1</title>
		<link>http://biorelated.wordpress.com/2009/01/07/bio-graphics-biosql-and-rails-part-1/</link>
		<comments>http://biorelated.wordpress.com/2009/01/07/bio-graphics-biosql-and-rails-part-1/#comments</comments>
		<pubDate>Wed, 07 Jan 2009 11:50:28 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[biographics]]></category>
		<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[bioruby]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/?p=25</guid>
		<description><![CDATA[In these series I will show you how to quickly add graphics support to a bioinformatics database rails application. We are going to use the biographics library by Jan Aerts, the BioSQL database schema, and rails 2.2.2 (also works with 2.3.2)  In this simple example we want to represent a sequence as a graphic, such [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=25&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>In these series I will show you how to quickly add graphics support to a bioinformatics database rails application. We are going to use the <a title="Biographics" href="http://github.com/jandot/bio-graphics/tree/master" target="_blank">biographics library</a> by <a title="Jan Aerts" href="http://saaientist.blogspot.com/" target="_blank">Jan Aerts</a>, the <a title="Biosql download" href="http://www.biosql.org/wiki/Downloads" target="_blank">BioSQL database schema</a>, and <a title="ruby on rails" href="http://www.rubyonrails.com" target="_blank">rails</a> 2.2.2 (also works with 2.3.2)  In this simple example we want to represent a sequence as a graphic, such that we can view it in a web browser more or less the way <a title="Gbrowse" href="http://gmod.org/wiki/Gbrowse" target="_blank">Gbrowse</a> works. Each main feature has different subfeatures at different locations along it.</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;- main feature</p>
<p>&#8212;&#8212;- &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;    subfeatures</p>
<p>We need to have the following installed, rails 2.1.1, bio 2.1, biographics 1.4 all available as gems and a database based on BioSQL schema.</p>
<p>We need to download the BioSQL schema <a title="download bioSQL" href="http://www.biosql.org/wiki/Downloads" target="_blank">located here</a>. The latest version as of this writing is BioSQL v1.0 (code-named Tokyo) release, v1.0.1. Create a database called biosql_development. I am on Ubuntu Linux with Mysql 5.0.</p>
<pre><span style="color:#993366;">george:&gt;mysql -u george -p</span>
<span style="color:#993366;">:enter password</span>
<span style="color:#993366;">Welcome to the MySQL monitor.  Commands end with ; or \g.</span>
<span style="color:#993366;">Your MySQL connection id is 27</span>
<span style="color:#993366;">Server version: 5.0.51a-3ubuntu5.4 (Ubuntu)</span>
<span style="color:#993366;">
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.</span>
<span style="color:#993366;">
mysql&gt; create database biosql_development;
Query OK, 1 row affected (0.02 sec)

mysql&gt; 

</span></pre>
<p><span style="color:#000000;">I have created a database called biosql_development. Why am i not using migrations? The reason is that BioSQL has some agreed standards on table names and schema convection which are not compatible with rails database creation and table naming conventions. However Rails allows us to override these default convections, when working with legacy databases, as will be our case.<br />
</span></p>
<p><span style="color:#000000;">After creating the database, load the BioSQL schema to the empty database. First we need to tell mysql which database to use.</span></p>
<pre><span style="color:#993366;">mysql&gt; use biosql_development;</span></pre>
<p><span style="color:#000000;">then load the schema</span></p>
<pre><span style="color:#993366;">mysql&gt; source /home/george/Desktop/downloadsfolder/biosql-1.0.1/sql/biosqldb-mysql.sql;
Query OK, 0 rows affected, 1 warning (0.48 sec)

Query OK, 0 rows affected (0.15 sec)
Records: 0  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected, 1 warning (0.01 sec)

Query OK, 0 rows affected (0.03 sec)
Records: 0  Duplicates: 0  Warnings: 0

Query OK, 0 rows affected, 1 warning (0.01 sec)

 ........ trucated</span>
<span style="color:#993366;">mysql&gt;</span></pre>
<p><span style="color:#000000;">Now we need to create a rails application and connect to this database.<br />
</span></p>
<p><span style="color:#000000;">I use the <a title="Netbeans" href="http://www.netbeans.com" target="_blank">Netbeans IDE development</a> environment for creating ruby and rails applications. Go ahead and create a rails application and specify to use mysql as the database adapter.</span></p>
<p><span style="color:#000000;">To connect to our legacy database, we need to override some convections. First disable table plurulization, and tell rails that the table primary name is named as tablename_id as opposed to just the id column expected by rails. To do that<br />
</span></p>
<p><span style="color:#000000;">Create a new file in your application configurations/initializers directory called <strong>override_rails.rb</strong> (you can call it whatever).</span></p>
<pre> <span style="color:#993366;">class ActiveRecord::Base
  self.pluralize_table_names = false
</span><span style="color:#993366;"><span style="color:#993366;">
  self.primary_key_prefix_type = :table_name_with_underscore
 end</span></span></pre>
<p>The two lines above tells ActiveRecord not to expect the table names to be plural and that the primary key for each table is named as tablename_id format.</p>
<p><span style="color:#000000;"> Also create another one called <strong>external_libraries.rb</strong> in the initializers directory, as you can tell this is where I want to put my require statements for loading external libraries.<br />
</span></p>
<pre><span style="color:#993366;">require 'rubygems'

#load the bioinformatics library
require 'bio'

#load the biographics library
require 'bio-graphics'

#load the sql views extension library
gem 'rails_sql_views'
require 'rails_sql_views'
</span></pre>
<p><span style="color:#000000;">This file loads our gems. The rails_sql_views gem allows us to create views and access them by creating models corresponding to the views. </span></p>
<p><span style="color:#000000;">At this point if you run rake db:schema:dump, we will have a rails based BioSQL schema and which we can conveniently use to create a BioSQL database on any Relational database that rails supports and this includes Microsoft SQL server, DB2, Oracle, SQLlite and a host of others. All that would be required is to change the database.yml file to suit the adapter of choice and then execute rake db:schema:load to load the BioSQL schema.</span></p>
<p><span style="color:#000000;">Please note that if your are using rails 2.2.2,  you may want to comment the lines </span></p>
<pre><span style="color:#993366;">unless Kernel.respond_to?(:gem)
  Kernel.send :alias_method, :gem, :require_gem</span>
end</pre>
<p><span style="color:#000000;">in rails_sql_views(0.6.1), </span>otherwise running db:schema:dump will cause rake to abort.</p>
<p><span style="color:#000000;">In the next part I will describe how to create the necessary resources for our <a title="REST" href="http://en.wikipedia.org/wiki/Representational_State_Transfer" target="_blank">RESTful</a>(Representational State Transfer) bioinformatics web application and rendering of the graphics.<br />
</span></p>
<p><span style="color:#000000;"><br />
</span></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/25/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/25/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/25/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=25&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2009/01/07/bio-graphics-biosql-and-rails-part-1/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>
	</item>
		<item>
		<title>Approximate string matching metrics with amatch</title>
		<link>http://biorelated.wordpress.com/2009/01/06/approximate-string-matching-metrics-with-amatch/</link>
		<comments>http://biorelated.wordpress.com/2009/01/06/approximate-string-matching-metrics-with-amatch/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 14:18:49 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[bioruby]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/?p=75</guid>
		<description><![CDATA[Most often in sequence analysis we want to compare how  similar two sequences are. How can we quantify similarity by using a metric? That was my question yesterday and I went hunting for a ruby implementation for such metrics. Luckily I got a library called amatch which is an approximate string matching extension for ruby! [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=75&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Most often in sequence analysis we want to compare how  similar two sequences are. How can we quantify similarity by using a metric? That was my question yesterday and I went hunting for a ruby implementation for such metrics. Luckily I got a library called <a title="amatch" href="http://amatch.rubyforge.org/" target="_blank">amatch</a> which is an approximate string matching extension for ruby! amatch implements the following metrics:</p>
<p>Hamming distance,  Levenshtein edit distance,longest subsequence common to two strings,longest substring common to two strings,sellers distance and pair distance which is based on the number of adjacent character pairs, that are contained in two  strings.</p>
<p><strong>Hamming distance</strong></p>
<p>This is the number of characters that are different between two strings. This is not recommended for the majority of string based information retrieval. Very similar strings can sometimes be given high hamming distances.</p>
<p><strong>Leveshtein edit distance </strong></p>
<p>Is defined as the minimal costs involved in transforming one string into another by using  deletion, insertion and substitution of a character to one of the strings. The algorithm can associate a cost for performing each of the operations and for this metric it is usually 1.</p>
<p><strong>Longest common substring</strong></p>
<p>This is define as the contiguous chain of characters that exists in both strings. The longer the substring the better the match between the two strings. The problem with this approach is that if a difference was introduced in the middle of one string, the distance will be longer that if the same difference was introduced at the beginning of one of the strings.</p>
<p><strong>Longest common Subsequence</strong></p>
<p>The longer the common sub sequence is, the more similar the two strings will be. In this case a sub sequence does not have to be contiguous.</p>
<p>Look at the <a title="amatch documentation" href="http://amatch.rubyforge.org/doc/index.html" target="_blank">documentation</a> for more explanations of the metrics and algorithms.</p>
<p>To use the library you need to first install the gem. I installed it on my Linux box running Ubuntu and ruby 1.8.6.</p>
<pre><span style="color:#993366;">sudo gem install amatch</span></pre>
<p>Then in script,</p>
<pre><span style="color:#993366;">require 'rubygems'
</span>
<span style="color:#993366;">require 'amatch'</span></pre>
<pre><span style="color:#993366;">include Amatch</span><span style="color:#993366;">
require  'bio'</span></pre>
<pre><span style="color:#993366;">#with bioruby it would be easy to compare two sequence entries  for example</span></pre>
<pre><span style="color:#993366;">seq_obj1 = Bio::Sequence.auto("actagatatttgat")
seq_obj2 = Bio::Sequence.auto("gccagatagttaat")

#calculate the hamming distance
 m = Hamming.new(seq_obj1.to_seq)
 m.match(seq_obj2.to_seq)</span>
<span style="color:#993366;">#=&gt; 

#calculate pair-distances between the two sequences
</span><span style="color:#993366;">pair_distance_obj = PairDistance.new(seq_obj1.seq)
pair_distance_obj.match(seq_obj2.seq)</span>
 <span style="color:#993366;">#=&gt;</span>
<span style="color:#993366;"># note that you can just substitute the strings directly to the metric object creation method
without creating the sequence objects!
</span></pre>
<p>Note that amatch  failed to install on windows XP with the following error</p>
<p><span style="color:#ff6600;">B</span><span style="color:#ff6600;"><span style="color:#ff6600;">uilding</span> native extensions.  This could take a while&#8230;<br />
ERROR:  Error installing amatch:<br />
ERROR: Failed to build gem native extension.</span></p>
<p><span style="color:#ff6600;">C:/ruby-1.8.6/ruby/bin/ruby.exe extconf.rb install amatch<br />
creating Makefile</span></p>
<p><span style="color:#ff6600;">nmake<br />
&#8216;nmake&#8217; is not recognized as an internal or external command,<br />
operable program or batch file.</span></p>
<p>Although i have nmake installed on my windows machine. I will look at that later.</p>
<p>Happy string matching!</p>
<pre><span style="color:#993366;">
</span></pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=75&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2009/01/06/approximate-string-matching-metrics-with-amatch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>
	</item>
		<item>
		<title>What&#8217;s new in Bioruby edge</title>
		<link>http://biorelated.wordpress.com/2009/01/04/whats-new-in-edge-bioruby/</link>
		<comments>http://biorelated.wordpress.com/2009/01/04/whats-new-in-edge-bioruby/#comments</comments>
		<pubDate>Sun, 04 Jan 2009 16:38:05 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[bioruby]]></category>
		<category><![CDATA[blast]]></category>
		<category><![CDATA[databases]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/2009/01/04/whats-new-in-edge-bioruby/</guid>
		<description><![CDATA[Changes to Bio::Blast
Naohisa Goto has announced changes to the Bio::Blast.reports to support default -m 0 and tabular -m 8
formats in addition to XML (-m 7) form. I think this is really nice and convenient!
Previously it meant that for bioruby to parse a Blast file, you had to have your blast results in XML output which [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=54&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><span style="text-decoration:underline;"><strong>Changes to Bio::Blast</strong></span></p>
<p>Naohisa Goto has announced changes to the Bio::Blast.reports to support default -m 0 and tabular -m 8<br />
formats in addition to XML (-m 7) form. I think this is really nice and convenient!</p>
<p>Previously it meant that for bioruby to parse a Blast file, you had to have your blast results in XML output which Bio::Blast::Reports would understand. However, by default Blast gives an  -m0 output and without that prior knowledge you may spend hours wondering what is wrong when parsing default blast output files. With Bioruby 1.2.1 this will not work</p>
<pre><span style="color:#993366;">require 'rubygems'
require 'bio'

report_file = "/home/george/esther_blast_files/blast_output2.txt"
Bio::Blast.reports(report_file) do |report|
  puts report.class
end</span></pre>
<p>Unless blast_output2.txt is in XML format</p>
<p>In the upcoming Bioruby 1.3 the default Blast file can now be parsed, for example,</p>
<pre><span style="color:#993366;">require 'rubygems'
require 'bio'</span></pre>
<pre><span style="color:#993366;">report_file = "/home/george/esther_blast_files/blast_output2.txt"</span></pre>
<pre><span style="color:#993366;">Bio::FlatFile.open(Bio::Blast::Default::Report,report_file) do |ff|
ff.each do |rep|
   puts rep.statistics
   rep.iterations.each do |itr|
      puts itr.hits.size

    itr.hits.each_with_index do |hit,i|
      puts hit.hit_id
      puts hit.len
     end
   end
 end</span>
<span style="color:#993366;">end
</span></pre>
<p>Bio::Blast.remote now supports DDBJ in addition to Genomenet. It would be a nice idea to support NCBI as well.</p>
<p><strong><span style="text-decoration:underline;">Changes to Bio:sequence</span></strong></p>
<p>It is possible to create  sequence objects from Bio::GenBank, Bio::EMBL, and Bio::FastaFormat by using the to_biosequence method</p>
<pre><span style="color:#993366;">gb = Bio::GenBank.new(genbank_file.gb)</span>
<span style="color:#993366;">gb.to_biosequence</span></pre>
<p><span style="text-decoration:underline;"><strong>Bio::SQL Support</strong></span></p>
<p>Thanks to Raoul and Naohisa, support for BioSQL has been rewritten by using  ActiveRecord.</p>
<pre><span style="color:#993366;">#Make a connection
</span>
<span style="color:#993366;">connection = Bio::SQL.establish_connection(path_to_database.yaml,'development')</span>
<span style="color:#993366;">#list databases
</span>
<span style="color:#993366;">databases =Bio::SQL.list_databases</span>

<span style="color:#993366;">#retrieve a sequence
</span><span style="color:#993366;">sample_seq = Bio::SQL.fetch_accession('some_accession_number')
</span>
<span style="color:#993366;">#get number of seqeunces in the database</span>
<span style="color:#993366;">puts Bio::SQL.list_entries</span>

<span style="color:#993366;">#get references associated with an entry</span>
<span style="color:#993366;">puts sample_seq.references
</span>
<span style="color:#993366;">#create an embl format</span>
<span style="color:#993366;">puts sample_seq.to_biosequence.output(:embl)

</span></pre>
<p><strong><span style="text-decoration:underline;"><span style="color:#000000;">Changes to Bio::GFF2 and Bio::GFF3</span></span></strong></p>
<p><span style="color:#000000;">GFF2/GFF3 formatted texts are now supported but there will be backward portability issues with bio 1.2.1 since some incompatible changes have been incorporated.  Bio::GFF::Record.comments has been renamed to comment and comments= is now comment=</span></p>
<p><span style="color:#000000;">Both Bio::GFF::GFF2::Record.new and Bio::GFF::GFF3::Records.new, can now take 9 arguments that correspond to GFF columns making it easy to create a Record object directly without need for  formatted text.</span></p>
<p><span style="color:#000000;">Both </span>Bio::GFF::GFF2::Record#attributes and Bio::GFF::GFF3::Record#attributes have been changed to return a nested array containing tag, value pairs, to obtain a  hash, use the to_hash method</p>
<p>To support data output for GFF2/GFF3, new methods have been added:  Bio::GFF::GFF2#to_s, Bio::GFF::GFF3#to_s, Bio::GFF::GFF2::Record#to_s,and Bio::GFF::GFF3::Record#to_s</p>
<p>Lots of other changes have been incorporated for the GFF classes and you can<a title="bio 1.3 change log" href="http://github.com/bioruby/bioruby/tree/master/doc/Changes-1.3.rd" target="_blank"> view the change log at github</a></p>
<p><span style="text-decoration:underline;"><strong>CodeML parser</strong></span></p>
<p>A wrapper for PAML codeml program that is used for estimating evolutinary rate has been added.  The class provides methods  for generating the necessary configuration file. The new Bio::PAML::Codeml::Report and PAML::Codeml::Rates  provides simpel classes  for accessing the codeml report and rates file.  This example is from the example given in the source code</p>
<pre><span style="color:#993366;">require 'bio'</span></pre>
<div id="LC38" class="line">
<pre><span style="color:#993366;"><span class="c1"># Reads multi-fasta formatted file and gets a Bio::Alignment object.</span></span></pre>
</div>
<div id="LC40" class="line">
<pre><span style="color:#993366;">  <span class="c1">   alignment = Bio::FlatFile.open(Bio::Alignment::MultiFastaFormat, 'example.fst').alignment</span></span></pre>
</div>
<div id="LC41" class="line">
<pre><span style="color:#993366;">  <span class="c1">   # Reads newick tree from a file</span></span></pre>
</div>
<div id="LC42" class="line">
<pre><span style="color:#993366;">  <span class="c1">   tree = Bio::FlatFile.open(Bio::Newick, 'example.tree').tree</span></span></pre>
</div>
<div id="LC43" class="line">
<pre><span style="color:#993366;">  <span class="c1"># Creates a Codeml object</span></span></pre>
</div>
<div id="LC44" class="line">
<pre><span style="color:#993366;">  <span class="c1">codeml = Bio::PAML::Codeml.new</span></span></pre>
</div>
<div id="LC45" class="line">
<pre><span style="color:#993366;">  <span class="c1">   # Sets parameters</span></span></pre>
</div>
<div id="LC46" class="line">
<pre><span style="color:#993366;">  <span class="c1">   codeml.parameters[:runmode] = 0</span></span></pre>
</div>
<div id="LC47" class="line">
<pre><span style="color:#993366;">  <span class="c1">   codeml.parameters[:RateAncestor] = 1</span></span></pre>
</div>
<div id="LC48" class="line">
<pre><span style="color:#993366;">  <span class="c1">   # You can also set many parameters at a time.</span></span></pre>
</div>
<div id="LC49" class="line">
<pre><span style="color:#993366;">   <span class="c1">codeml.parameters.update({ :alpha =&gt; 0.5, :fix_alpha =&gt; 0 })</span></span></pre>
</div>
<div id="LC50" class="line">
<pre><span style="color:#993366;">  <span class="c1">   # Executes codeml with the alignment and the tree</span></span></pre>
</div>
<div id="LC51" class="line">
<pre><span style="color:#993366;">  <span class="c1">   report = codeml.query(alignment, tree)

</span></span></pre>
<p><span style="color:#000000;"><span class="c1">Lots of Bugs  have been fixed and also support for Ruby 1.9 has been added. Its great thanks to the bioruby developers for their time and the excellent new changes! </span></span></p>
<p><span style="color:#000000;"><span class="c1"><br />
</span></span></p>
<pre></pre>
</div>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/54/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/54/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/54/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=54&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2009/01/04/whats-new-in-edge-bioruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>
	</item>
		<item>
		<title>At the Bench Series</title>
		<link>http://biorelated.wordpress.com/2008/10/12/at-the-bench-series/</link>
		<comments>http://biorelated.wordpress.com/2008/10/12/at-the-bench-series/#comments</comments>
		<pubDate>Sun, 12 Oct 2008 09:26:43 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[laboratory]]></category>
		<category><![CDATA[technology]]></category>
		<category><![CDATA[lab survival]]></category>
		<category><![CDATA[skills]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/?p=32</guid>
		<description><![CDATA[Am cross cutting between the bench and the computer. My mentor and supervisor has given me an excellent book called At the Bench: A  laboratory Navigator by Kathy Barker. It is an exciting read for anyone who plans to use a biomedical research laboratory and I thought, Why not share some of the gems as  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=32&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Am cross cutting between the bench and the computer. My mentor and supervisor has given me an excellent book called <a title="A  laboratory Navigator by Kathy Barker" href="http://www.amazon.com/Bench-Laboratory-Navigator-Kathy-Barker/dp/0879697083" target="_blank">At the Bench: A  laboratory Navigator by Kathy Barker</a>. It is an exciting read for anyone who plans to use a biomedical research laboratory and I thought, Why not share some of the gems as  I read along:</p>
<p style="text-align:center;"><strong>Basic Survival</strong></p>
<p style="text-align:left;">Simple lab courtesy is a nice way of maintaining healthy working relationship with your fellow lab rats, in this rat race! What Kathy says sounds real trouble but i think and you will probably agree, its basic common sense.</p>
<p><strong>Attitude</strong></p>
<ul>
<li>Ask, do not command.</li>
<li>Assume nothing</li>
<li>Write down everything when given instructions</li>
<li>Make appointments or request time with people</li>
<li>Do not remove journals from the Departmental library</li>
<li>Do not discuss a fellow lab rat&#8217;s  results with people not in the lab</li>
</ul>
<p>Courtesy at the Bench</p>
<ul>
<li>Never use reagents or buffers without permission</li>
<li>Do not ignore broken equipments</li>
<li>Order common reagents if they are running low</li>
<li>Do not move things around or change locations of any tubes reagents or equipment.(This is not ya damn bedroom!)</li>
<li>Do not leave anything anywhere</li>
<li>If you do something wrong, confess (I wonder whether there is purgatory :))</li>
<li>Clean up immediately after an experiment</li>
<li>Request the minimum of favors( fellow lab rats are not working for you)</li>
</ul>
<p>Like all complex organizations, each research lab has its own culture and rules. the rules are largely unspoken and may not be written down. You are expected to know how to work with the equipment or referred to the manual.  You are required to decipher the vague signs and complex language to understand the rhythm and beat of the lab.  Kathy does a great job in  introducing the naive to the workbench  in this book.</p>
<p>All the best dear friend.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/32/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/32/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/32/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=32&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2008/10/12/at-the-bench-series/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>
	</item>
		<item>
		<title>Bioruby Resources</title>
		<link>http://biorelated.wordpress.com/2008/04/17/bioruby-resources/</link>
		<comments>http://biorelated.wordpress.com/2008/04/17/bioruby-resources/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 23:20:57 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/2008/04/17/bioruby-resources/</guid>
		<description><![CDATA[As a member of the Bioruby mailing list, my first post was where is the Bioruby documentation?

Why it is that Bioruby is not well documented? This question pops up so often in the mailing list that I am going to list a couple of resources here:

The best place to get started is at the Bioruby [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=31&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As a member of the <a href="http://lists.open-bio.org/mailman/listinfo/bioruby">Bioruby mailing list</a>, my first post was where is the Bioruby documentation?
</p>
<p>Why it is that Bioruby is not well documented? This question pops up so often in the mailing list that I am going to list a couple of resources here:
</p>
<p>The best place to get started is at the <a href="http://bioruby.open-bio.org/">Bioruby new website</a>. For some reason the <a href="http://bioruby.org">other website</a> is still active.
</p>
<p>An excellent tutorial written by Katayama Toshiaki among others <a href="http://dev.bioruby.org/wiki/en/?Tutorial.rd">is available here</a>. Sample scripts on common tasks for sequence manipulations can be <a href="http://bioruby.open-bio.org/wiki/Code_Snippets">accessed from here</a>.
</p>
<p>Some <a href="http://bioruby.open-bio.org/archive/doc/">Bioruby presentations</a> can be <a href="http://bioruby.open-bio.org/archive/doc/">downloaded from here as well</a>.
</p>
<p>The following blogs are dedicated in a way to Bioruby and bioinformatics<br /><a href="http://www.bioinformaticszen.com/" target="_blank">http://www.bioinformaticszen.com/</a></p>
<p><a href="http://saaientist.blogspot.com/" target="_blank">http://saaientist.blogspot.com/</a></p>
<p><a href="http://bioinforuby.blogspot.com/" target="_blank">http://bioinforuby.blogspot.com/</a></p>
<p><a href="http://rubyonwindows.blogspot.com/" target="_blank">http://rubyonwindows.blogspot.com/</a></p>
<p><a href="http://bioruby.g.hatena.ne.jp/nakao_mitsuteru/" target="_blank">http://bioruby.g.hatena.ne.jp/nakao_mitsuteru/</a>
	</p>
<p>If you have a specific question post it on the <a href="http://lists.open-bio.org/mailman/listinfo/bioruby">mailing list</a>. And you may have an opportunity to have your question or problem solved by the experts!</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biorelated.wordpress.com/31/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biorelated.wordpress.com/31/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/31/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/31/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/31/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=31&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2008/04/17/bioruby-resources/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>
	</item>
		<item>
		<title>Bioruby workshop</title>
		<link>http://biorelated.wordpress.com/2008/04/17/bioruby-workshop/</link>
		<comments>http://biorelated.wordpress.com/2008/04/17/bioruby-workshop/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 08:13:17 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/2008/04/17/bioruby-workshop/</guid>
		<description><![CDATA[
I would like to announce the first Bioruby workshop here in East Africa.
Please note the following important points:

1. The course will be held on Thursday 22nd May at the International Livestock Research Institute (ILRI) Nairobi-Kenya

2. Send your application form to bioinfoafrica@gmail.com. Applications not sent to this EMAIL ADDRESS WILL NOT be processed.

3. Deadline for application [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=30&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://biorelated.files.wordpress.com/2008/04/041708-0812-biorubywork1.png" alt="" /></p>
<p>I would like to announce the first Bioruby workshop here in East Africa.</p>
<p><span style="font-size:8pt;font-family:Verdana;">Please note the following important points:</span><span style="font-size:12pt;font-family:Times New Roman;"><br />
</span></p>
<p><span style="font-size:8pt;font-family:Verdana;">1. The course will be held on Thursday 22nd May at the <a href="http://www.ilri.org">International Livestock Research Institute (ILRI) </a>Nairobi-Kenya</span><span style="font-size:12pt;font-family:Times New Roman;"><br />
</span></p>
<p><span style="font-size:8pt;font-family:Verdana;">2. Send your application form to <a href="mailto:bioinfoafrica@gmail.com"><span style="text-decoration:underline;color:blue;">bioinfoafrica@gmail.com</span></a>. Applications not sent to this EMAIL ADDRESS WILL NOT be processed.</span><span style="font-size:12pt;font-family:Times New Roman;"><br />
</span></p>
<p><span style="font-size:8pt;font-family:Verdana;">3. Deadline for application is May 1st 2008, successful applicants will be notified by 8th of May 2008.</span><span style="font-size:12pt;font-family:Times New Roman;"><br />
</span></p>
<p><span style="font-size:8pt;font-family:Verdana;">4. Currently we are not able to offer travel fellowships for members outside Nairobi or Kenya. However, this is just the beginning of RSG East Africa getting organized to have training for its members and we hope in due course that such initiative will attract funding for travel.</span><span style="font-size:12pt;font-family:Times New Roman;"><br />
</span></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biorelated.wordpress.com/30/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biorelated.wordpress.com/30/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/30/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/30/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/30/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=30&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2008/04/17/bioruby-workshop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>

		<media:content url="http://biorelated.files.wordpress.com/2008/04/041708-0812-biorubywork1.png" medium="image" />
	</item>
		<item>
		<title>Bioruby mini-series: The Bio::Sequence::Common class</title>
		<link>http://biorelated.wordpress.com/2008/02/12/bioruby-mini-series-the-biosequencecommon-class/</link>
		<comments>http://biorelated.wordpress.com/2008/02/12/bioruby-mini-series-the-biosequencecommon-class/#comments</comments>
		<pubDate>Tue, 12 Feb 2008 08:43:14 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[bioinformatics]]></category>
		<category><![CDATA[bioruby]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/?p=26</guid>
		<description><![CDATA[
Sequence Transformation
Lets have a look at the Bio::Sequence::Common class module which provides us with most of the sequence transformation methods for biological sequences.
Bio::Sequence::Common
Implements methods which are common to both Bio::Sequence::AA and Bio::Sequence::NA, for example
A Bio::Sequence object is easily created like this;
require &#8216;bio&#8217;

my_dna = Bio::Sequence.auto("actagatatttgat") #=&#62; actagatatttgat
my_dna is now a Bio::sequence object and you can use [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=26&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><img src="http://biorelated.files.wordpress.com/2008/04/021208-0843-biorubymini1.png" alt="" /></p>
<h3>Sequence Transformation</h3>
<p>Lets have a look at the Bio::Sequence::Common class module which provides us with most of the sequence transformation methods for biological sequences.</p>
<h3>Bio::Sequence::Common</h3>
<p>Implements methods which are common to both Bio::Sequence::AA and Bio::Sequence::NA, for example</p>
<p>A Bio::Sequence object is easily created like this;</p>
<p><span style="color:#800000;"><span style="font-family:Batang;">require &#8216;bio&#8217;</span><br />
</span></p>
<pre>my_dna = Bio::Sequence.auto("actagatatttgat") #=&gt; actagatatttgat</pre>
<p><span style="font-family:Batang;">my_dna</span> is now a Bio::sequence object and you can use the various methods available for this class, which we are going to explore shortly.</p>
<p><strong>Bio::Sequence::Common Non Modifying methods</strong></p>
<ul>
<li>
<div><strong>to_s</strong></div>
<p>This method returns a sequence as a string. It does not modify the original sequence.</p>
<p style="text-align:justify;"><span style="color:#800000;"><span style="font-family:Batang;">puts my_dna.to_s #=&gt; actagatatttgat</span><br />
</span></p>
<p style="text-align:justify;"><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts my_dna.to_s.class #=&gt; String</span><br />
</span></p>
<p style="text-align:justify;">An alias for this method is the <span style="font-family:Batang;">to_str</span> method.</p>
<p style="text-align:justify;"><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">my_dna.to_str</span><span style="color:#800000;"><br />
</span> <span style="font-family:Batang;color:#800000;">#=&gt; actagatatttgat</span><br />
</span></li>
<li>
<div><strong>seq </strong></div>
<p>This method will return a new Bio::Sequence::NA or Bio::Sequence::AA object. The original sequence remains unchanged. For example if you wished to assign a new instance of <strong>my_dna</strong> object that we created above ,such that you have a <strong>my_dna2</strong> object, you would create that as follows,</p>
<p><span style="color:#800000;"><span style="font-family:Batang;">my_dna2 = my_dna.seq</span><br />
</span></p>
<p><span style="color:#800000;"><span style="font-family:Batang;">puts my_dna2 #=&gt; actagatatttgat</span><br />
</span></p>
<p><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts my_dna2.class #=&gt;</span><span style="color:#800000;"><br />
</span> <span style="font-family:Batang;color:#800000;">Bio::Sequence::NA</span><br />
</span></li>
</ul>
<p><strong>Bio::Sequence::Common modifying methods</strong></p>
<ul>
<li>
<div><strong>Normalize!</strong></div>
<p>This method removes all the white space and transforms all positions <strong>to uppercase</strong> if the sequence is an amino acid (AA) or transforms all positions <strong>to lowercase</strong> if the sequence is a nucleic acid (NA) sequence, leaving the original sequence modified</p>
<p>For example</p>
<p><span style="color:#800000;"><span style="font-family:Batang;">test_seq = Bio::Sequence::NA.new(&#8220;ACTG&#8221;)</span><br />
</span></p>
<p><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts test_seq.normalize! #=&gt;</span><span style="color:#800000;"><br />
</span> <span style="font-family:Batang;color:#800000;">actg</span><br />
</span></li>
<li>
<div><strong>Concatenating</strong></div>
<p>Many times we want to append a new sequence or a set of bases/residues eg a poly A sequence to the end of a new sequence and modify the original sequence. This is achieved by the <strong>concat </strong>method.<strong><br />
</strong>It is also referred to as <strong>&lt;&lt;</strong> method.</p>
<p><span style="color:#800000;"><span style="font-family:Batang;">test_seq = Bio::Sequence::NA.new(&#8220;actg&#8221;)</span><br />
</span></p>
<p><span style="color:#800000;"><span style="font-family:Batang;">test_seq &lt;&lt; &#8220;acagat&#8221; </span><br />
</span></p>
<p><span style="color:#800000;"><span style="font-family:Batang;">test_seq concat &#8220;acagat&#8221;</span><br />
</span></p>
<p><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts test_seq #=&gt;</span><span style="color:#800000;"><br />
</span> <span style="font-family:Batang;color:#800000;">actgacagat</span><br />
</span></li>
</ul>
<p><strong>Note that </strong>to create a new sequence that adds to an existing sequence without altering the original sequence you would use the <strong>+</strong> operator. It accepts a variable number of arguments. For example</p>
<p style="margin-left:36pt;"><span style="color:#800000;"><span style="font-family:Batang;">test_seq = Bio::Sequence::NA.new(&#8220;actg&#8221;)</span><br />
</span></p>
<p style="margin-left:36pt;"><span style="color:#800000;"><span style="font-family:Batang;">test_seq2 = test_seq + (&#8220;cttcccttttt&#8221; &#8220;tatatata&#8221;)</span><br />
</span></p>
<p style="margin-left:36pt;"><span style="color:#800000;"><span style="font-family:Batang;">puts test_seq2 #=&gt;</span><br />
<span style="font-family:Batang;">actgcttcccttttttatatata</span><br />
</span></p>
<p style="margin-left:36pt;"><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts test_seq #=&gt;actg</span><br />
</span></p>
<p><strong>Working with subsequences</strong></p>
<p style="text-align:justify;">Please note that biological sequence numbering convections are <em>one</em> based as opposed to ruby&#8217;s <em>zero</em> based. Biological coordinate&#8217;s convection for BioSQL and Chado is zero based.</p>
<ul>
<li>
<div><strong>Subseq </strong></div>
<p>This method returns a new sequence containing the subsequence identified by the start and end values given as parameters. This method works in a similar way to the <em>slice</em> string method. For example</p>
<p><span style="color:#800000;"><span style="font-family:Batang;">my_seq = Bio::Sequence::NA.new(&#8220;agggatttc&#8221;)</span><br />
</span></p>
<p><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts my_seq.subseq(2,5) #=&gt;</span><span style="color:#800000;"><br />
</span> <span style="font-family:Batang;color:#800000;">ggga</span><br />
</span></p>
<p>The first argument denotes the start and the second argument denotes the end of the subsequence. Both arguments must be positive integers</p>
<p>When this method is used without arguments, the start defaults to 1 and the end defaults to the last element of the string. Therefore when <span style="font-family:Batang;">subseq</span> is called without any arguments, it returns a new sequence similar to the original sequence.</p>
<p><span style="color:#00b0f0;"><span style="font-family:Batang;color:#800000;">puts my_seq.subseq #=&gt; agggatttc</span><br />
</span></li>
<li>
<div><strong>window_search</strong></div>
<p>This method is typically used with a block. The method is called if you wanted to step through a sequence given a length of a subsequence. Therefore the method accepts two arguments. <em>Step_size</em> which defines the size of your &#8217;steps&#8217; and the <em>window_size</em> which defines the length of the stepping subsequence. Any remaining sequence at the terminal end will be returned. The default step size is one since its an optional argument.</p>
<p>For example</p>
<p>To print the average GC% on each 100bp you can write,</p>
<p><span style="color:#800000;"><span style="font-family:Batang;">s.window_search(100) do |subseq|</span><br />
</span></p>
<p><span style="color:#800000;"><span style="font-family:Batang;">puts subseq.gc</span><br />
</span></p>
<p><span style="font-family:Batang;color:#800000;">end</span></li>
</ul>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biorelated.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biorelated.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=26&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2008/02/12/bioruby-mini-series-the-biosequencecommon-class/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>

		<media:content url="http://biorelated.files.wordpress.com/2008/04/021208-0843-biorubymini1.png" medium="image" />
	</item>
		<item>
		<title>Bioruby mini-series: The Sequence class</title>
		<link>http://biorelated.wordpress.com/2007/11/23/bioruby-mini-series-the-sequence-class/</link>
		<comments>http://biorelated.wordpress.com/2007/11/23/bioruby-mini-series-the-sequence-class/#comments</comments>
		<pubDate>Fri, 23 Nov 2007 11:59:03 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[bioruby]]></category>
		<category><![CDATA[tutorials]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/2007/11/23/bioruby-mini-series-the-sequence-class/</guid>
		<description><![CDATA[Bioruby is a bioinformatics ruby package   for analysis of biological sequences. In my  quest to become a bioruby guru i  have decided to poke the bioruby API and all available tutorials to better understand this fantastic library written by the bioruby team of developers. My journey will be logged here as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=21&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://bioruby.open-bio.org/" title="bioruby" target="_blank">Bioruby</a> is a bioinformatics ruby package   for analysis of biological sequences. In my  quest to become a bioruby guru i  have decided to poke the bioruby API and all available tutorials to better understand this fantastic library written by the bioruby team of developers. My journey will be logged here as the bioruby mini series. We start with an introductory overview of the sequence class.</p>
<p>To use the library you need to have a ruby interpreter installed , preferably ruby 1.8.5 and above . To install bioruby as a gem, do:<br />
sudo gem install bio</p>
<p>This will install  Bioruby version 1.1.0 and it comes with its own shell as well.</p>
<p>Type bioruby on the command prompt  and you will see this:</p>
<p><font color="#0000ff"><br />
Loading config (/.bioruby/shell/session/config) &#8230; done<br />
Loading object (/.bioruby/shell/session/object) &#8230; done<br />
Loading history (/.bioruby/shell/session/history) &#8230; done</font></p>
<p><font color="#0000ff">. . . B i o R u b y   i n   t h e   s h e l l . . .</font></p>
<p><font color="#0000ff">Version : BioRuby 1.1.0 / Ruby 1.8.6</font></p>
<p><font color="#0000ff">bioruby&gt;</font></p>
<p>Now we ready to rock and roll! I dug in to the API and extracted some useful information for us.</p>
<p><u><b>The Bio::Sequence class</b></u></p>
<p>This is the primary  sequence class and  deals with sequence translation and transformations. It inherits from ruby&#8217;s string class which means that you can use ruby&#8217;s string methods with the Bio::Sequence class just like you would with a string.</p>
<p>The Bio::Sequence class object is a wrapper around the actual sequence and it is represented as either a Bio::Sequence::NA or a Bio::Sequence::AA.  and responds to all the methods that are defined for both NA and AA classes. This class has the following methods:</p>
<ul>
<li><b>auto</b> &#8211; This will guess the type of sequence provided and return the appropriate Bio:Sequence class for the given string, either a Bio::Sequence::AA or a Bio::Sequence::NA</li>
<li><b>new</b> &#8211; Creates a new Bio::Sequence object. It does not initialize the object in to any of the bioruby objects. It returns a string.</li>
</ul>
<ul>
<li><b>aa</b> &#8211; Will transform your current Bio::Sequence object to a Bio::Sequence::AA object. It will change your current object i.e it will transform a Bio::Sequence::NA to a Bio::Sequence::AA which is undesirable. So it needs to be used only when you are sure of the type of sequence you are working with.</li>
<li><b>na</b> &#8211; works the same as the aa method above but the returned object is a Bio::Sequence::NA</li>
<li><b>output</b> &#8211; It returns a string with the current Bio::Sequence object formatted with the given style. The supported styles are fasta, genbank and embl. The style argument is passed as a<a href="http://www.ruby-doc.org/core/classes/Symbol.html" title="defination of a ruby symbol" target="_blank"> ruby symbol</a> eg :fasta</li>
<li><b>to_s</b> &#8211; it returns the sequence as a string leaving the original sequence unaltered. The to_str is an alias for this method</li>
</ul>
<p><u><b>Bio::Sequence::NA class</b></u></p>
<p>This class wraps a nucleic acid sequence. It provides a number of methods to work with a DNA sequence as demonstrated in  the example below.</p>
<p>Dr Optimist has finally finished  his long awaited sequencing project code named Sikwensi. The  nucleic acid sequence for a chromosome for which he won&#8217;t reveal any further details is shown below.<br />
&#8220;gacagatggacatggactagagctgct&#8221;</p>
<p>He calls his trusted ruby programmer to help analyze the sequence and tear it base by base. The guy gets to work.</p>
<p><font color="#0000ff">require &#8216;bio&#8217;</font></p>
<p><font color="#0000ff">bio_seq = Bio::Sequence.auto( &#8216;gacagatggacatggactagagctgct&#8217;)  #=&gt; bio_seq is now  a Bio::Sequence::NA object<br />
</font></p>
<p><font color="#0000ff">#get the number of codons in the sequence</font></p>
<p><font color="#0000ff">bio_seq.window_search(3,3)  {|codon| puts codon}<br />
</font></p>
<p><font color="#0000ff"> # complemental sequence</font></p>
<p><font color="#0000ff">bio_seq.complement                 (Bio::Sequence::NA object)</font></p>
<p><font color="#0000ff"># gets subsequence of positions 4 to 14<br />
bio_seq.subseq(4,14)                           # he thinks the subsequence is interesting and worth </font><font color="#0000ff">extracting</font><font color="#0000ff">!</font></p>
<p><font color="#0000ff">bio_seq.gc_percent                            #what is the gc content?<br />
</font></p>
<p><font color="#0000ff">bio_seq.composition                                            # nucleic acid compositions (returns a Hash)</font></p>
<p><font color="#0000ff">bio_seq.translate                                                 # translation ( returns a Bio::Sequence::AA object)<br />
bio_seq.translate(2)                                         # translation from frame 2 (The default is frame 1)<br />
bio_seq.translate(1,11)                                  # using codon table No.11 (bacteria)<br />
bio_seq.translate.codes                                      # shows three-letter codes ( returns an Array)<br />
bio_seq.translate.names                                    # shows amino acid names (returns an Array)<br />
bio_seq.translate.composition                      # amino acid compositions (returns a Hash)<br />
bio_seq.translate.molecular_weight      # calculating molecular weight (returns Float)</font></p>
<p><font color="#0000ff">bio_seq.complement.translate                      # translation of complemental strand</font></p>
<p>A tutorial  written by Katayama Toshiaki can be <a href="http://wiki.bioruby.org/English/?Tutorial.rd" title="bioruby tutorial" target="_blank">found here  </a> and translated to English by Naohisa Goto. (Thank you guys!)</p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biorelated.wordpress.com/21/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biorelated.wordpress.com/21/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/21/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/21/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/21/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=21&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2007/11/23/bioruby-mini-series-the-sequence-class/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>
	</item>
		<item>
		<title>A Ruby algorithms resource</title>
		<link>http://biorelated.wordpress.com/2007/11/17/a-ruby-algorithms-resource/</link>
		<comments>http://biorelated.wordpress.com/2007/11/17/a-ruby-algorithms-resource/#comments</comments>
		<pubDate>Sat, 17 Nov 2007 08:50:20 +0000</pubDate>
		<dc:creator>biorelated</dc:creator>
				<category><![CDATA[algorithms]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://biorelated.wordpress.com/2007/11/17/a-ruby-algorithms-resource/</guid>
		<description><![CDATA[An algorithm is a procedure to accomplish a specific task. They solve general well specified problems and are the ideas behind computer programs.
Rubyquiz is an interesting repository for ruby programs  that implement queit interesting algorithms. Even though the programs may not  have anything to do with biology, some of the algorithms definitely do. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=19&subd=biorelated&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://biorelated.wordpress.com/2007/11/17/a-ruby-algorithms-resource/ruby-quiz-resource/" target="_blank" rel="attachment wp-att-20" title="Ruby quiz resource"><img src="http://biorelated.files.wordpress.com/2007/11/ruby_quiz_logo.thumbnail.jpg" alt="Ruby quiz resource" /></a>An algorithm is a procedure to accomplish a specific task. They solve general well specified problems and are the ideas behind computer programs.</p>
<p><a href="http://www.rubyquiz.com/index.html" title="Ruby Quiz" target="_blank">Rubyquiz</a> is an interesting repository for ruby programs  that implement queit interesting algorithms. Even though the programs may not  have anything to do with biology, some of the algorithms definitely do.  It is a good place to a find a start point for your ruby algorithm implementation. Browsing the different sets of problems can give a lot of insight on how to approach some common programming problems eg. writing an <a href="http://www.rubyquiz.com/quiz37.html" title="inference engine" target="_blank">inference engine</a>, <a href="http://www.rubyquiz.com/quiz74.html" title="hidden markov" target="_blank">a hidden markov</a> chain , <a href="http://www.rubyquiz.com/quiz103.html" target="_blank">dictionary matcher</a> etc</p>
<p>The site has about 147 quizzes as of this writing.  <a href="http://www.rubyquiz.com/index.html" title="Ruby Quiz" target="_blank">Take a look!</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/biorelated.wordpress.com/19/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/biorelated.wordpress.com/19/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/biorelated.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/biorelated.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/biorelated.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/biorelated.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/biorelated.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/biorelated.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/biorelated.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/biorelated.wordpress.com/19/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/biorelated.wordpress.com/19/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/biorelated.wordpress.com/19/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=biorelated.wordpress.com&blog=1167040&post=19&subd=biorelated&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://biorelated.wordpress.com/2007/11/17/a-ruby-algorithms-resource/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d9e14f1be0972ff1f393cc87dbd072e1?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">george_g</media:title>
		</media:content>

		<media:content url="http://biorelated.files.wordpress.com/2007/11/ruby_quiz_logo.thumbnail.jpg" medium="image">
			<media:title type="html">Ruby quiz resource</media:title>
		</media:content>
	</item>
	</channel>
</rss>