getSelectionCoefficients {AnaCoDa} | R Documentation

## Calculate Selection coefficients

### Description

`getSelectionCoefficients` calculates the selection coefficient of each codon in each gene.

### Usage

    getSelectionCoefficients(genome, parameter, samples = 100)

### Arguments

`genome` | A genome object initialized with `initializeGenomeObject` to add observed expression data.
`parameter` | an object created by `initializeParameterObject`.
`samples` | The number of samples used for the posterior estimates.

### Value

A matrix with selection coefficients.

### Examples

    genome_file <- system.file("extdata", "genome.fasta", package = "AnaCoDa")

    genome <- initializeGenomeObject(file = genome_file)
    sphi_init <- 1
    numMixtures <- 1
    geneAssignment <- rep(1, length(genome))
    parameter <- initializeParameterObject(genome = genome, sphi = sphi_init,
                                           num.mixtures = numMixtures,
                                           gene.assignment = geneAssignment,
                                           mixture.definition = "allUnique")
    model <- initializeModelObject(parameter = parameter, model = "ROC")
    samples <- 2500
    thinning <- 50
    adaptiveWidth <- 25
    mcmc <- initializeMCMCObject(samples = samples, thinning = thinning,
                                 adaptive.width=adaptiveWidth, est.expression=TRUE,
                                 est.csp=TRUE, est.hyper=TRUE, est.mix = TRUE)
    divergence.iteration <- 10
    ## Not run:
    runMCMC(mcmc = mcmc, genome = genome, model = model,
            ncores = 4, divergence.iteration = divergence.iteration)

    ## return estimates for selection coefficients s for each codon in each gene
    selection.coefficients <- getSelectionCoefficients(genome = genome,
                                                       parameter = parameter, samples = 1000)

    ## End(Not run)

[Package AnaCoDa version 0.1.3.0 Index]