plot_buildROC {movieROC} | R Documentation |
Plot the building procedure of the ROC curve
Description
This function tracks the ROC curve. It plots two graphics in the same figure: right, the empirical ROC curve estimate; left, classification subset for a particular FPR or threshold(s) for the marker (threshold only for object of class ‘groc’).
Usage
## S3 method for class 'groc'
plot_buildROC(x, FPR = NULL, C = NULL, XL = NULL, XU = NULL, h = c(1,1),
histogram = FALSE, breaks = 15, reduce = TRUE, build.process = FALSE,
completeROC = FALSE, new.window = FALSE, legends = FALSE, type = 's',
cex.point = 1.5, lwd.curve = 2, mar = NULL, lim.density = 0.01, xlim = NULL,
ylim = NULL, cex.lab = 1.5, cex.axis = 1.5, cex.main = 2, xlab = "Marker",
main.density = "Density functions", col.controlscases = c('#485C99','#8F3D52'),
col.threshold = '#FCBA04', col.curve = 'black', eps = sqrt(.Machine$double.eps),
...)
## S3 method for class 'multiroc'
plot_buildROC(x, FPR = 0.15, display.method = c("PCA", "OV"),
displayOV = c(1,2), build.process = FALSE, completeROC = TRUE,
new = FALSE, new.window = FALSE, border = FALSE, cutoff = TRUE, legends = FALSE,
type = 's', col.controlscases = c('#485C99','#8F3D52'),
col.threshold = '#FCBA04', col.curve = 'black', cex.point = 1.5,
alpha.points = .75, alpha.contour = 0.25, lwd.curve = 2, lty.curve = 1,
cex = 0.8, cex.lab = 1.5, cex.axis = 1.5, cex.main = 2, xlab = NULL, ylab = NULL,
lf = NULL, eps = sqrt(.Machine$double.eps), ...)
Arguments
x |
An ROC curve object from movieROC package. Possible classes are: ‘groc’ (output of |
FPR |
False-positive rate for which the left plot is computed. Default: 0.15. |
C |
Marker cutoff for which the left plot is computed. Only available for a ‘groc’ object. |
XL , XU |
Marker cutoffs for which the left plot is computed. Only available for object of class ‘groc’ with |
h |
A vector of length 2 with the bandwidth used to compute kernel density estimation for controls and cases, respectively. See |
histogram |
If TRUE, histograms are displayed on the left instead of kernel density estimates. Default: FALSE. Only available for a ‘groc’ object. |
breaks |
If |
reduce |
If FALSE, two extra graphics are displayed at the bottom (see Details for more information). Default: TRUE. Only available for a ‘groc’ object. |
build.process |
If FALSE, the whole ROC curve is displayed; otherwise, if |
completeROC |
If |
new.window , new |
If TRUE, graphics are displayed in a new window. Default: FALSE. |
legends |
If TRUE, a legend with colors meaning is displayed on the left graphic and the AUC is shown on the right graphic. Default: FALSE. |
type , lty.curve , lwd.curve , col.curve |
The line type, width and color for ROC curve. Default: |
cex.lab , cex.axis , cex.main |
The magnification to be used for labels, axis annotation and main titles, respectively, relative to the current setting of |
cex |
A numerical value giving the amount by which plotting text and symbols should be magnified relative to the default. Default: 0.8. Not available for object of class ‘groc’ ( |
cex.point |
The magnification to be used for the particular point on the ROC curve and its text, relative to the current setting of |
xlim , ylim |
Range for x- and y-axis on the left plot. Only available for a ‘groc’ object. |
lim.density |
If |
xlab , ylab |
Label for x- and y-axis on the left plot. |
main.density |
Title for the left plot. Only available for a ‘groc’ object. |
col.controlscases |
Vector of length 2 with the color used to control and case group, respectively. Default: |
col.threshold |
Color for the chosen point. Default: |
mar |
A numerical vector of the form c(bottom, left, top, right) which gives the number of lines of margin to be specified on the four sides of the plot. Only available for a ‘groc’ object. |
eps |
Epsilon value to consider. Default: |
border |
If TRUE, a border for the classification subsets is drawn. Default: FALSE for ‘multiroc’ object (TRUE if |
cutoff |
If TRUE, the cutoff value for the resulting univariate marker is displayed on the right plot (ROC curve). Default: TRUE. Not available for object of class ‘groc’. |
alpha.points , alpha.contour |
Number in [0,1] modifying the opacity alpha of the color for the points and classification region. The |
lf |
Epsilon value for steps. Not used. Not available for object of class ‘groc’. |
display.method |
Method to display the marker values from a ‘multiroc’ object on the left plot. Methods available: |
displayOV |
If |
... |
Other parameters to be passed. Not used. |
Details
- For univariate ROC curves:
It plots two graphics in the same figure: left, density function estimates for the marker in both populations with the areas corresponding to FPR and TPR colored (blue and red, respectively) for a particular FPR or threshold(s) for the marker; right, the empirical ROC curve estimate.
For an object of class ‘groc’, if the input parameter reduce = FALSE
,
two more graphics are displayed at the bottom:
left, boxplots for the marker distribution in both populations;
right, classification subsets for every false-positive rate (grey color by default).
- For multivariate ROC curves:
Plot two graphics in the same figure: right, the ROC curve highlighting the point and the
threshold for the resulting univariate marker; left, scatterplot with the marker values for controls (blue color) and cases (red color), and the classification subset (in gold color) reporting the false-positive rate selected by the user (if FPR
is not NULL
).
If build.process = FALSE
, the whole ROC curve is displayed; otherwise, if completeROC = TRUE
,
the portion of the ROC curve until the fixed FPR is highlighted in black and the rest is
shown in gray, while if completeROC = FALSE
, only the first portion of the curve is illustrated.
Value
A plot of the building procedure of the ROC curve with the selected graphical parameters
Dependencies
If method = "kernelOptimal"
in a ‘multiroc’ object, the na.locf()
function in the zoo package is used.
Examples
data(HCC)
# Standard ROC curve for gene 20202438
roc_cg20202438 <- gROC(X = HCC$cg20202438, D = HCC$tumor, side = "right")
plot_buildROC(roc_cg20202438)
plot_buildROC(roc_cg20202438, C = .77, build.process = TRUE, reduce = FALSE)
# Multivariate ROC curve for genes 0202438, 18384097, and 03515901
multiroc_PT <- multiROC(X = cbind(HCC$cg20202438, HCC$cg18384097, HCC$cg03515901),
D = HCC$tumor, method = "fixedLinear", methodLinear = "PepeThompson")
plot_buildROC(multiroc_PT, cex = 1.2, lwd.curve = 4) # Two first components from PCA
plot_buildROC(multiroc_PT, display.method = "OV", displayOV = c(1,3),
cex = 1.2, xlab = "Gene 20202438", ylab = "Gene 03515901", lwd.curve = 4)