This function extracts the required information from an output generated by RAIDS to create a graphic representation of the accuracy for different values of PCA dimensions and K-neighbors through all tested ancestries.

createAUROCGraph(
  dfAUROC,
  title = "",
  selectD = c(3, 7, 11),
  selectColor = c("#5e688a", "#cd5700", "#CC79A7")
)

Arguments

dfAUROC

a data.frame corresponding to res$paraSample$dfAUROC where res is the result of inferAncestry or inferAncestryGeneAware.

title

a character string representing the title of the graph. Default: "".

selectD

a array of integer representing the selected PCA dimensions to plot. The length of the array cannot be more than 5 entries. The dimensions must tested by RAIDS (i.e. be present in the RDS file). Default: c(3,7,11).

selectColor

a array of character strings representing the selected colors for the associated PCA dimensions to plot. The length of the array must correspond to the length of the selectD parameter. In addition, the length of the array cannot be more than 5 entries. Default: c("#5e688a", "#cd5700", "#CC79A7").

Value

a ggplot object containing the graphic representation of the accuracy for different values of PCA dimensions and K-neighbors through all tested ancestries.

Author

Astrid Deschênes and Pascal Belleau

Examples


## Required library
library(ggplot2)

## Path to RDS file with ancestry information generated by RAIDS (demo file)
dataDir <- system.file("extdata", package="RAIDS")
fileRDS <- file.path(dataDir, "TEST_01.infoCall.RDS")
info <- readRDS(fileRDS)
dfAUROC <- info$paraSample$dfAUROC
colnames(dfAUROC) <- c("D", "K", "Call", "L", "AUROC", "H")
## Create accuracy graph
accuracyGraph <- createAUROCGraph(dfAUROC=dfAUROC, title="Test 01",
    selectD=c(3,6,9,12,15),
    selectColor=c("steelblue", "darkorange", "violet", "pink", "gray80"))

accuracyGraph