Skip to contents

[Experimental]

Computes uncertainty quantification for GenRA read-across predictions using permutation testing and (optionally) ROC-AUC analysis.

Usage

genra_uncertainty(activities, similarities, n_permutations = 100L)

Arguments

activities

Integer vector of activity values (0 = inactive, 1 = active). NA values are allowed and will be excluded.

similarities

Numeric vector of similarity scores (0-1), must be same length as activities.

n_permutations

Integer. Number of permutations for p-value calculation. Default is 100.

Value

A list with components:

swa

The observed Similarity-Weighted Activity score.

auc

Area Under the ROC Curve (requires pROC package), or NA if unavailable or insufficient data.

p_value

Permutation-based p-value. Proportion of permuted SWA values as extreme as observed.

threshold

Suggested classification threshold (default 0.5).

n_active

Number of active analogues used.

n_inactive

Number of inactive analogues used.

n_permutations

Number of permutations performed.

Details

The p-value is calculated via permutation testing: activity labels are shuffled n_permutations times while keeping similarity weights fixed. The p-value is the proportion of permuted SWA values >= the observed SWA (for positive predictions) or <= observed SWA (for negative predictions).

AUC calculation requires the pROC package and at least one active and one inactive analogue.

Examples

if (FALSE) { # \dontrun{
activities <- c(1, 1, 0, 1, 0)
similarities <- c(0.95, 0.88, 0.82, 0.75, 0.70)
genra_uncertainty(activities, similarities, n_permutations = 100)
} # }