likeLTD::get.likely.genotypes

Share:

Description

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

Usage

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

Arguments

hypothesis

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

params

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

results

Results object returned by DEoptimLoop

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, prosecution.hypothesis, optimisation.params,DEoptimLoop

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
## Not run: 
# datapath to example files
datapath = file.path(system.file("extdata", package="likeLTD"),"hammer")

# File paths and case name for allele report
admin = pack.admin.input(
            cspFile = file.path(datapath, 'hammer-CSP.csv'),
            refFile = file.path(datapath, 'hammer-reference.csv'),
            caseName = "hammer",
	    kit= "SGMplus"
             )

# Enter arguments
args = list(
        nUnknowns = 1,
        doDropin = FALSE,
        ethnic = "EA1",
        adj = 1,
        fst = 0.02,
        relatedness = c(0,0)
        )

# Create hypotheses
hypP = do.call(prosecution.hypothesis, append(admin,args))
hypD = do.call(defence.hypothesis, append(admin,args))

# Get parameters for optimisation
paramsP = optimisation.params(hypP)
paramsD = optimisation.params(hypD)

# Run optimisation
# n.steps set for demonstration purposes
results = evaluate(paramsP, paramsD, n.steps=1)

# get most likely marginal genotypes under defence
get.likely.genotypes(hypD,paramsD,results$Def)

# get most likely joint genotypes under defence
get.likely.genotypes(hypD,paramsD,results$Def,joint=TRUE)

# get full posterior likelihoods
get.likely.genotypes(hypD,paramsD,results$Def,posterior=TRUE)

## End(Not run)

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