Preparing Olink Long Format Data for Upload to Mass Dynamics

Uploading Olink data into Mass Dynamics

This FAQ includes a description and R sample code to read Olink NPX data in long format and transform it into a wide-format table with unlogged intensities. The output is a *.csv file that can be uploaded to the Mass Dynamics platform.

Sample data: https://figshare.com/articles/dataset/Raw_Olink_data/22811915?file=40553531 

Expected Olink Long Format

A CSV file from Olink in long format including the following columns: SampleId, NPX, OlinkID, Uniprot, Assay, Panel.

Prepare the data for Mass Dynamics

1. Unlog the NPX values:

  • NPX values (which are in log2 scale) are converted to linear scale using 2^NPX.
  • Missing values (NA) are replaced with 0 to be recognised as such by the Mass Dynamics system.
2. Pivot to wide format:

  • Each SampleID becomes a column.
  • The values are filled with the unlogged NPX intensities.
  • Rows (biological targets) are identified by OlinkID, UniProt, Assay, and Panel.
  • Save the file as csv and upload to Mass Dynamics, e.g intensities_table.csv.

R Code snippet to prepare the data

Upload to Mass Dynamics

1. Upload the intensities_table.csv. file 

2. Follow the steps to select the columns containing protein intensities.

3. Map protein metadata as follows:
    • OlinkID -> ProteinGroup
    • Uniprot -> ProteinIds
    • Assay -> GeneName
    • Panel -> Description

4. Follow the steps to upload the experiment design 

Caveats for Olink Data

While the core functionalities in Mass Dynamics—such as normalization and differential abundance analysis—are generally applicable to Olink NPX data, it is important to note the following:

  • Validation is limited: We have not yet performed comprehensive benchmarking or validation of these workflows across a wide range of Olink datasets.

  • Custom analyses may be needed: If your project requires specific types of statistical or bioinformatics analyses tailored to Olink data, these can be supported through custom scripting capabilities integrated into the app.

We recommend contacting the Mass Dynamics team if you require tailored support or need to implement Olink-specific workflows.

Code in text format

library(readr)

library(tidyr)

library(dplyr)

 

# Read Olink long-format data

data <- read_delim("path/to/your_olink_data.csv", 

                   delim = ";", escape_double = FALSE, trim_ws = TRUE)

 

# Convert log2 NPX to linear scale

data$NPX_unlogged <- 2^data$NPX

data$NPX_unlogged[is.na(data$NPX_unlogged)] <- 0  # Replace NAs with 0 

 

# Pivot to wide format: one row per protein, one column per sample

intensities_table <- data %>%

  pivot_wider(

    id_cols = c(OlinkID, UniProt, Assay, Panel),

    names_from = SampleID,

    values_from = NPX_unlogged

  )

 

# Write the output table to a CSV file

write_csv(intensities_table, "path/to/intensities_table.csv")