plot_prcurve: Create precision-recall graphs

View source: R/plot_prcurve.R

plot_prcurveR Documentation

Create precision-recall graphs

Description

Create a precision/recall curve using metrics computed by the svevalOl function. The svevalOl function returns a list containing a "curve" data.frame with the evaluation metrics for different quality thresholds.

Usage

plot_prcurve(eval, labels = NULL)

Arguments

eval

a data.frame, a list of data.frames, or a vector with one or several paths to files with "curve" information.

labels

the labels to use for each input (when multiple inputs are used). Ignored is NULL (default).

Details

If the input is a data.frame (or list of data.frames) it should be the "curve" element of the list returned by the svevalOl function. If the input is a character (or a vector of characters), they are considered to be file names and the data will be read from these files.

If multiple inputs are given, either using a list of data.frames or a vectors with several filenames, one curve per input will be created. This is to be used to quickly compare several methods. The "labels" parameters can be used to specify a label for each input to use for the graphs.

Value

list of ggplot graph objects

Author(s)

Jean Monlong

Examples

## Not run: 
eval = svevalOl('calls.vcf', 'truth.vcf')
plot_prcurve(eval$curve)

# Comparing multiple methods
eval.1 = svevalOl('calls1.vcf', 'truth.vcf')
eval.2 = svevalOl('calls2.vcf', 'truth.vcf')
plot_prcurve(list(eval.1$curve, eval.2$curve), labels=c('method1', 'method2'))

# Or if the results were previously written in files
plot_prcurve(c('methods1-prcurve.tsv', 'methods2-prcurve.tsv'), labels=c('method1', 'method2'))

## End(Not run)

jmonlong/sveval documentation built on July 31, 2023, 7:50 p.m.