Skip to contents

This function applies a log transformation to the expression data contained within a mass_dataset object.

This function applies an absolute value transformation to the expression data contained within a mass_dataset object.

This function takes a mass_dataset object and applies the square root transformation to the expression data stored in the object. It also updates the process_info attribute to log the transformation.

Usage

# S3 method for class 'mass_dataset'
log(x, base = exp(1))

# S3 method for class 'mass_dataset'
abs(x)

# S3 method for class 'mass_dataset'
sqrt(x)

# S3 method for class 'mass_dataset'
scale(x, center = TRUE, scale = TRUE)

# S4 method for class 'mass_dataset,numeric'
e1 + e2

# S4 method for class 'mass_dataset,numeric'
e1 - e2

# S4 method for class 'mass_dataset,numeric'
e1 * e2

# S4 method for class 'mass_dataset,numeric'
e1/e2

# S4 method for class 'mass_dataset,numeric'
e1 > e2

# S4 method for class 'mass_dataset,numeric'
e1 >= e2

# S4 method for class 'mass_dataset,numeric'
e1 < e2

# S4 method for class 'mass_dataset,numeric'
e1 <= e2

# S4 method for class 'mass_dataset,numeric'
e1 == e2

# S4 method for class 'mass_dataset'
colSums(x, na.rm = FALSE, dims = 1)

# S4 method for class 'mass_dataset'
rowSums(x, na.rm = FALSE, dims = 1)

# S4 method for class 'mass_dataset'
colMeans(x, na.rm = FALSE, dims = 1)

# S4 method for class 'mass_dataset'
rowMeans(x, na.rm = FALSE, dims = 1)

Arguments

x

A mass_dataset object.

base

The base of the logarithm. The default is exp(1), which corresponds to the natural logarithm.

center

Logical or numeric value passed to base::scale() to control centering.

scale

Logical or numeric value passed to base::scale() to control scaling.

e1

A mass_dataset object.

e2

A numeric value to compare against.

na.rm

Logical; should missing values be removed before averaging?

dims

Integer passed to base::rowMeans() for compatibility.

Value

Returns a mass_dataset object with log-transformed expression data.

Returns a mass_dataset object with expression data transformed to absolute values.

A mass_dataset object with updated expression_data and process_info.

A mass_dataset object with scaled expression_data.

A mass_dataset object with updated expression_data.

A mass_dataset object with updated expression_data.

A mass_dataset object with updated expression_data.

A mass_dataset object with updated expression_data.

A logical matrix-like object indicating which values are greater than e2.

A logical matrix-like object indicating which values are greater than or equal to e2.

A logical matrix-like object indicating which values are less than e2.

A logical matrix-like object indicating which values are less than or equal to e2.

A logical matrix-like object indicating which values are equal to e2.

A numeric vector containing the sums of each sample column.

A numeric vector containing the sums of each feature row.

A numeric vector containing the means of each sample column.

A numeric vector containing the means of each feature row.

Details

The log.mass_dataset function takes a mass_dataset object as its input, and applies a log transformation to its expression data. This can be useful for various downstream analyses that assume or benefit from log-transformed data. The function also updates the process_info slot of the mass_dataset object to include information about the log transformation.

The abs.mass_dataset function takes a mass_dataset object as its input and applies an absolute value transformation to its expression data. This can be useful in scenarios where negative values in the dataset need to be transformed to their positive counterparts for subsequent analyses.

Additionally, the function updates the process_info slot of the mass_dataset object to capture details about the absolute value transformation process.

  1. Extracts the expression_data from the mass_dataset object.

  2. Applies the square root transformation to the expression_data.

  3. Updates the expression_data in the mass_dataset object.

  4. Logs the transformation in the process_info attribute, including the package name, function name, parameters, and time.

Author

Xiaotao Shen xiaotao.shen@outlook.com

Examples

# Assuming 'md' is a 'mass_dataset' object
# log_transformed_md <- log(md, base = 2)

# Assuming 'md' is a 'mass_dataset' object
# abs_transformed_md <- abs.mass_dataset(md)

if (FALSE) { # \dontrun{
# Assuming 'dataset' is a mass_dataset object
transformed_dataset <- sqrt.mass_dataset(dataset)
} # }