Description Usage Arguments Details Value See Also Examples
View source: R/maximize-peaks.R
Plot distribution of fitted peaks along with actual peak heights.
1 | peaks.results.plot(hyp,res,replicate=1,toplot=NULL,fileName=NULL,...)
|
hyp |
Hypothesis used to generate parameters for optimisation. |
res |
Either prosecution or defence results from |
replicate |
Which replicate results to plot. |
toplot |
Integer vector indicating which loci to plot. If |
fileName |
Output file name for plot. If |
... |
Extra parameters to pass to |
CSP peak heights for a single replicate are plotted, with boxplots representing the distribution for each peak height estimated through optimisation.
Pdf file or plot window.
plot.CSP.heights
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"),"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)
# plot fitted results under prosecution
peaks.results.plot(hypP,results$Pros)
# plot fitted results under defence
peaks.results.plot(hypD,results$Def)
# plot fitted results for first four loci
peaks.results.plot(hypP,results$Pros,toplot=1:4)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.