getCAI: Calculate the Codon Adaptation Index

Description Usage Arguments Value Examples

View source: R/genomeObject.R

Description

getCAI returns the Codon Adaptation Index for a genome based on a provided reference.

Usage

1
getCAI(referenceGenome, testGenome, default.weight = 0.5)

Arguments

referenceGenome

A genome object initialized with initializeGenomeObject. Serves as reference set to calculate the necessary codon weights.

testGenome

A genome object initialized with initializeGenomeObject. The genome for which the CAI is supposed to be calculated

default.weight

Default weight to use if codon is missing from referenceGenome

Value

Returns a named vector with the CAI for each gene

Examples

1
2
3
4
5
6
7
8
genome_file1 <- system.file("extdata", "more_genes.fasta", package = "AnaCoDa")
genome_file2 <- system.file("extdata", "genome.fasta", package = "AnaCoDa")

## reading genome
referenceGenome <- initializeGenomeObject(file = genome_file1)
testGenome <- initializeGenomeObject(file = genome_file2)

cai <- getCAI(referenceGenome, testGenome)

AnaCoDa documentation built on Jan. 8, 2021, 2:37 a.m.