Moanin-class: Class Moanin

Description Usage Arguments Details Value Slots Examples

Description

Moanin is a class that extends SummarizedExperiment and is used to store the additional spline basis and meta data for timecourse analysis.

In addition to the slots of the SummarizedExperiment class, the Moanin object has the additional slots described in the Slots section.

There are several methods implemented for this class. The most important methods have their own help page. Simple helper methods are described in the Methods section below. For a comprehensive list of methods specific to this class see the Reference Manual.

The constructor create_moanin_model creates an object of the class Moanin.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
## S4 method for signature 'DataFrame'
create_moanin_model(data, meta, ...)

## S4 method for signature 'data.frame'
create_moanin_model(data, ...)

## S4 method for signature 'matrix'
create_moanin_model(data, meta, ...)

## S4 method for signature 'SummarizedExperiment'
create_moanin_model(
  data,
  spline_formula = NULL,
  basis_matrix = NULL,
  group_variable_name = "Group",
  time_variable_name = "Timepoint",
  degrees_of_freedom = NULL,
  log_transform = FALSE,
  drop_levels = TRUE
)

Arguments

data

The input data. Can be a SummarizedExperiment class, or matrix/data.frame. If the input data is a matrix or data.frame, then the user must also provide input to the meta argument, which will be transformed into colData of the resulting Moanin object

meta

Meta data on the samples (columns) of the data argument. Must be given f input data is a matrix or data.frame. If input is SummarizedExperiment, this argument is ignored.

...

arguments passed from methods to the SummarizedExperiment method.

spline_formula

formula object, optional, default: NUlL. Used to construct splines from the data in meta. See details.

basis_matrix

matrix, optional, default: NULL. A basis matrix, where each row corresponds to the evaluation of a sample on the basis function (thus one column for each basis function).

group_variable_name

A character value giving the column that corresponds to the grouping variable to test for DE. By default "Group"

time_variable_name

A character value giving the column that corresponds to the time variable. By default "Timepoint".

degrees_of_freedom

int, optional. Number of degrees of freedom to use if neither the basis_matrix nor the spline_formula is provided. If not provided by the user, internally will be set to 4

log_transform

whether the data should be log-transformed by certain methods (see splines_kmeans)

drop_levels

Logical, whether to perform droplevels on the grouping variable (i.e. remove empty levels)

Details

If neither spline_formula nor basis_matrix is given, then by default, the function will create a basis matrix based on the formula:

1
2
spline_formula = ~Group:ns(Timepoint, df=4) + Group +
 0

Note that the meta data will have levels dropped (via droplevels).

Input to data that is given as a class DataFrame or data.frame will be converted to class matrix. The reason for this is that use of a data.frame creates errors in taking duplicate rows/columns of SummarizedExperiment, as in bootstrapping. Users who absolutely want the object to hold a object that is not a matrix can construct a SummarizedExperiment object (which will not convert the input into a matrix), and use this as input to create_moanin_model.

Value

An object of class Moanin

Slots

time_variable_name

character value giving the column in colData that defines the time variable (must be of class numeric)

group_variable_name

character value giving the column in colData that defines the grouping variable (must be of class factor)

basis_matrix

A basis matrix, where each row corresponds to the evaluation of a sample on the basis function (thus one column for each basis function).

spline_formula

a formula. The formula used in creating the basis matrix

degrees_of_freedom

a numeric integer. Number of degrees of freedom used in creating basis matrix. If NULL, degrees of freedom is not known (usually if user provided basis without degrees of freedom)

log_transform

logical, whether to log-transform the data for certain methods

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
# Load some data
data(exampleData)

# Use the default options
moanin = create_moanin_model(data=testData,meta=testMeta)
moanin

# Change the number of degrees of freedom
moanin = create_moanin_model(data=testData,meta=testMeta, 
   degrees_of_freedom=6)
moanin

NelleV/moanin documentation built on July 28, 2021, 7:34 p.m.