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.

#' @title colSums #' @method colSums mass_dataset #' @param x x #' @param na.rm na.rm #' @param dims dims #' @export #' @rdname arithmetic-mass_dataset #' @return vector object

#' @title rowSums #' @method rowSums mass_dataset #' @param x x #' @param na.rm na.rm #' @param dims dims #' @export #' @rdname arithmetic-mass_dataset #' @return vector object

#' @title colMeans #' @method colMeans mass_dataset #' @param x x #' @param na.rm na.rm #' @param dims dims #' @export #' @rdname arithmetic-mass_dataset #' @return vector object

#' @title rowMeans #' @method rowMeans mass_dataset #' @param x x #' @param na.rm na.rm #' @param dims dims #' @export #' @rdname arithmetic-mass_dataset #' @return vector object

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

# S3 method for mass_dataset
abs(x)

# S3 method for mass_dataset
sqrt(x)

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

# S4 method for mass_dataset,numeric
+(e1, e2)

# S4 method for mass_dataset,numeric
-(e1, e2)

# S4 method for mass_dataset,numeric
*(e1, e2)

# S4 method for mass_dataset,numeric
/(e1, e2)

# S4 method for mass_dataset,numeric
>(e1, e2)

# S4 method for mass_dataset,numeric
>=(e1, e2)

# S4 method for mass_dataset,numeric
<(e1, e2)

# S4 method for mass_dataset,numeric
<=(e1, e2)

# S4 method for mass_dataset,numeric
==(e1, e2)

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

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

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

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

Arguments

x

x

base

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

center

center

scale

scale

e1

a mass_dataset class object

e2

numeric

na.rm

na.rm

dims

dims

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.

mass_dataset object

mass_dataset object

mass_dataset object

mass_dataset object

mass_dataset object

A logical data.frame

A logical data.frame

A logical data.frame

A logical data.frame

A logical data.frame

result

vector object

vector object

vector object

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.

colSums.mass_dataset = function(x, na.rm = FALSE, dims = 1) colSums(x@expression_data, na.rm = na.rm, dims = dims)

rowSums.mass_dataset = function(x, na.rm = FALSE, dims = 1) rowSums(x@expression_data, na.rm = na.rm, dims = dims)

colMeans.mass_dataset = function(x, na.rm = FALSE, dims = 1) colMeans(x@expression_data, na.rm = na.rm, dims = dims)

rowMeans.mass_dataset = function(x, na.rm = FALSE, dims = 1) rowMeans(x@expression_data, na.rm = na.rm, dims = dims)

Author

Xiaotao Shen shenxt1990@outlook.com

Xiaotao Shen shenxt1990@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) {
# Assuming 'dataset' is a mass_dataset object
transformed_dataset <- sqrt.mass_dataset(dataset)
}