AnaCoDa (version 0.1.1)

getExpressionEstimates: Returns the estimated phi posterior for a gene

Description

Posterior estimates for the phi value of specified genes

Usage

getExpressionEstimates(parameter, gene.index, samples, quantiles = c(0.025,
  0.975))

Arguments

parameter

on object created by initializeParameterObject.

gene.index

a integer or vector of integers representing the gene(s) of interesst.

samples

number of samples for the posterior estimate

quantiles

vector of quantiles, (default: c(0.025, 0.975))

Value

returns a vector with the mixture assignment of each gene corresbonding to gene.index in the same order as the genome.

Details

The returned vector is unnamed as gene ids are only stored in the genome object, but the gene.index vector can be used to match the assignment to the genome.

Examples

Run this code
# NOT RUN {
 
genome_file <- system.file("extdata", "genome.fasta", package = "AnaCoDa")

genome <- initializeGenomeObject(file = genome_file)
sphi_init <- c(1,1)
numMixtures <- 2
geneAssignment <- sample(1:2, length(genome), replace = TRUE) # random assignment to mixtures
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)

# get the estimated expression values for all genes based on the mixture 
# they are assigned to at each step
estimatedExpression <- getExpressionEstimates(parameter, 1:length(genome), 1000)
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab