calculate_mean_sd_trends: Calculate the Mean-Variance trend

View source: R/calculate_mean_sd_trends.R

calculate_mean_sd_trendsR Documentation

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)

Arguments

data

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

design_matrix

A design matrix for the data (see example).

Value

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

Examples


# 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)

baldur documentation built on Sept. 18, 2023, 9:07 a.m.