movieROC {movieROC} | R Documentation |
Create a video with the building procedure of the ROC curve
Description
Save a video as a GIF illustrating the construction of the ROC curve. Particularly, for each
element in vector fpr
(optional input parameter), the function executed is
- for ‘groc’ objects:
plot_buildROC(obj, FPR = fpr[i], build.process = TRUE,...)
;
- for ‘multiroc’ objects:
plot_buildROC(obj, FPR = fpr[i], build.process = TRUE, display.method, displayOV,...)
Usage
movieROC(x, ...)
## S3 method for class 'groc'
movieROC(x, fpr = NULL, h = c(1,1), histogram = FALSE, breaks = 15,
reduce = TRUE, completeROC = FALSE, videobar = TRUE, file = "animation1.gif",
save = TRUE, legends = FALSE, speedcorrection = FALSE, tpause = 1, interval = 0.2,
ani.width, ani.height, xlab = "Marker", main.density = "Density functions",
cex.lab = 2.5, cex.axis = 1.75, cex.main = 2.25 + as.numeric(reduce),
xlim = NULL, ylim = NULL, cex.point = 1.5, lwd.curve = 2, mar = NULL,
lim.density = 0.01, col.controlscases = c("#485C99", "#8F3D52"),
col.curve = "black", col.threshold = "#FCBA04", verbose = FALSE, ...)
## S3 method for class 'multiroc'
movieROC(x, fpr = NULL, display.method = c("PCA", "OV"),
displayOV = c(1,2), border = TRUE, completeROC = FALSE, videobar = TRUE,
file = "animation1.gif", save = TRUE, legends = FALSE, tpause = 1,
interval = 0.2, ani.width, ani.height, xlab = NULL, ylab = NULL,
cex = 0.8, cex.lab = 1.5, cex.axis = 1.5, cex.main = 2, alpha.points = 1,
alpha.contour = 0.25, lwd.curve = 2, lty.curve = 1, lf = NULL,
col.controlscases = c('#485C99','#8F3D52'), col.curve = 'black',
col.threshold = '#FCBA04', verbose = FALSE, ...)
Arguments
x |
An ROC curve object from the movieROC package. Possible classes are: ‘groc’ (output of |
fpr |
A vector of false-positive rates for which the building process of the ROC curve is displayed. Default: if length of |
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. |
completeROC |
A logical value indicating if the whole ROC curve should be displayed in light gray or not. Default: FALSE. |
videobar |
If TRUE, a text progress bar is shown in the R console. Default: TRUE. |
verbose |
If TRUE, a progress bar is displayed for computationally intensive methods. Default: FALSE. |
file |
File name of the movie (with the extension). Default: |
save |
If TRUE, video is saved as a GIF by using the |
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. |
speedcorrection |
If TRUE, only some FPR in |
tpause |
If |
interval |
If |
ani.width , ani.height |
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. |
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 |
lty.curve , lwd.curve , col.curve |
The line type, width and color for ROC curve. 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. |
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: |
border |
If TRUE, a border for the classification subsets is drawn. 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. |
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 to the |
Value
A video with the building procedure of the ROC curve estimate with the selected graphical parameters
Dependencies
If save = TRUE
(by default), the saveGIF()
function in the animation package is used.
Examples
data(HCC)
# Standard ROC curve for gene 20202438
roc_cg20202438 <- gROC(X = HCC$cg20202438, D = HCC$tumor, side = "right")
### The video will be saved as a GIF with the name "video_cg20202438"
movieROC(roc_cg20202438, file = "video_cg20202438.gif", save = 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")
# Two first components from PCA:
### The video will be saved as a GIF with the name "video_multiroc_pca"
movieROC(multiroc_PT, file = "video_multiroc_pca.gif", save = FALSE)
### The video will be saved as a GIF with the name "video_multiroc_orig"
movieROC(multiroc_PT, display.method = "OV", displayOV = c(1,3),
file = "video_multiroc_orig.gif", cex = 1.2, xlab = "Gene 20202438",
ylab = "Gene 03515901", lwd.curve = 4, save = FALSE)