Description Usage Arguments Details Value Examples
View source: R/parameterObject.R
Posterior estimates for the mixture assignment of specified genes
1 | getMixtureAssignmentEstimate(parameter, gene.index, samples)
|
parameter |
on object created by |
gene.index |
a integer or vector of integers representing the gene(s) of interesst. |
samples |
number of samples for the posterior estimate |
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.
returns a vector with the mixture assignment of each gene corresbonding to gene.index
in the same order as the genome.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
genome_file <- system.file("extdata", "genome.fasta", package = "AnaCoDa")
genome <- initializeGenomeObject(file = genome_file)
sphi_init <- c(1,1)
numMixtures <- 2
geneAssignment <- c(rep(1,floor(length(genome)/2)),rep(2,ceiling(length(genome)/2)))
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 mixture assignment for all genes
mixAssign <- getMixtureAssignmentEstimate(parameter = parameter,
gene.index = 1:length(genome), samples = 1000)
# get the mixture assignment for a subsample
mixAssign <- getMixtureAssignmentEstimate(parameter = parameter,
gene.index = 5:100, samples = 1000)
# or
mixAssign <- getMixtureAssignmentEstimate(parameter = parameter,
gene.index = c(10, 30:50, 3, 90), samples = 1000)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.