MyNixOS website logo
Description

Normalize Laboratory Measurements by Age and Sex.

Provides functions for normalizing standard laboratory measurements (e.g. hemoglobin, cholesterol levels) according to age and sex, based on the algorithms described in "Personalized lab test models to quantify disease potentials in healthy individuals" (Netta Mendelson Cohen, Omer Schwartzman, Ram Jaschek, Aviezer Lifshitz, Michael Hoichman, Ran Balicer, Liran I. Shlush, Gabi Barbash & Amos Tanay, <doi:10.1038/s41591-021-01468-6>). Allows users to easily obtain normalized values for standard lab results, and to visualize their distributions. See more at <https://tanaylab.weizmann.ac.il/labs/>.

labNorm

R-CMD-check Codecov testcoverage GitHub issues GitHub R packageversion CRANstatus

labNorm provides functions for normalizing standard laboratory measurements (e.g. hemoglobin, cholesterol levels) according to age and sex. These normalizations are based on the algorithms described in the research paper “Personalized lab test models to quantify disease potentials in healthy individuals”.

This package allows users to easily obtain normalized values for their lab results and to project them on the population distribution. It can use reference distributions from Clalit HMO or UKBB. For more information go to: https://tanaylab.weizmann.ac.il/labs/

Installation

You can install the development version of labNorm from GitHub using the remotes package:

retmotes::install_github("tanaylab/labNorm")

Example

Normalize hemoglobin values for a group of subjects:

library(labNorm)

# Add a column for the normalized values
hemoglobin_data$quantile <- ln_normalize(
    hemoglobin_data$value,
    hemoglobin_data$age,
    hemoglobin_data$sex,
    "Hemoglobin"
)
#> → Downloading to a temporary directory '/tmp/RtmpnrSi5j'.
#> → Extracting data to '/tmp/RtmpnrSi5j'.
#> → Extracting data to '/tmp/RtmpnrSi5j'.
#> ✔ Data downloaded successfully.

head(hemoglobin_data)
#>   age    sex value   quantile
#> 1  20   male  9.39 0.01882213
#> 2  20   male 14.03 0.18674720
#> 3  20   male 14.44 0.27947363
#> 4  20   male 15.80 0.75195053
#> 5  20 female 12.06 0.24249167
#> 6  20 female 12.89 0.57451617

Plot the quantiles vs values for age 50-60:

library(ggplot2)
library(dplyr)
#> 
#> Attaching package: 'dplyr'
#> The following objects are masked from 'package:stats':
#> 
#>     filter, lag
#> The following objects are masked from 'package:base':
#> 
#>     intersect, setdiff, setequal, union

hemoglobin_data %>%
    filter(age >= 50 & age <= 60) %>%
    ggplot(aes(x = value, y = quantile, color = sex)) +
    geom_point() +
    theme_classic()

Plot the age/sex distribution of Hemoglobin:

ln_plot_dist("Hemoglobin")
Metadata

Version

1.0.1

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-darwin
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-darwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows