Bio.Align.analysis module

Code for performing calculations on codon alignments.

Bio.Align.analysis.calculate_dn_ds(alignment, method='NG86', codon_table=None, k=1, cfreq=None)

Calculate dN and dS of the given two sequences.

Available methods:
Arguments:
  • k - transition/transversion rate 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.

Bio.Align.analysis.calculate_dn_ds_matrix(alignment, method='NG86', codon_table=None)

Calculate dN and dS pairwise for the multiple alignment, and return as matrices.

Argument:
  • method - Available methods include NG86, LWL85, YN00 and ML.

  • codon_table - Codon table to use for forward translation.

Bio.Align.analysis.mktest(alignment, species=None, codon_table=None)

McDonald-Kreitman test for neutrality.

Implement the McDonald-Kreitman test for neutrality (PMID: 1904993) This method counts changes rather than sites (http://mkt.uab.es/mkt/help_mkt.asp).

Arguments:
  • alignment - Alignment of gene nucleotide sequences to compare.

  • species - List of the species ID for each sequence in the alignment. Typically, the species ID is the species name as a string, or an integer.

  • codon_table - Codon table to use for forward translation.

Return the p-value of test result.