Package Bio :: Package SeqUtils :: Module CodonUsage :: Class CodonAdaptationIndex
[hide private]
[frames] | no frames]

Class CodonAdaptationIndex

source code

object --+
         |
        CodonAdaptationIndex

A codon adaptation index (CAI) implementation.

Implements the codon adaptation index (CAI) described by Sharp and Li (Nucleic Acids Res. 1987 Feb 11;15(3):1281-95).

NOTE - This implementation does not currently cope with alternative genetic codes: only the synonymous codons in the standard table are considered.

Instance Methods [hide private]
 
__init__(self)
x.__init__(...) initializes x; see x.__class__.__doc__ for signature
source code
 
set_cai_index(self, index)
Sets up an index to be used when calculating CAI for a gene.
source code
 
generate_index(self, fasta_file)
Generate a codon usage index from a FASTA file of CDS sequences.
source code
 
cai_for_gene(self, dna_sequence)
Calculate the CAI (float) for the provided DNA sequence (string).
source code
 
_count_codons(self, fasta_file) source code
 
print_index(self)
Prints out the index used.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 
x.__init__(...) initializes x; see x.__class__.__doc__ for signature

Overrides: object.__init__
(inherited documentation)

set_cai_index(self, index)

source code 

Sets up an index to be used when calculating CAI for a gene.

Just pass a dictionary similar to the SharpEcoliIndex in the CodonUsageIndices module.

generate_index(self, fasta_file)

source code 

Generate a codon usage index from a FASTA file of CDS sequences.

Takes a location of a Fasta file containing CDS sequences (which must all have a whole number of codons) and generates a codon usage index.

cai_for_gene(self, dna_sequence)

source code 

Calculate the CAI (float) for the provided DNA sequence (string).

This method uses the Index (either the one you set or the one you generated) and returns the CAI for the DNA sequence.