Skip to contents

The computeGD2Score function calculates a GD2 score using a given reaction activity score (RAS) matrix and an SVM model. It allows for various adjustments to the input data before scoring.

Usage

computeGD2Score(
  RAS,
  svm_model,
  adjust_input = c("raw", "ranged", "scaled"),
  range_output = FALSE,
  center = TRUE
)

Arguments

RAS

A matrix of reaction activity scores with reaction IDs as row names and samples as columns.

svm_model

An SVM model used for predicting the GD2 score.

adjust_input

A character string indicating how to adjust the input data. Options are "raw" (no adjustment), "ranged" (rescale to [0, 1]), and "scaled" (standardize with mean 0 and standard deviation 1). Default is "raw".

range_output

A logical value indicating whether to rescale the output data. Default is FALSE.

center

A logical value indicating whether to center the data when scaling. Default is TRUE.

Value

A numeric vector of GD2 scores for the samples.

Examples

# Example RAS matrix with necessary reaction IDs
RAS <- matrix(runif(6 * 10), nrow = 6,
  dimnames = list(c("R05946", "R05940", "R05939", "R05948", "R05947", "R05941")))

# Example SVM model
svm_model <- e1071::svm(x = data.frame(x = rnorm(10), y = rnorm(10)),
  y = rnorm(10),
  type = "eps-regression")

# Compute GD2 scores with raw input
scores <- computeGD2Score(RAS, svm_model, adjust_input = "raw")