Learn R Programming

baldur (version 0.0.4)

calculate_mean_sd_trends: Calculate the Mean-Variance trend

Description

[Experimental]

Calculates the mean and standard deviation of each row (peptide) and adds them as new columns. Assumes that the condition names are the names in the design matrix.

Usage

calculate_mean_sd_trends(data, design_matrix, auxiliary_columns = c())

Value

A tibble or data.frame with the mean and sd vectors

Arguments

data

A tibble or data.frame to annotate with mean and sd

design_matrix

A design matrix for the data (see example).

auxiliary_columns

Names of columns in the design matrix that does not have corresponding data in the data set. For example, this can be co-founding variables such as bashes.

Examples

Run this code

# Setup model matrix
design <- model.matrix(~ 0 + factor(rep(1:2, each = 3)))
colnames(design) <- paste0("ng", c(50, 100))

yeast %>%
    # Normalize data
    psrn("identifier") %>%
    # Get mean-variance trends
    calculate_mean_sd_trends(design)

Run the code above in your browser using DataLab