knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

Main functions

This package has 3 main functions, with them we can generate simulated data for a pool of donors, a set of kidney transplant candidates and the respective HLA-antibodies for those patients HLA sensitized.

library(simK)

Donors

A data frame with information for a pool of simulated donors can be generated with the function donors_df():

donors_df(n = 10,
          replace = TRUE,
          origin = 'PT',
          probs = c(0.4658, 0.0343, 0.077, 0.4229),
          lower = 18, upper = 75, mean = 55, sd = 15,
          uk = FALSE,
          n_seed = 3)

For a given number of rows n, a data frame is generated with columns:

HLA population origin has currently as valid options 'PT' for Portuguese, and populations available from US National Marrow Donor Program:

Defining n_seed allows for reproducibility.

:information_source: to compute DRI as decribed on {transplantr}, we generated variables: height ($N(165,20)$); hypertension (with probability $0.43$); sex (with probability $0.55$ for man); CMV+ (with probability $0.9$); hospital stay ($P(\lambda = 4)$); and GFR by age (<30 $N(116,10)$; 30-39 $N(107,10)$; 40-49 $N(99,10)$; 50-59 $N(93,10)$; 60-69 $N(85, 10)$; >=70 $N(75, 10)$)

Candidates

A simulated waiting list for kidney transplant candidates, can be generated with candidates_df():

candidates_df(n = 10,
              replace = TRUE,
              origin = 'PT',
              probs_abo = c(0.43, 0.03, 0.08, 0.46),
              probs_cpra = c(0.7, 0.1, 0.1, 0.1),
              lower = 18, upper = 75, mean = 45, sd = 15,
              prob_dm = 0.12,
              uk = TRUE,
              n_seed = 3)

For a given number of n rows, a data frame is generated with columns:

HLA population origin can be defined from options: 'PT','API','AFA','CAU' and 'HIS', as reported for donors_df() data frame.

Defining n_seed allows for reproducibility.

HLA antibodies

the function Abs_df() allows to generate a data frame with HLA antibodies from a candidates waiting list:

Abs_df(candidates = candidates_df(n=10),
       origin = 'PT',
       n_seed = 3)

as inputs, this function requires a data set with an ID and patients HLA information (HLA typing and cPRA value) with the same format as provided by candidates_df(). Defining n_seed allows for reproducibility.

HLA population origin must be defined in accordance with functions candidates_df().

For PT origin, all these functions rely on HLA typing at intermediate resolution as described at Lima et al, 2013.

For NMDP populations, HLA typing were described by Gragert et al, 2013



balima78/simK documentation built on May 23, 2023, 5:02 p.m.