matrix_to_long {proBatch} | R Documentation

## Wide to long conversion

### Description

Convert from wide matrix to a long data frame representation

### Usage

    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. Usually the log transformed version of the original data
`sample_annotation` | data matrix with: `sample_id_col` (this can be repeated as row names) biological covariates technical covariates (batches etc)
`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 file, where the filenames (colnames of the data matrix are found)
`step` | normalization step (e.g. `Raw` or `Quantile_normalized` or `qNorm_ComBat`). 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

    proteome_long <- matrix_to_long(example_proteome_matrix,
    example_sample_annotation)

[Package proBatch version 1.0.0 Index]