read_npx_wide_split_row: Split Olink wide files to sub-matrices.

View source: R/read_npx_wide.R

read_npx_wide_split_rowR Documentation

Split Olink wide files to sub-matrices.

Description

Olink datasets in wide format contain 2 or 3 rows with all columns NA marking sub-matrices of the data. This function takes advantage of that feature and splits the dataset into 3 or 4 sub-matrices. Each sub-matrix is used downstream to assemble a long data frame.

Specifically:

  • Head matrix consists of the first 2 rows of the wide dataset. This matrix contains the project name, the NPX Signature version that was used to generate the wide dataset and the quantification method.

  • Top matrix consists of the next 4 or 5 rows of the wide dataset, depending on the quantification method. This matrix contains data on assays, panels, columns with plate identifiers, columns with sample QC warnings and column with deviations from the internal controls. Note that not all the columns are present in all datasets and for all quantification methods. The local environment variable olink_wide_spec marks all the expected configurations.

  • Middle matrix is marked by rows with all columns NA above and below. This matrix contains sample identifiers, quantification measurements for all assays, plate identifiers, sample QC warnings and deviations from the internal controls.

  • Bottom matrix is located below the middle matrix and contains information of LOD, missing frequency, assay warning and data normalization approach. Note that this matrix is not available for all quantification methods.

Usage

read_npx_wide_split_row(df, file, data_type, format_spec)

Arguments

df

A tibble containing the full Olink dataset in wide format.

file

Path to Olink software output file in wide format. Expected one of file extensions "xls", "xlsx", "csv", or "txt".

data_type

Quantification method of the input data. One of "Ct", "NPX", or "Quantified". Defaults to NULL for auto-detection.

format_spec

A tibble derived from olink_wide_spec in the local environment containing the expected format of the Olink wide file based on the olink_platform and data_type.

Value

A named list of tibbles containing the sub-matrices of the Olink wide format file split on:

  • Head matrix as df_head

  • Top matrix as df_top

  • Middle as df_mid

  • Bottom matrix as df_bottom

Author(s)

Klev Diamanti

See Also

read_npx_wide read_npx_wide_npxs_version read_npx_wide_top read_npx_wide_middle read_npx_wide_bottom


OlinkAnalyze documentation built on June 24, 2026, 1:06 a.m.