Package Bio :: Package codonalign :: Module codonseq
[hide private]
[frames] | no frames]

Module codonseq

source code

Code for dealing with coding sequence.

CodonSeq class is inherited from Seq class. This is the core class to deal with sequences in CodonAlignment in biopython.

Classes [hide private]
  CodonSeq
CodonSeq is designed to be within the SeqRecords of a CodonAlignment class.
Functions [hide private]
 
_get_codon_list(codonseq)
List of codons according to full_rf_table for counting (PRIVATE).
source code
 
cal_dn_ds(codon_seq1, codon_seq2, method='NG86', codon_table=default_codon_table, k=1, cfreq=None)
Calculate dN and dS of the given two sequences.
source code
 
_ng86(seq1, seq2, k, codon_table)
NG86 method main function (PRIVATE).
source code
 
_count_site_NG86(codon_lst, k=1, codon_table=default_codon_table)
Count synonymous and non-synonymous sites of a list of codons (PRIVATE).
source code
 
_count_diff_NG86(codon1, codon2, codon_table=default_codon_table)
Count differences between two codons (three-letter string; PRIVATE).
source code
 
_lwl85(seq1, seq2, k, codon_table)
LWL85 method main function (PRIVATE).
source code
 
_get_codon_fold(codon_table)
Classify different position in a codon into different folds (PRIVATE).
source code
 
_diff_codon(codon1, codon2, fold_dict)
Count number of different substitution types between two codons (PRIVATE).
source code
 
_yn00(seq1, seq2, k, codon_table)
YN00 method main function (PRIVATE).
source code
 
_get_TV(codon_lst1, codon_lst2, codon_table=default_codon_table)
Get TV (PRIVATE).
source code
 
_get_kappa_t(pi, TV, t=False)
Calculate kappa (PRIVATE).
source code
 
_count_site_YN00(codon_lst1, codon_lst2, pi, k, codon_table=default_codon_table)
Site counting method from Ina / Yang and Nielsen (PRIVATE).
source code
 
_count_diff_YN00(codon1, codon2, P, codon_lst, codon_table=default_codon_table)
Count differences between two codons (three-letter string; PRIVATE).
source code
 
_ml(seq1, seq2, cmethod, codon_table)
ML method main function (PRIVATE).
source code
 
_get_pi(seq1, seq2, cmethod, codon_table=default_codon_table)
Obtain codon frequency dict (pi) from two codon list (PRIVATE).
source code
 
_q(i, j, pi, k, w, codon_table=default_codon_table)
Q matrix for codon substitution (PRIVATE).
source code
 
_get_Q(pi, k, w, codon_lst, codon_table)
Q matrix for codon substitution (PRIVATE).
source code
 
_likelihood_func(t, k, w, pi, codon_cnt, codon_lst, codon_table)
Likelihood function for ML method (PRIVATE).
source code
Variables [hide private]
  __package__ = 'Bio.codonalign'
Function Details [hide private]

cal_dn_ds(codon_seq1, codon_seq2, method='NG86', codon_table=default_codon_table, k=1, cfreq=None)

source code 

Calculate dN and dS of the given two sequences.

Available methods:
Arguments:
  • codon_seq1 - CodonSeq or or SeqRecord that contains a CodonSeq
  • codon_seq2 - CodonSeq or or SeqRecord that contains a CodonSeq
  • w - transition/transversion ratio
  • cfreq - Current codon frequency vector can only be specified when you are using ML method. Possible ways of getting cfreq are: F1x4, F3x4 and F61.

_count_site_NG86(codon_lst, k=1, codon_table=default_codon_table)

source code 

Count synonymous and non-synonymous sites of a list of codons (PRIVATE).

Arguments:
  • codon_lst - A three letter codon list from a CodonSeq object. This can be returned from _get_codon_list method.
  • k - transition/transversion rate ratio.

_count_diff_NG86(codon1, codon2, codon_table=default_codon_table)

source code 

Count differences between two codons (three-letter string; PRIVATE).

The function will take multiple pathways from codon1 to codon2 into account.

_lwl85(seq1, seq2, k, codon_table)

source code 

LWL85 method main function (PRIVATE).

Nomenclature is according to Li et al. (1985), PMID 3916709.

_diff_codon(codon1, codon2, fold_dict)

source code 

Count number of different substitution types between two codons (PRIVATE).

returns tuple (P0, P2, P4, Q0, Q2, Q4)

Nomenclature is according to Li et al. (1958), PMID 3916709.

_yn00(seq1, seq2, k, codon_table)

source code 

YN00 method main function (PRIVATE).

Nomenclature is according to Yang and Nielsen (2000), PMID 10666704.

_get_TV(codon_lst1, codon_lst2, codon_table=default_codon_table)

source code 

Get TV (PRIVATE).

Arguments:
  • T - proportions of transitional differences
  • V - proportions of transversional differences

_get_kappa_t(pi, TV, t=False)

source code 

Calculate kappa (PRIVATE).

The following formula and variable names are according to PMID: 10666704

_count_site_YN00(codon_lst1, codon_lst2, pi, k, codon_table=default_codon_table)

source code 

Site counting method from Ina / Yang and Nielsen (PRIVATE).

Method from Ina (1995) as modified by Yang and Nielsen (2000). This will return the total number of synonymous and nonsynonymous sites and base frequencies in each category. The function is equivalent to the CountSites() function in yn00.c of PAML.

_count_diff_YN00(codon1, codon2, P, codon_lst, codon_table=default_codon_table)

source code 

Count differences between two codons (three-letter string; PRIVATE).

The function will weighted multiple pathways from codon1 to codon2 according to P matrix of codon substitution. The proportion of transition and transversion (TV) will also be calculated in the function.

_get_pi(seq1, seq2, cmethod, codon_table=default_codon_table)

source code 

Obtain codon frequency dict (pi) from two codon list (PRIVATE).

This function is designed for ML method. Available counting methods (cfreq) are F1x4, F3x4 and F64.

_q(i, j, pi, k, w, codon_table=default_codon_table)

source code 

Q matrix for codon substitution (PRIVATE).

Arguments:
  • i, j : three letter codon string
  • pi : expected codon frequency
  • k : transition/transversion ratio
  • w : nonsynonymous/synonymous rate ratio
  • codon_table: Bio.Data.CodonTable object