olink_lod: Calculate LOD using Negative Controls or Fixed LOD

View source: R/olink_lod.R

olink_lodR Documentation

Description

Calculate LOD using Negative Controls or Fixed LOD

Usage

olink_lod(data, check_log = NULL, lod_file_path = NULL, lod_method = "NCLOD")

Arguments

data

npx data file

check_log

A named list returned by check_npx(). If NULL, check_npx() will be run internally using df.

lod_file_path

location of lod file from Olink. Only needed if lod_method = "FixedLOD" or "Both". Default NULL.

lod_method

method for calculating LOD using either "FixedLOD" or negative controls ("NCLOD"), or both ("Both"). Default NCLOD.

Value

A dataframe with 2 additional columns, LOD and PCNormalizedLOD if lod_method is FixedLOD or NCLOD. When Normalization = "Plate Control", LOD and PCNormalizedLOD are identical.

If lod_method is "Both", 4 additional columns will be added:

  • NCLOD - LOD calculated from negative controls and normalized based on normalization column

  • NCPCNormalizedLOD - PC Normalized LOD calculated from negative controls

  • FixedLOD - LOD calculated from fixed LOD file and normalized based on normalization column

  • FixedPCNormalizedLOD - PC Normalized LOD calculated from fixed LOD file

Examples

## Not run: 
  \donttest{
  try(
    {
      # This will fail if the files do not exist.

      # Import NPX data
      npx_data <- read_npx(filename = "path/to/npx_file")

      # Check NPX data
      check_log <- check_npx(df = npx_data)

      # Clean NPX data
      npx_data_clean <- clean_npx(
        df = npx_data,
        check_log = check_log
      )

      # Re-check NPX data
      check_log_clean <- check_npx(df = npx_data_clean)

      # Estimate LOD from negative controls
      npx_data_lod_nc <- olink_lod(
        data = npx_data_clean,
        check_log = check_log_clean,
        lod_method = "NCLOD"
      )

      # Estimate LOD from fixed LOD
      ## Locate the fixed LOD file
      lod_file_path <- "path/to/lod_file"

      npx_data_lod_Fixed <- olink_lod(
        data = npx_data,
        check_log = check_log_clean,
        lod_file_path = lod_file_path,
        lod_method = "FixedLOD"
      )

      # Estimate LOD from both negative controls and fixed LOD
      npx_data_lod_both <- olink_lod(
        data = npx_data,
        check_log = check_log_clean,
        lod_file_path = lod_file_path,
        lod_method = "Both"
      )
    }
  )
  }

## End(Not run)


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