Mercurial > repos > iuc > ngsutils_bam_filter
diff ngsutils/support/llh.py @ 2:7a68005de299 draft
planemo upload for repository https://github.com/galaxyproject/tools-iuc/tree/master/tools/ngsutils commit 9a243c616a4a3156347e38fdb5f35863ae5133f9
author | iuc |
---|---|
date | Sun, 27 Nov 2016 15:01:21 -0500 |
parents | 4e4e4093d65d |
children |
line wrap: on
line diff
--- a/ngsutils/support/llh.py Sun Dec 06 05:03:12 2015 -0500 +++ b/ngsutils/support/llh.py Sun Nov 27 15:01:21 2016 -0500 @@ -1,14 +1,16 @@ ''' Methods for calculating log-likelihoods for nucleotide frequencies ''' +import collections import math -import collections + from ngsutils.support import memoize _default_background = {'A': 0.3, 'T': 0.3, 'C': 0.2, 'G': 0.2} NucleotideLogLikelihood = collections.namedtuple('NucleotideLogLikelihood', 'A C G T pseudo') + @memoize def pseudo_count(N, bg): ''' @@ -49,7 +51,6 @@ return NucleotideLogLikelihood(math.log(freqA / bg['A']), math.log(freqC / bg['C']), math.log(freqG / bg['G']), math.log(freqT / bg['T']), pseudo) - if __name__ == '__main__': import doctest doctest.testmod()