Learn R Programming

⚠️There's a newer version (0.1.4.4) of this package.Take me there.

AnaCoDa

  • AnaCoDa is a collection of codon models.
  • the release version can be obtained from ...

Examples: Running models

Example 1: Using codon data in the form of CDS in fasta format with one mixture (ROC)

The following example illustrates how you would estimates parameters under the ROC model of a given set of protein coding genes, assuming the same mutation and selection regime for all genes.

genome <- initializeGenomeObject(file = "genome.fasta")
parameter <- initializeParameterObject(genome = genome, sphi = 1, num.mixtures = 1, geneAssignment = rep(1, length(genome)))
mcmc <- initializeMCMCObject(samples = 5000, thinning = 10, adaptive.width=50)
model <- initializeModelObject(parameter = parameter, model = "ROC")
runMCMC(mcmc = mcmc, genome = genome, model = model)

Example 2: Using codon data in the form of CDS in fasta format with one mixture (FONSE)

The following example illustrates how you would estimates parameters under the FONSE model of a given set of protein coding genes, assuming the same mutation and selection regime for all genes.

genome <- initializeGenomeObject(file = "genome.fasta")
parameter <- initializeParameterObject(genome = genome, sphi = 1, num.mixtures = 1, geneAssignment = rep(1, length(genome)))
mcmc <- initializeMCMCObject(samples = 5000, thinning = 10, adaptive.width=50)
model <- initializeModelObject(parameter = parameter, model = "FONSE")
runMCMC(mcmc = mcmc, genome = genome, model = model)

Example 3: Using codon data in the form of Ribosome footprints with one mixture (PA)

The following example illustrates how you would estimates parameters under the PA model of a given set of protein coding genes, assuming the same mutation and selection regime for all genes.

genome <- initializeGenomeObject(file = "rfpcounts.tsv", fasta = FALSE)
parameter <- initializeParameterObject(genome = genome, sphi = 1, num.mixtures = 1, gene.assignment = rep(1, length(genome)))
mcmc <- initializeMCMCObject(samples = 5000, thinning = 10, adaptive.width=50)
model <- initializeModelObject(parameter = parameter, model = "PA")
runMCMC(mcmc = mcmc, genome = genome, model = model)

Examples: Advanced examples

  • As the above examples illustrated the commonalities in the way all models are called. The following example will use the default ROC model for illustration purposes

Example 4

  • multiple mixture distributions with genes being initially randomly assigned to a mixture distribution. The mixture assignment of each gene will be estimated. As the below example shows, only arguments passed to the parameter object have to be adjusted to reflect a change in the number of assumed mixture distributions.
genome <- initializeGenomeObject(file = "genome.fasta")
parameter <- initializeParameterObject(genome = genome, sphi = c(1,2,3), num.mixtures = 3, geneAssignment = sample(1:3, length(genome), replace=TRUE))
mcmc <- initializeMCMCObject(samples = 5000, thinning = 10, adaptive.width=50)
model <- initializeModelObject(parameter = parameter, model = "ROC")
runMCMC(mcmc = mcmc, genome = genome, model = model)

Example 5

  • This example is based on the previous one, but instead of estimating the assignemnt of each gene to one of the three mixture distributions, we will fix the mixture assignemt to the initial assignment
genome <- initializeGenomeObject(file = "genome.fasta")
parameter <- initializeParameterObject(genome = genome, sphi = c(1,2,3), num.mixtures = 3, geneAssignment = sample(1:3, length(genome), replace=TRUE))
mcmc <- initializeMCMCObject(samples = 5000, thinning = 10, adaptive.width=50, est.mix = FALSE)
model <- initializeModelObject(parameter = parameter, model = "ROC")
runMCMC(mcmc = mcmc, genome = genome, model = model)

Copy Link

Version

Install

install.packages('AnaCoDa')

Monthly Downloads

302

Version

0.1.1

License

GPL (>= 2)

Issues

Pull Requests

Stars

Forks

Maintainer

Cedric Landerer

Last Published

February 12th, 2018

Functions in AnaCoDa (0.1.1)

acfMCMC

Autocorrelation function for the likelihood or posterior trace
getCodonCountsForAA

Get Codon Counts For Each Amino Acid
getCAI

Calculate the Codon Adaptation Index
loadMCMCObject

Load MCMC Object
loadParameterObject

Load Parameter Object
getCAIweights

Calculate the CAI codon weigths for a reference genome
plot.Rcpp_MCMCAlgorithm

Plot MCMC algorithm
codons

Codons
plot.Rcpp_ROCModel

Plot Model Object
getExpressionEstimates

Returns the estimated phi posterior for a gene
getMixtureAssignmentEstimate

Returns mixture assignment estimates for each gene
convergence.test

Convergence Test
getNames

Gene Names of Genome
getNc

Calculate the Effective Number of Codons
initializeParameterObject

Initialize Parameter
plot.Rcpp_FONSEModel

Plot Model Object
plot.Rcpp_FONSEParameter

Plot Parameter
aminoAcids

Amino acids
setRestartSettings

Set Restart Settings
length.Rcpp_Genome

Length of Genome
plotCodonSpecificParameters

Plot Codon Specific Parameter
summary.Rcpp_Genome

Summary of Genome
codonToAA

translates codon to amino acid
getSelectionCoefficients

Calculate Selection coefficients
AAToCodon

Amino Acid to codon set
writeParameterObject

Write Parameter Object to a File
initializeCovarianceMatrices

Initialize Covariance Matrices
initializeGenomeObject

Genome Initialization
writeMCMCObject

Write MCMC Object
getTrace

extracts an object of traces from a parameter object.
runMCMC

Run MCMC
acfCSP

Plots ACF for codon specific parameter traces
getNcAA

Calculate the Effective Number of Codons for each Amino Acid
getObservedSynthesisRateSet

Get gene observed synthesis rates
initializeMCMCObject

Initialize MCMC
plot.Rcpp_Trace

Plot Trace Object
plot.Rcpp_ROCParameter

Plot Parameter
initializeModelObject

Model Initialization
addObservedSynthesisRateSet

Add gene observed synthesis rates
getCSPEstimates

Return Codon Specific Paramters (or write to csv) estimates as data.frame