Skip to contents

This function plots the ROC curve in REVEL + AlphScore for each gene and returns the AUC.

Usage

REVEL_AlphScore(file_name, phenotype = "Target", col = "gray")

Arguments

file_name

The "gene name_Target or Pathogenic_predict.csv" file output by the MOVA function.

phenotype

Specify "Target" if you want the positive variant to be the Target variant only, or "Pathogenic" if you want to include the Pathogenic variant as well. The default is "Target".

col

Specifies the color of the ROC curve. Default is gray.

Details

Value

Return the AUC for each gene in REVEL + AlphScore.

References

Author

Yuya Hatano

Note

See also

Examples

##---- Should be DIRECTLY executable !! ----
##-- ==>  Define data, use random,
##--  or do  help(data=index)  for the standard data sets.

## The function is currently defined as
function (file_name, phenotype = "Target", col = "gray") 
{
    df <- fread(file_name)
    if (phenotype == "Target") {
        df <- df[(df$Type == "Target") | (df$Type == "Ctrl"), 
            ]
    }
    df$predict <- df$glm_AlphRevel
    df <- df[df$predict != ".", ]
    df$predict <- as.numeric(df$predict)
    if (phenotype == "Target") {
        df$result <- df$Type2
    }
    else {
        df$result <- df$Type3
    }
    pred <- prediction(df$predict, df$result)
    perf <- performance(pred, "tpr", "fpr")
    plot(perf, col = col, add = TRUE)
    auc.tmp <- performance(pred, "auc")
    auc <- as.numeric(auc.tmp@y.values)
    return(auc)
  }
#> function (file_name, phenotype = "Target", col = "gray") 
#> {
#>     df <- fread(file_name)
#>     if (phenotype == "Target") {
#>         df <- df[(df$Type == "Target") | (df$Type == "Ctrl"), 
#>             ]
#>     }
#>     df$predict <- df$glm_AlphRevel
#>     df <- df[df$predict != ".", ]
#>     df$predict <- as.numeric(df$predict)
#>     if (phenotype == "Target") {
#>         df$result <- df$Type2
#>     }
#>     else {
#>         df$result <- df$Type3
#>     }
#>     pred <- prediction(df$predict, df$result)
#>     perf <- performance(pred, "tpr", "fpr")
#>     plot(perf, col = col, add = TRUE)
#>     auc.tmp <- performance(pred, "auc")
#>     auc <- as.numeric(auc.tmp@y.values)
#>     return(auc)
#>   }
#> <environment: 0x0000011a884b4410>