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

# cogent.maths.stats.cai.util.cai_1

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

```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, \
```
```        ref_freqs_2.update({'UUU':2,'UUC':1})
gene_freqs = {'AGA':3,'AGG':1,'CCC':2,'CCA':1,'UUU':1, 'UUC':2}
obs = cai_1(ref_freqs_2, gene_freqs, average=arithmetic_mean)
vals = [.8,.8,.8,.4,1,1,.2,.4,.2,.2]
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_1(ref_freqs_2, gene_freqs, average=geometric_mean)
vals = [.8,.8,.8,.4,1,1,.2,.4,.2,.2]
expect = (product(vals))**(1./len(vals))
```

```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, \
```
```        ref_freqs_2.update({'UUU':2,'UUC':1})
gene_freqs = {'AGA':3,'AGG':1,'CCC':2,'CCA':1,'UUU':1, 'UUC':2}
obs = cai_1(ref_freqs_2, gene_freqs, average=arithmetic_mean)
vals = [.8,.8,.8,.4,1,1,.2,.4,.2,.2]
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_1(ref_freqs_2, gene_freqs, average=geometric_mean)
vals = [.8,.8,.8,.4,1,1,.2,.4,.2,.2]
expect = (product(vals))**(1./len(vals))
```