matrix_to_long: Wide to long conversion

Description Usage Arguments Value See Also Examples

View source: R/auxiliary.R

Description

Convert from wide matrix to a long data frame representation

Usage

1
2
3
4
5
6
7
8
matrix_to_long(
  data_matrix,
  sample_annotation = NULL,
  feature_id_col = "peptide_group_label",
  measure_col = "Intensity",
  sample_id_col = "FullRunName",
  step = NULL
)

Arguments

data_matrix

features (in rows) vs samples (in columns) matrix, with feature IDs in rownames and file/sample names as colnames. See "example_proteome_matrix" for more details (to call the description, use help("example_proteome_matrix"))

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.

measure_col

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

sample_id_col

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

step

normalization step (e.g. Raw or Normalized. Useful if consecutive steps are compared in plots. Note that in plots these are usually ordered alphabetically, so it's worth naming with numbers, e.g. 1_raw, 2_quantile

Value

df_long (proBatch) like data frame

See Also

Other matrix manipulation functions: long_to_matrix()

Examples

1
2

proBatch documentation built on Nov. 8, 2020, 4:55 p.m.