likeLTD::get.likely.genotypes.peaks

Share:

Description

Creates a list of the most likely genotypes at each locus, and the most likely whole-profile genotype for peak height data.

Usage

1
2
get.likely.genotypes.peaks(hypothesis,params,results,
posterior=FALSE,joint=FALSE,prob=ifelse(joint==FALSE,0.1,0.05))

Arguments

hypothesis

Hypothesis object created by either defence.hypothesis.peaks or prosecution.hypothesis.peaks that was used for optimisation with evaluate.peaks.

params

Parameters object created by optimisation.params.peaks that was used for optimisation with evaluate.

results

Either prosecution or defence results returned by evaluate.peaks e.g. results$Pros or results$Def.

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.

Details

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.

Value

locusSpecific

Locus genotypes and probabilities which are greater than prob for each contributor of joint=FALSE, or for all contributors if joint=TRUE.

topGenotype

Most likely whole-profile genotype for all contributors if joint=TRUE or for each contributor separately if joint=FALSE. The probability of each genotype is also given.

See Also

defence.hypothesis.peaks, prosecution.hypothesis.peaks, optimisation.params.peaks,evaluate.peaks

Examples

 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)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.