Description Usage Arguments Value Author(s) Examples
Compute incorrect labels
for several changepoint detection
problems and models
. Use this function after having computed
changepoints, loss values, and model selection functions
(see modelSelection
). The next step after labelError is typically
computing target intervals of log(penalty) values that predict
changepoints with minimum incorrect labels
for each problem (see
targetIntervals
).
1 2 3 4 5 6  labelError(models, labels,
changes, change.var = "chromStart",
label.vars = c("min",
"max"), model.vars = "n.segments",
problem.vars = character(0),
annotations = change.labels)

models 
data.frame with one row per (problem,model) combination, typically
the output of modelSelection(...). There is a row for each
changepoint model that could be selected for a particular
segmentation problem. There should be columns 
labels 
data.frame with one row per (problem,region). Each label defines a
region in a particular segmentation problem, and a range of
predicted changepoints which are consistent in that region. There
should be a column "annotation" with takes one of the
corresponding values in the annotation column of 
changes 
data.frame with one row per (problem,model,change), for each
predicted changepoint (in each model and segmentation
problem). Should have columns 
change.var 
character(length=1): column name of predicted changepoint
position in 
label.vars 
character(length=2): column names of start and end positions of

model.vars 
character: column names used to identify model complexity. The
default "n.segments" is for changepoint 
problem.vars 
character: column names used to identify data set / segmentation
problem, should be present in all three data tables ( 
annotations 
data.table with columns annotation, min.changes, max.changes,
possible.fn, possible.fp which is joined to 
list of two data.tables: label.errors has one row for every
combination of models
and labels
, with status column that
indicates whether or not that model commits an error in that
particular label; model.errors has one row per model, with columns
for computing target intervals and ROC curves (see targetIntervals
and ROChange
).
Toby Dylan Hocking
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  label < function(annotation, min, max){
data.frame(profile.id=4, chrom="chr14", min, max, annotation)
}
label.df < rbind(
label("1change", 70e6, 80e6),
label("0changes", 20e6, 60e6))
model.df < data.frame(chrom="chr14", n.segments=1:3)
change.df < data.frame(chrom="chr14", rbind(
data.frame(n.segments=2, changepoint=75e6),
data.frame(n.segments=3, changepoint=c(75e6, 50e6))))
penaltyLearning::labelError(
model.df, label.df, change.df,
problem.vars="chrom", # for all three data sets.
model.vars="n.segments", # for changes and selection.
change.var="changepoint", # column of changes with breakpoint position.
label.vars=c("min", "max")) # limit of labels in ann.

Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.