Description Usage Arguments Details Value See Also Examples
View source: R/maximize-peaks.R
Creates a list of the most likely genotypes at each locus, and the most likely whole-profile genotype for peak height data.
1 2 | get.likely.genotypes.peaks(hypothesis,params,results,
posterior=FALSE,joint=FALSE,prob=ifelse(joint==FALSE,0.1,0.05))
|
hypothesis |
Hypothesis object created by either
|
params |
Parameters object created by
|
results |
Either prosecution or defence results returned by
|
posterior |
Logical indicating whether to return all genotype probabilities, rather than just the most likely. |
joint |
Logical indicating whether or not to return joint genotypes and probabilities. If FALSE, marginal genotypes and probabilities are returned instead. |
prob |
Probability threshold for single-locus genotype probabilities. Defaults to 0.1 if returning marginal probabilities, and 0.05 if returning joint probabilities. |
Either joint or marginal genotypes and genotype probabilities
are given. Locus-specific genotypes are only given if their probabilty
exceeds prob
. The most likely whole-profile genotype is given,
regardless of the probability threshold at each locus. Joint
probabilities give the probability of a multi-contributor genotype,
whereas marginal probabilities give the probability of a single
contributor, summing over all the possible genotypes for all other
contributors.
locusSpecific |
Locus genotypes and probabilities which are
greater than |
topGenotype |
Most likely whole-profile genotype for all
contributors if |
defence.hypothesis.peaks, prosecution.hypothesis.peaks, optimisation.params.peaks,evaluate.peaks
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 35 36 37 38 39 40 41 42 43 44 45 46 47 | ## Not run:
# datapath to example files
datapath = file.path(system.file("extdata", package="likeLTD"),"laboratory")
# File paths and case name for allele report
admin = pack.admin.input.peaks(
peaksFile = file.path(datapath, 'laboratory-CSP.csv'),
refFile = file.path(datapath, 'laboratory-reference.csv'),
caseName = "Laboratory",
detectionThresh = 20
)
# Enter arguments
args = list(
nUnknowns = 1
)
# Create hypotheses
hypP = do.call(prosecution.hypothesis.peaks, append(admin,args))
hypD = do.call(defence.hypothesis.peaks, append(admin,args))
# Get parameters for optimisation
paramsP = optimisation.params.peaks(hypP)
paramsD = optimisation.params.peaks(hypD)
# reduce number of iterations for demonstration purposes
paramsP$control$itermax=25
paramsD$control$itermax=25
# Run optimisation
# n.steps and converge set for demonstration purposes
results = evaluate.peaks(paramsP, paramsD, n.steps=1,
converge=FALSE)
# get most likely marginal genotypes under defence
get.likely.genotypes.peaks(hypD,paramsD,
results$Def)
# get most likely joint genotypes under defence
gensJoint = get.likely.genotypes.peaks(hypD,paramsD,
results$Def,joint=TRUE)
# get posterior likelihoods for all genotype combinations
gensPosterior = get.likely.genotypes.peaks(hypD,paramsD,
results$Def,posterior=TRUE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.