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

# cogent.maths.stats.util.Freqs.normalize

All Samples(12)  |  Call(12)  |  Derive(0)  |  Import(0)

```    for C,P in char_prob:
alts = Freqs([(c, p) for c, p in char_prob if c!=C])
alts.normalize()
alts = Freqs([(c,w/(2*n)) for c,w in alts.items()])
weights += [(C, alts)]
```

```    for C,P in char_prob:
alts = Freqs([(c, p) for c, p in char_prob if c!=C])
alts.normalize()
alts = Freqs([(c,w/(2*n)) for c,w in alts.items()])
weights += [(C, alts)]
```

```            })
#frequencies should sum to 1 for MAGE display.
known_bases.normalize()
#Only append label field if there is one.
label = self.Label or ''
```
```                raise e
super(PairFrequency, self).__init__(pair_freqs, pairs)
self.normalize()

class BasePairFrequency(PairFrequency):
```
```                    allowed_bases = IUPAC_RNA[b]
composition = Freqs(dict([(i,freqs[i]) for i in allowed_bases]))
composition.normalize()
result.append(composition.choice(random()))
self.Current[:] = ''.join(result)
```

```            })
#frequencies should sum to 1 for MAGE display.
known_bases.normalize()
#Only append label field if there is one.
label = self.Label or ''
```
```                raise e
super(PairFrequency, self).__init__(pair_freqs, pairs)
self.normalize()

class BasePairFrequency(PairFrequency):
```
```                    allowed_bases = IUPAC_RNA[b]
composition = Freqs(dict([(i,freqs[i]) for i in allowed_bases]))
composition.normalize()
result.append(composition.choice(random()))
self.Current[:] = ''.join(result)
```

```        result = {}
normalized = Freqs(self)
normalized.normalize()
for aa, aa_freq in normalized.items():
curr_codons = [c.upper().replace('T','U') for c in genetic_code[aa]]
```

```        result = {}
normalized = Freqs(self)
normalized.normalize()
for aa, aa_freq in normalized.items():
curr_codons = [c.upper().replace('T','U') for c in genetic_code[aa]]
```

```    relevant = Freqs({'A':freqs.get('A',0), 'C':freqs.get('C',0),
'G':freqs.get('G',0), 'U':freqs.get('U',0) or  freqs.get('T',0)})
relevant.normalize()
return MagePoint((relevant['A'],relevant['C'],relevant['G']), Label=label,\
```    relevant = Freqs({'A':freqs.get('A',0), 'C':freqs.get('C',0),