]> git.donarmstrong.com Git - biopieces.git/blobdiff - bp_bin/kmer_freq
refactoring of assemble_pairs
[biopieces.git] / 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