add.model: Object constructor for binary predictors

View source: R/add.model.R

add.modelR Documentation

Object constructor for binary predictors

Description

This function aggregates the data required to predict class in classify.

Usage

  add.model(x, model, groupMeans, groupSDs, groupNames, groupColors, threshold,
    geneNames, geneTs, geneMs)

Arguments

x

An object of class fsa to which add a model.

model

A list aggregating the model parameters. Can be provided instead of the argument vectors below individually.

groupMeans

Numeric vector of length 2, the means of the scores in each group as computed on a training series. If model is provided, this vector will be used instead.

groupSDs

Numeric vector of length 2, the standard deviations of the scores in each group as computed on a training series. If model is provided, this vector will be used instead.

groupNames

Character vector of length 2, the names of the group described in groupMeans, groupSDs and groupColors. If model is provided, this vector will be used instead.

groupColors

Character vector of length 2, the colors to use to plot each group (see par for allowed values). If model is provided, this vector will be used instead.

threshold

Single numeric vector, the confidence threshold to use for prediction (a call will be made only if it is at least at this level of certainty). If model is provided, this vector will be used instead.

geneNames

Character vector, the names of the genes whose expression is to be used. If model is provided, this vector will be used instead.

geneTs

Numeric vector, for each gene in geneNames, the statistic of a t.test comparing its expression between the two groups in a training series. If model is provided, this vector will be used instead.

geneMs

Numeric vector, for each gene in geneNames, the mean expression in the whole training series. If model is provided, this vector will be used instead.

Value

Returns an S3 object of class fsaModel.

Author(s)

Sylvain Mareschal

See Also

classify

Examples

  # Example FSA file provided
  fsa <- read.fsa(system.file("extdata/fsa_GEP/A5918.fsa", package="FSAtools"))
  
  # Add model from design file
  design <- designFile(system.file("extdata/design_GEP.conf", package="FSAtools"))
  fsa <- add.model(fsa, model=design$GLOBALS$MODEL)
  
  # Observe model
  print(attr(fsa, "model"))
  plot(attr(fsa, "model"))

FSAtools documentation built on Aug. 19, 2023, 1:06 a.m.