Predict specific values of precision or recall by fitting a model to a precision-recall curve. Predictions that are <0 will automatically be set to 0. Predictions that are >100 will automatically be set to 100.

predict_precision_recall(
  pr_df,
  fun = stats::loess,
  precision = seq(10, 100, 10),
  recall = seq(10, 100, 10)
)

Arguments

pr_df

Precision-recall data.frame generated by precision_recall.

fun

Function to fit the data with.

precision

Precision values to predict recall from.

recall

Recall values to predict precision from.

Value

A named list of fitted models and predictions.

Examples

data("CnR_H3K27ac")
data("CnT_H3K27ac")
data("encode_H3K27ac")
peakfiles <- list(CnR_H3K27ac=CnR_H3K27ac, CnT_H3K27ac=CnT_H3K27ac)
reference <- list("encode_H3K27ac" = encode_H3K27ac)
pr_df <- precision_recall(peakfiles = peakfiles,
                          reference = reference)
#> Reformatting precision-recall data.
#> Saving precision-recall results ==> /tmp/Rtmp2pySPs/file82a42cee227precision_recall.csv
predictions <- predict_precision_recall(pr_df = pr_df)           
#> Making predictions for peaklist1: CnR_H3K27ac
#> Making predictions for peaklist2: encode_H3K27ac
#> + Predicting recall from 10 precision values.
#> + Predicting precision from 10 recall values.
#> Making predictions for peaklist1: CnT_H3K27ac
#> Making predictions for peaklist2: encode_H3K27ac
#> + Predicting recall from 10 precision values.
#> + Predicting precision from 10 recall values.