calculate_feature_CV: Calculate CV distribution for each feature

View source: R/CV_calculation.R

calculate_feature_CVR Documentation

Calculate CV distribution for each feature

Description

Calculate CV distribution for each feature

Usage

calculate_feature_CV(df_long, sample_annotation = NULL,
  feature_id_col = "peptide_group_label",
  sample_id_col = "FullRunName", measure_col = "Intensity",
  batch_col = NULL, biospecimen_id_col = NULL, unlog = TRUE,
  log_base = 2, offset = 1)

Arguments

df_long

data frame where each row is a single feature in a single sample. It minimally has a sample_id_col, a feature_id_col and a measure_col, but usually also an m_score (in OpenSWATH output result file). See help("example_proteome") for more details.

sample_annotation

data frame with:

  1. sample_id_col (this can be repeated as row names)

  2. biological covariates

  3. technical covariates (batches etc)

. See help("example_sample_annotation")

feature_id_col

name of the column with feature/gene/peptide/protein ID used in the long format representation df_long. In the wide formatted representation data_matrix this corresponds to the row names.

sample_id_col

name of the column in sample_annotation table, where the filenames (colnames of the data_matrix are found).

measure_col

if df_long is among the parameters, it is the column with expression/abundance/intensity; otherwise, it is used internally for consistency.

batch_col

column in sample_annotation that should be used for batch comparison (or other, non-batch factor to be mapped to color in plots).

biospecimen_id_col

column in sample_annotation that defines a unique bio ID, which is usually a combination of conditions or groups. Tip: if such ID is absent, but can be defined from several columns, create new biospecimen_id column

unlog

(logical) whether to reverse log transformation of the original data

log_base

base of the logarithm for transformation

offset

small positive number to prevent 0 conversion to -Inf

Value

data frame with Total CV for each feature & (optionally) per-batch CV

Examples

CV_df = calculate_feature_CV(example_proteome, 
sample_annotation = example_sample_annotation, 
measure_col = 'Intensity', 
batch_col = 'MS_batch')

symbioticMe/proBatch documentation built on April 9, 2023, 11:59 a.m.