]> git.donarmstrong.com Git - biopieces.git/commitdiff
polished kmer_freq
authormartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 27 Sep 2012 13:08:48 +0000 (13:08 +0000)
committermartinahansen <martinahansen@74ccb610-7750-0410-82ae-013aeee3265d>
Thu, 27 Sep 2012 13:08:48 +0000 (13:08 +0000)
git-svn-id: http://biopieces.googlecode.com/svn/trunk@1949 74ccb610-7750-0410-82ae-013aeee3265d

bp_bin/kmer_freq

index 9f45cefe7d00db386ee0fc6c1945457f17092d69..cbe99a8d8e87b210e578b19ed55c24c99b8aff4b 100755 (executable)
@@ -1,6 +1,6 @@
 #!/usr/bin/env ruby
 
-# Copyright (C) 2007-2011 Martin A. Hansen.
+# Copyright (C) 2007-2012 Martin A. Hansen.
 
 # This program is free software; you can redistribute it and/or
 # modify it under the terms of the GNU General Public License
@@ -57,7 +57,8 @@ Biopieces.open(options[:stream_in], options[:stream_out]) do |input, output|
     record = {
       :REC_TYPE => "KMER_FREQ",
       :KMER     => kmer,
-      :COUNT    => count
+      :COUNT    => count,
+      :FREQ     => (count.to_f / kmer_hash.size).round(4)
     }
 
     output.puts record