]> git.donarmstrong.com Git - biopieces.git/commitdiff
added coverage method to prodigal.rb
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 9 May 2011 10:24:51 +0000 (10:24 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Mon, 9 May 2011 10:24:51 +0000 (10:24 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1384 74ccb610-7750-0410-82ae-013aeee3265d

code_ruby/Maasha/lib/prodigal.rb

index a6661ad5b6a8ccc827a573e70f289ad21b2651c6..1a1fd552af5311caf9f8b3ce1bd0187aa6b81007 100644 (file)
@@ -58,6 +58,17 @@ class Prodigal
     end
   end
 
+  # Method that returns the sum of the predicted gene lengths.
+  def coverage
+    coverage = 0
+
+    self.each do |gb|
+      coverage += gb[:S_END] - gb[:S_BEG]
+    end
+
+    coverage
+  end
+
   private
 
   # Method to execute commands on the command line.