From: martinahansen Date: Thu, 27 Sep 2012 13:08:48 +0000 (+0000) Subject: polished kmer_freq X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=f6f94938e4eef7c36f12b28456f783bb06a172c5;p=biopieces.git polished kmer_freq git-svn-id: http://biopieces.googlecode.com/svn/trunk@1949 74ccb610-7750-0410-82ae-013aeee3265d --- diff --git a/bp_bin/kmer_freq b/bp_bin/kmer_freq index 9f45cef..cbe99a8 100755 --- a/bp_bin/kmer_freq +++ b/bp_bin/kmer_freq @@ -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