Title: Detect the Shape of Dose-Response Curves
Version: 0.1.3
Description: Provides functions for hormesis screening by classifying the shapes of dose-response curves based on semiparametric tests. The shapes are indications of different potential toxicology effect. It also offers a scalable visualization scheme to present testing conclusions for large-scale dataset with a large number of dose-response curves. For more information, see Jin et al. (2026) https://github.com/YinglJin-0203/shorm/blob/main/Manuscripts/BotanicalHormesisTestingFinalDraft.docx.
License: GPL-3
Encoding: UTF-8
RoxygenNote: 7.3.3
Imports: SRMERS, ggplot2, scales, dplyr
Collate: 'RepeatSHARP.R' 'SHARPtest.R' 'SharpScatter.R'
URL: https://github.com/YinglJin-0203/shorm
NeedsCompilation: no
Packaged: 2026-04-28 19:37:53 UTC; ebair
Author: Eric Bair [aut, cre], Ying Jin [aut, cph]
Maintainer: Eric Bair <software.tools@sciome.com>
Repository: CRAN
Date/Publication: 2026-04-29 08:20:02 UTC

Implement SHARP test repeatedly on a dose-response curve

Description

The SHARP shape detection test relies on a underlying random generation process, which may lead to ambiguous test results. To examin its uncertainty and obtain a more robust conclusion, we may with to repet the test on the same data.

Usage

RepeatSHARP(df, nRep, mixed = FALSE, xName, yName, rName, niter = 1000)

Arguments

df

Dose-response curve data in a table format. Dose and responses should be two separate columns with numeric values.

nRep

Number of repetitions of SHAPR test. Integer.

mixed

Logical indicator (TRUE for FALSE) for whether or not to use the mixed-model-based test.

xName

The column name for dose. Character string.

yName

The column name for response. Character string.

rName

The column name for random effect. Only used if mixed = TRUE. Character string.git a

niter

An integer for the number of iterations in SHARP test procedure

Value

A dataframe of test results from all repititions. Each row is one single test with four p values after Holm adjustment.

Examples

# Simulate dose-response data
x <- seq(0, 1, length.out = 48)
y <- 2*sqrt(x)+rnorm(48)
y[17:32] <- y[17:32]+0.5
y[33:48] <- y[33:48]+1
curve <- data.frame(x, y)
curve$rep <- rep(1:3, each = 16)

# Fixed-model based test
RepeatSHARP(curve, nRep = 10, xName = "x", yName = "y", niter = 10)

# Mixed-model based test
RepeatSHARP(curve, nRep = 10, mixed = TRUE, xName = "x", yName = "y", rName = "rep", niter = 10)

Implement SHARP test once on a dose-response curve

Description

Implement SHARP test once on a dose-response curve

Usage

SHARPtest(df, mixed = FALSE, xName, yName, rName, niter = 1000)

Arguments

df

Dose-response curve data in a table format. Dose and responses should be two separate columns with numeric values.

mixed

Logical indicator (TRUE for FALSE) for whether or not to use the mixed-model-based test.

xName

The column name for dose. Character string.

yName

The column name for response. Character string.

rName

The column name for random effect. Only used if mixed = TRUE. Character string.

niter

An integer for the number of iterations in SHARP test procedure.

Value

A vector of four p values after Holm adjustment, indicating the significance of four different shapes types.

Examples

# Simulate dose-response data
x <- seq(0, 1, length.out = 48)
y <- 2*sqrt(x)+rnorm(48)
y[17:32] <- y[17:32]+0.5
y[33:48] <- y[33:48]+1
curve <- data.frame(x, y)
curve$rep <- rep(1:3, each = 16)

# Fixed-model based test
SHARPtest(curve, xName = "x", yName = "y", niter = 100)

# Mixed-model based test
SHARPtest(curve, mixed = TRUE, xName = "x", yName = "y", rName = "rep", niter = 100)

Function to visualize SHARP test results

Description

Function to visualize SHARP test results

Usage

SharpScatter(
  pinc,
  pdec,
  pconc,
  pconv,
  alpha = 0.05,
  scale = TRUE,
  label = NULL,
  size_point = 2,
  size_label = 5,
  ...
)

Arguments

pinc, pdec, pconc, pconv

SHARP test p-values corresponding to increasing, decreasing, concave and convex

alpha

significance threshold. alpha=NULL corresponding to no significance threshold

scale

if the axis should be scale so that the significant threshold is placed in the center

label

labels of the point to visualize. label=NULL means no labeling.

size_point, size_label

the size of points and label. size_lable is used when label is not NULL.

...

additional parameters passed to ggplot

Details

The shape scatter plot represents the four p-values (corresponding to four shape types) of SHARP test on a 2D space. it can not only visualize the conclusions of the test, but also the confidence level of the test. The plot surface is divided into two parts along two perpendicular directions, corresponding to two opposite shapes. The coordinates of points are derived from p-values such that:

Value

The plotted ggplot object

Examples

# Simulate dose-response data
x <- seq(0, 1, length.out = 48)
y <- 2*sqrt(x)+rnorm(48)
y[17:32] <- y[17:32]+0.5
y[33:48] <- y[33:48]+1
curve <- data.frame(x, y)
curve$rep <- rep(1:3, each = 16)

# Fixed-model based test
sharpt <- SHARPtest(curve, xName = "x", yName = "y", niter = 100)

# Plot the graph
SharpScatter(sharpt[1], sharpt[2], sharpt[3], sharpt[4], niter = 100)