<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,15 +1,17 @@
 require 'rubygems'
 require 'statarray'
 
-class Gene &lt; DataMapper::Base
+class Gene
+  include DataMapper::Resource
 
   # Each of these defines a accessor method for the class
   # and each also corresponds to a column in the database
-  property :name,      :string
-  property :sequence,  :text
+  property :id,       Integer, :serial =&gt; true
+  property :name,     String
+  property :sequence, Text
 
   # Checks that the sequence has a start codon, a stop codon, and contains only ATGC
-  validates_format_of :sequence, :with =&gt; /^ATG[ATGC\n]+(TAG|TAA|TGA)$/im
+  validates_format :sequence, :with =&gt; /^ATG[ATGC\n]+(TAG|TAA|TGA)$/im
 
   def self.create_from_flatfile(entry)
 
@@ -27,17 +29,15 @@ class Gene &lt; DataMapper::Base
   end
 
   def self.mean_length
-    genes = Gene.find(:all)
-    genes.map{|gene| gene.sequence.length}.to_statarray.mean
+    Gene.all.map{|gene| gene.sequence.length}.to_statarray.mean
   end
 
   def self.sd_length
-    genes = Gene.find(:all)
-    genes.map{|gene| gene.sequence.length}.to_statarray.stddev
+    Gene.all.map{|gene| gene.sequence.length}.to_statarray.stddev
   end
 
   def self.bin_sequence_length(n_bins)
-    lengths = Gene.find(:all).map{|gene| gene.sequence.length}
+    lengths = Gene.all.map{|gene| gene.sequence.length}
     min = lengths.min
     max = lengths.max
     bin_size = (max - min) / n_bins</diff>
      <filename>models/gene.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>47bfcfb397190e69caf3da26be03327edd4967e7</id>
    </parent>
  </parents>
  <author>
    <name>Michael Barton</name>
    <email>mail@michaelbarton.me.uk</email>
  </author>
  <url>http://github.com/michaelbarton/organised_experiments/commit/d24cba1736eee9f5cdfe400eb16d83fba59d440f</url>
  <id>d24cba1736eee9f5cdfe400eb16d83fba59d440f</id>
  <committed-date>2008-07-25T10:11:31-07:00</committed-date>
  <authored-date>2008-07-25T10:11:31-07:00</authored-date>
  <message>Updated gene model for new DataMapper compatability.</message>
  <tree>3f3f31caef00d69e96423b8f64bc1dd7b75b105d</tree>
  <committer>
    <name>Michael Barton</name>
    <email>mail@michaelbarton.me.uk</email>
  </committer>
</commit>
