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

All Samples(114)  |  Call(78)  |  Derive(8)  |  Import(28)

src/c/o/cogent-1.5.3/cogent/core/usage.py   cogent(Download)
#!/usr/bin/env python
"""Classes for dealing with base, codon, and amino acid usage.
"""
from __future__ import division
from cogent.maths.stats.util import Freqs, Numbers, UnsafeFreqs
Codons = RnaCodons      #by default
 
_equal_bases = Freqs(Bases)
_equal_codons = Freqs(Codons)
_equal_amino_acids = Freqs(AminoAcids[:-1])     #exclude Stop
class InfoFreqs(Freqs, Delegator):
    """Like Freqs, but has an Info object storing additional data.
 
    Intended for holding base or codon frequencies that come from a 
    particular sequence, so that the Info of the sequence can be preserved

src/p/y/pycogent-HEAD/cogent/core/usage.py   pycogent(Download)
#!/usr/bin/env python
"""Classes for dealing with base, codon, and amino acid usage.
"""
from __future__ import division
from cogent.maths.stats.util import Freqs, Numbers, UnsafeFreqs
Codons = RnaCodons      #by default
 
_equal_bases = Freqs(Bases)
_equal_codons = Freqs(Codons)
_equal_amino_acids = Freqs(AminoAcids[:-1])     #exclude Stop
class InfoFreqs(Freqs, Delegator):
    """Like Freqs, but has an Info object storing additional data.
 
    Intended for holding base or codon frequencies that come from a 
    particular sequence, so that the Info of the sequence can be preserved

src/c/o/cogent-1.5.3/cogent/evolve/coevolution.py   cogent(Download)
from random import shuffle
from cogent.util.misc import parse_command_line_parameters
from cogent.maths.stats.util import Freqs
from cogent.util.array import norm
from cogent.core.sequence import Sequence
    weights = []
    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()])
    # between the original and selected alternate, calculating the new mi
 
    pair_freqs = Freqs(seqs)
    weights1 = dict(weights1)
    weights2 = dict(weights2)
    excludes = excludes or []
    num = len(seqs)
    col1 = Freqs(col1)
    col2 = Freqs(col2)
    seq_freqs = Freqs(seqs)

src/p/y/pycogent-HEAD/cogent/evolve/coevolution.py   pycogent(Download)
from random import shuffle
from cogent.util.misc import parse_command_line_parameters
from cogent.maths.stats.util import Freqs
from cogent.util.array import norm
from cogent.core.sequence import Sequence
    weights = []
    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()])
    # between the original and selected alternate, calculating the new mi
 
    pair_freqs = Freqs(seqs)
    weights1 = dict(weights1)
    weights2 = dict(weights2)
    excludes = excludes or []
    num = len(seqs)
    col1 = Freqs(col1)
    col2 = Freqs(col2)
    seq_freqs = Freqs(seqs)

src/c/o/cogent-1.5.3/cogent/seqsim/sequence_generators.py   cogent(Download)
from sys import path
from random import choice, random, shuffle, randrange
from cogent.maths.stats.util import Freqs
from cogent.struct.rna2d import ViennaStructure
from cogent.app.vienna_package import RNAfold
    def _transform(self, value):
        """Override superclass transform to yield Freqs.
        """
        return Freqs(dict(zip(self.Alphabet, value)))
 
    def __str__(self):
        """Returns the frequency string, suitable for MAGE."""
        pieces = []
        freqs = self.Freqs
        known_bases = Freqs({
class BaseFrequency(Freqs):
    RNA = ['U', 'C', 'A', 'G']
    DNA = ['T', 'C', 'A', 'G']
 
    """Holds information about base frequencies."""
class PairFrequency(Freqs):
    """Makes a frequency distribution of pairs from freqs of single items."""
 
    def __init__(self, freqs, pairs=None):
        """Makes pair frequency distribution.

src/p/y/pycogent-HEAD/cogent/seqsim/sequence_generators.py   pycogent(Download)
from sys import path
from random import choice, random, shuffle, randrange
from cogent.maths.stats.util import Freqs
from cogent.struct.rna2d import ViennaStructure
from cogent.app.vienna_package import RNAfold
    def _transform(self, value):
        """Override superclass transform to yield Freqs.
        """
        return Freqs(dict(zip(self.Alphabet, value)))
 
    def __str__(self):
        """Returns the frequency string, suitable for MAGE."""
        pieces = []
        freqs = self.Freqs
        known_bases = Freqs({
class BaseFrequency(Freqs):
    RNA = ['U', 'C', 'A', 'G']
    DNA = ['T', 'C', 'A', 'G']
 
    """Holds information about base frequencies."""
class PairFrequency(Freqs):
    """Makes a frequency distribution of pairs from freqs of single items."""
 
    def __init__(self, freqs, pairs=None):
        """Makes pair frequency distribution.

src/c/o/cogent-1.5.3/cogent/util/transform.py   cogent(Download)
from numpy import logical_and, logical_or, logical_not
from string import maketrans
from cogent.maths.stats.util import Freqs
from cogent.util.misc import identity, select
 
        else:
            used_s = s
        fd = Freqs(used_s)
        value_list = [fd[i] for i in fd if i in used_items]
        if value_list:
        else:
            used_s = s
        fd = Freqs(used_s)
        value_list = [fd[i] for i in fd if i not in used_items]
        if value_list:

src/p/y/pycogent-HEAD/cogent/util/transform.py   pycogent(Download)
from numpy import logical_and, logical_or, logical_not
from string import maketrans
from cogent.maths.stats.util import Freqs
from cogent.util.misc import identity, select
 
        else:
            used_s = s
        fd = Freqs(used_s)
        value_list = [fd[i] for i in fd if i in used_items]
        if value_list:
        else:
            used_s = s
        fd = Freqs(used_s)
        value_list = [fd[i] for i in fd if i not in used_items]
        if value_list:

src/c/o/cogent-1.5.3/cogent/format/mage.py   cogent(Download)
from copy import deepcopy
from cogent.util.misc import extract_delimited
from cogent.maths.stats.util import Freqs
from cogent.maths.stats.special import fix_rounding_error
 
            radius = None
 
    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()

src/c/o/cogent-1.5.3/cogent/core/alignment.py   cogent(Download)
from cogent.core.info import Info as InfoClass
from cogent.core.sequence import frac_same, ModelSequence
from cogent.maths.stats.util import Freqs
from cogent.format.fasta import fasta_from_alignment
from cogent.format.phylip import phylip_from_alignment
    def scoreMatrix(self):
        """Returns a position specific score matrix for the alignment."""
        return Dict2D(dict([(i,Freqs(col)) for i, col in enumerate(self.Positions)]))
 
    def _get_freqs(self, index=None):

  1 | 2 | 3  Next