Class CodonAdaptationIndex
source code
object --+
|
CodonAdaptationIndex
A codon adaptaion index (CAI) implementation.
This class implements the codon adaptaion index (CAI) described by
Sharp and Li (Nucleic Acids Res. 1987 Feb 11;15(3):1281-95).
methods:
set_cai_index(Index):
This method sets-up an index to be used when calculating CAI for a
gene. Just pass a dictionary similar to the SharpEcoliIndex in
CodonUsageIndices module.
generate_index(FastaFile):
This method takes a location of a FastaFile and generates an index.
This index can later be used to calculate CAI of a gene.
cai_for_gene(DNAsequence):
This method uses the Index (either the one you set or the one you
generated) and returns the CAI for the DNA sequence.
print_index(): This method prints out the index you used.
NOTE - This implementation does not currently cope with alternative
genetic codes, only the synonymous codons in the standard table are
considered.
|
|
|
|
|
|
|
|
|
|
|
print_index(self)
This method prints out the index you used. |
source code
|
|
Inherited from object :
__delattr__ ,
__format__ ,
__getattribute__ ,
__hash__ ,
__new__ ,
__reduce__ ,
__reduce_ex__ ,
__repr__ ,
__setattr__ ,
__sizeof__ ,
__str__ ,
__subclasshook__
|
Inherited from object :
__class__
|
x.__init__(...) initializes x; see help(type(x)) for signature
- Overrides:
object.__init__
- (inherited documentation)
|
Generate a codon usage index from a FASTA file of CDS sequences.
This method 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. This index can later be used to calculate CAI of a gene.
|
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.
|