Skip to contents

[Experimental]

Performs a GenRA-style read-across prediction for a target chemical using Similarity-Weighted Activity (SWA) with ToxValDB data.

Usage

genra_predict(
  target,
  k = 10L,
  min_similarity = 0.5,
  study_filter = NULL,
  n_permutations = 100L
)

Arguments

target

Character. DTXSID of the target chemical to predict.

k

Integer. Maximum number of analogues to consider. Default is 10.

min_similarity

Numeric. Minimum similarity threshold (0-1) for analogues. Default is 0.5.

study_filter

Optional character string to filter ToxValDB records by study type (e.g., "acute", "chronic", "developmental"). Default is NULL.

n_permutations

Integer. Number of permutations for uncertainty estimation. Default is 100.

Value

An S3 object of class "genra_prediction" containing:

target

The target DTXSID.

prediction

Numeric SWA score (0-1).

predicted_class

Character: "active", "inactive", or "uncertain".

auc

Area Under ROC Curve (or NA if unavailable).

p_value

Permutation-based p-value.

threshold

Classification threshold used (0.5).

n_analogues

Number of analogues with activity data.

n_analogues_found

Total analogues found before activity filtering.

analogues

Tibble of analogue details (dtxsid, similarity, activity, n_records).

parameters

List of input parameters.

Details

The workflow:

  1. Find structural analogues using ct_similar()

  2. Filter to top k analogues meeting min_similarity threshold

  3. Retrieve ToxValDB activity data for analogues

  4. Calculate Similarity-Weighted Activity (SWA) prediction

  5. Estimate uncertainty via permutation testing and AUC

Classification:

  • SWA >= 0.5: "active" (predicted toxic)

  • SWA < 0.5: "inactive" (predicted non-toxic)

  • NA or insufficient data: "uncertain"

Examples

if (FALSE) { # \dontrun{
# Basic prediction for Bisphenol A
ctx_server(1)
pred <- genra_predict("DTXSID7020182")
print(pred)

# With study type filter
pred <- genra_predict("DTXSID7020182", study_filter = "developmental")

# More permutations for better p-value estimate
pred <- genra_predict("DTXSID7020182", n_permutations = 1000)

# View analogue details
pred$analogues
} # }