Module Expr Str Import alias TryExcept body ImportFrom alias ImportFrom alias Import alias handlers ExceptHandler type NameLoad body Pass ImportFrom alias identifier FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore ListLoad For NameStore Call NameLoad Num Num body If CompareNotEq SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad body Expr Call AttributeLoad NameLoad attr TupleLoad NameLoad SubscriptLoad NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad If CompareNotEq Call NameLoad NameLoad Num body Return TupleLoad NameLoad NameLoad NameLoad Assign NameStore TupleLoad SubscriptLoad SubscriptLoad NameLoad Index Num Index Num SubscriptLoad SubscriptLoad NameLoad Index Num Index Num Assign NameStore CompareEq SubscriptLoad AttributeLoad NameLoad attr Index NameLoad SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign NameStore CompareIn NameLoad TupleLoad TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str TupleLoad Str Str Return TupleLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign TupleStore NameStore NameStore NameStore NameStore TupleLoad Num Num Num Num Assign NameStore AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore NameLoad body For NameStore NameLoad body If CompareEq NameLoad NameLoad body Continue Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad Assign NameStore BinOpMult SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad If NameLoad body AugAssignAdd NameStore NameLoad orelse AugAssignAdd NameStore NameLoad If NameLoad body AugAssignAdd NameStore NameLoad orelse AugAssignAdd NameStore NameLoad Return TupleLoad NameLoad NameLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign NameStore Dict For NameStore NameLoad body Assign SubscriptStore NameLoad Index NameLoad Dict For NameStore NameLoad body Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad Num Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad AttributeLoad AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr attr attr Assign NameStore Call NameLoad NameLoad Assign NameStore Num For NameStore NameLoad body Assign NameStore Num For NameStore NameLoad body If CompareEq NameLoad NameLoad body Continue Assign TupleStore NameStore NameStore NameStore Call NameLoad NameLoad NameLoad If UnaryOpNot NameLoad body Continue If NameLoad body If NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad orelse If NameLoad body Assign NameStore NameLoad orelse Assign NameStore NameLoad AugAssignMult NameStore SubscriptLoad NameLoad Index NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad AugAssignAdd NameStore NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad UnaryOpUSub NameLoad AugAssignAdd NameStore BinOpMult SubscriptLoad NameLoad Index NameLoad NameLoad For NameStore NameLoad body For NameStore NameLoad body AugAssignDiv SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults NameLoad body Expr Str If NameLoad body Assign NameStore TupleLoad NameLoad orelse Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr Assign TupleStore NameStore NameStore TupleLoad Dict Dict For NameStore NameLoad body Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign SubscriptStore NameLoad Index Call AttributeLoad Call AttributeLoad Str attr NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr Index NameLoad Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad NameLoad attr body Assign NameStore Dict For TupleStore NameStore NameStore Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr body Assign SubscriptStore NameLoad Index Call AttributeLoad Call AttributeLoad Str attr NameLoad attr NameLoad Assign SubscriptStore NameLoad Index Call AttributeLoad Call AttributeLoad Str attr NameLoad attr NameLoad If NameLoad body Return TupleLoad NameLoad NameLoad orelse Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults Str body Expr Str TryExcept body Assign NameStore Call AttributeLoad NameLoad attr ListComp AttributeLoad NameLoad attr comprehension NameStore Call AttributeLoad NameLoad attr handlers ExceptHandler type AttributeLoad AttributeLoad NameLoad attr attr body Return Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr For NameStore Call NameLoad Num Num body Assign NameStore ListLoad For NameStore TupleLoad Str Str Str Str body Expr Call AttributeLoad NameLoad attr TupleLoad BinOpMod Str TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Expr Call AttributeLoad NameLoad attr NameLoad Expr Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad keyword NameLoad decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call NameLoad NameLoad Assign NameStore Num For NameStore NameLoad body Assign NameStore Num For NameStore NameLoad body If CompareEq NameLoad NameLoad body Continue Assign NameStore BinOpMult SubscriptLoad NameLoad Index NameLoad SubscriptLoad SubscriptLoad NameLoad Index NameLoad Index NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad AugAssignAdd NameStore NameLoad Assign SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad UnaryOpUSub NameLoad AugAssignAdd NameStore NameLoad For NameStore NameLoad body For NameStore NameLoad body AugAssignDiv SubscriptStore SubscriptLoad NameLoad Index NameLoad Index NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list
N/A N/A 
RateEstimation.py - utilities for computing rate estimates for codon models.
=============================================================================

:Author: 
:Release: $Id$
:Date: |today|
:Tags: Python

 N/A Bio.Data.CodonTable N/A N/A XGram.Generator.Prebuilt Codons XGram.Model Annotation N/A XGram.Exceptions N/A N/A N/A ImportError N/A N/A CGAT Genomics Genomics evaluateCodonPair N/A N/A codon1 codon2 N/A N/A N/A evaluate differences between codon pair. N/A codon_table N/A N/A N/A Bio Data CodonTable standard_dna_table N/A changes N/A N/A x N/A range 0 3 N/A N/A N/A N/A codon1 N/A x N/A codon2 N/A x N/A N/A N/A N/A changes append N/A x N/A codon1 N/A x N/A codon2 N/A x N/A N/A N/A len changes 1 N/A N/A N/A False False False N/A change N/A N/A N/A changes N/A 0 N/A 1 N/A N/A changes N/A 0 N/A 2 N/A is_synonymous N/A N/A N/A codon_table forward_table N/A codon1 N/A N/A codon_table forward_table N/A codon2 N/A is_transition N/A change N/A N/A A G N/A G A N/A T C N/A C T N/A N/A True is_synonymous is_transition N/A countSubstitutions N/A N/A pi Q N/A N/A N/A count substitituions given a matrix Q and frequencies pi. N/A N/A rI rV rS rN N/A 0 0 0 0 N/A codon_table N/A N/A N/A Bio Data CodonTable standard_dna_table N/A codons N/A N/A N/A codon_table forward_table keys N/A codon_i codons N/A N/A codon_j codons N/A N/A N/A codon_i codon_j N/A N/A N/A N/A is_single is_synonymous is_transition N/A evaluateCodonPair codon_i codon_j N/A v N/A N/A N/A Q N/A codon_i N/A codon_j N/A pi N/A codon_i N/A is_transition N/A N/A rI v N/A N/A rV v N/A is_synonymous N/A N/A rS v N/A N/A rN v N/A N/A rI rV rS rN N/A initializeQMatrix N/A N/A codons N/A N/A N/A get an initialized Q matrix. N/A Q N/A N/A codon_i codons N/A N/A N/A Q N/A codon_i N/A N/A codon_j codons N/A N/A N/A N/A Q N/A codon_i N/A codon_j 0.0 N/A Q N/A getQMatrix N/A N/A pi Rsi Rsv Rni Rnv N/A N/A N/A build a q matrix.

    Diagonal elements are set to the negative of the row sums.
    The matrix is normalized such that trace of the matrix is -1.
     N/A codons N/A N/A N/A N/A N/A N/A Bio Data CodonTable standard_dna_table forward_table keys N/A Q N/A initializeQMatrix codons N/A trace 0.0 N/A codon_i codons N/A N/A row_sum 0.0 N/A codon_j codons N/A N/A N/A codon_i codon_j N/A N/A N/A N/A is_single is_synonymous is_transition N/A evaluateCodonPair codon_i codon_j N/A N/A is_single N/A N/A N/A is_synonymous N/A N/A is_transition N/A N/A v Rsi N/A N/A v Rsv N/A N/A is_transition N/A N/A v Rni N/A N/A v Rnv N/A v N/A pi N/A codon_j N/A N/A N/A Q N/A codon_i N/A codon_j v N/A row_sum v N/A N/A N/A Q N/A codon_i N/A codon_i N/A row_sum N/A trace N/A N/A pi N/A codon_i row_sum N/A codon_i codons N/A N/A codon_j codons N/A N/A N/A N/A Q N/A codon_i N/A codon_j trace N/A N/A Q trace N/A getRateMatrix N/A N/A trained_model terminals N/A None N/A N/A return a rate matrix from an xrate grammar.

    terminals: return rate matrix and frequencies for these
        terminals. If none are given, a dictionaries of
        matrices and frequencies are returned.


     N/A terminals N/A N/A xt N/A terminals N/A N/A xt N/A N/A N/A trained_model mGrammar getTerminals N/A N/A pis matrices N/A N/A N/A N/A tt xt N/A N/A xpi N/A N/A N/A trained_model evaluateTerminalFrequencies N/A tt N/A pi N/A N/A N/A codon f N/A N/A xpi items N/A N/A N/A pi N/A N/A N/A N/A N/A join codon upper f N/A xmatrix N/A N/A N/A trained_model evaluateRateMatrix N/A tt N/A matrix N/A N/A N/A codon1 v N/A N/A xmatrix items N/A N/A x N/A N/A N/A codon2 f N/A N/A N/A xmatrix N/A codon1 items N/A N/A N/A x N/A N/A N/A N/A N/A join codon2 upper v N/A N/A matrix N/A N/A N/A N/A N/A join codon1 upper x N/A terminals N/A N/A N/A pi matrix N/A N/A N/A pis N/A tt pi N/A N/A matrices N/A tt matrix N/A N/A pis matrices N/A setFrequencies N/A N/A model mali prefix N/A N/A N/A set frequencies in a model according to those observed in data.

    prefix: prefix for rate parameters. 

    Frequencies are labelled:
    pa0, pc0, ..., pa1, pc1, ..., pa2, pc2, ...
     N/A N/A N/A frequencies N/A N/A Codons getFrequenciesPerCodonPosition N/A N/A x mString N/A x N/A N/A mali values N/A N/A N/A N/A N/A XGram Exceptions UsageError N/A N/A N/A dummy_grammar N/A N/A N/A XGram Model Grammar N/A x N/A range 0 3 N/A N/A params N/A N/A a N/A A C G T N/A N/A N/A N/A params append N/A N/A %sp%s%i N/A prefix N/A N/A a lower x N/A N/A frequencies N/A x N/A a N/A N/A N/A dummy_grammar addVariable params N/A N/A N/A N/A model mGrammar copyParameters dummy_grammar ignore_missing True N/A getDistanceGTR N/A N/A pi matrix N/A N/A N/A obtain distance from a GTR model.
    see Felsenstein 1994, pp 209
     N/A alphabet N/A N/A pi keys N/A Q N/A initializeQMatrix alphabet N/A trace 0 N/A i alphabet N/A N/A row_sum 0 N/A j alphabet N/A N/A N/A i j N/A N/A N/A v N/A N/A pi N/A i N/A N/A matrix N/A i N/A j N/A N/A N/A Q N/A i N/A j v N/A row_sum v N/A N/A N/A Q N/A i N/A i N/A row_sum N/A trace row_sum N/A i alphabet N/A N/A j alphabet N/A N/A N/A N/A Q N/A i N/A j trace N/A N/A Q trace N/A