Make codon usage data.frame
codonUsage2df(file, ...)
file | path to the codon usage file |
---|
data.frame containing codon usage data, with colnames
codon
, frequency
, and count
.
This function imports a text file containing codon usage, and
creates a data.frame with columns containing the codon
,
fraction
, and count
. The colname fraction
represents
the fraction observed counts per codon
compared to the codon with the highest counts, for each
amino acid. For example, an amino acid with only one codon
would be c(1.0)
. An amino acid with two codons, with observed
counts c(100, 200)
, would have fraction values c(0.5, 1.0)
.
The format is derived from published files, one example is
included in the package extdata/Mouse_codon_usage.txt
,
which can be accessed using the command:
system.file("extdata", "Mouse_codon_usage.txt", package="farrisdata")
codonFile <- system.file("extdata", "Mouse_codon_usage.txt", package="splicejam"); codonDF <- codonUsage2df(codonFile);