Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(6)  |  Call(4)  |  Derive(0)  |  Import(2)

src/c/o/cogent-1.5.3/tests/test_maths/test_stats/test_cai/test_util.py   cogent(Download)
from math import log, exp
from operator import mul
from cogent.maths.stats.cai.util import cu, as_rna, synonyms_to_rna, \
    get_synonyms, sum_codon_freqs, norm_to_max, arithmetic_mean, \
    geometric_mean, codon_adaptiveness_all, codon_adaptiveness_blocks, \
        ref_freqs_2.update({'UUU':2,'UUC':1})
        gene_freqs = {'AGA':3,'AGG':1,'CCC':2,'CCA':1,'UUU':1, 'UUC':2}
        obs = cai_2(ref_freqs_2, gene_freqs, average=arithmetic_mean)
        vals = [1,1,1,.5,1,1,.2,1,.5,.5]
        expect = sum(vals)/len(vals)
        ref_freqs_2.update({'UUU':2,'UUC':1})
        gene_freqs = {'AGA':3,'AGG':1,'CCC':2,'CCA':1,'UUU':1, 'UUC':2}
        obs = cai_2(ref_freqs_2, gene_freqs, average=geometric_mean)
        vals = [1,1,1,.5,1,1,.2,1,.5,.5]
        expect = (product(vals))**(1./len(vals))

src/p/y/pycogent-HEAD/tests/test_maths/test_stats/test_cai/test_util.py   pycogent(Download)
from math import log, exp
from operator import mul
from cogent.maths.stats.cai.util import cu, as_rna, synonyms_to_rna, \
    get_synonyms, sum_codon_freqs, norm_to_max, arithmetic_mean, \
    geometric_mean, codon_adaptiveness_all, codon_adaptiveness_blocks, \
        ref_freqs_2.update({'UUU':2,'UUC':1})
        gene_freqs = {'AGA':3,'AGG':1,'CCC':2,'CCA':1,'UUU':1, 'UUC':2}
        obs = cai_2(ref_freqs_2, gene_freqs, average=arithmetic_mean)
        vals = [1,1,1,.5,1,1,.2,1,.5,.5]
        expect = sum(vals)/len(vals)
        ref_freqs_2.update({'UUU':2,'UUC':1})
        gene_freqs = {'AGA':3,'AGG':1,'CCC':2,'CCA':1,'UUU':1, 'UUC':2}
        obs = cai_2(ref_freqs_2, gene_freqs, average=geometric_mean)
        vals = [1,1,1,.5,1,1,.2,1,.5,.5]
        expect = (product(vals))**(1./len(vals))