knitr::opts_chunk$set( collapse = TRUE, comment = "#>" )
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)
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:
probs
a vector with the probabilities for groups A, AB, B and O, respectively; origin
option (with replace = TRUE
we can generate a data frame without limitations on the number of rows);mean
and sd
given by the user, values truncated by lower
and upper
boundaries;uk = TRUE
, Donor Risk Index is copmputed as described by transplantr 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)$)
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:
probs_abo
a vector with the probabilities for groups A, AB, B and O, respectively (here by default, we assumed group O patients are more frequent); origin
option (with replace = TRUE
we can generate a data frame without limitations on the number of rows);mean
and sd
given by the user, values truncated by lower
and upper
boundaries;probs_cpra
for 0%, 1%-50%, 51%-85% and 86%-100%, respectively. Within the groups > 0%, cPRA are computed as random values from distributions $P(\lambda = 30)$, $P(\lambda = 70)$ and $P(\lambda = 90)$;D10K
that are a match to each transplant candidate. This score takes into account a patient’s blood type, HLA type and cPRA value. A patient with a MS = 1 is defined as easy to match and a MS = 10 as difficult to match.uk = TRUE
, Recipient Risk Index is copmputed as described by transplantr. To compute RRI, variables age, time on dialysis (in days) and the probability of being diabetic (obtained from prob_dm
) are used. Also, we assumed all patients were on dialysis at time of listing.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.
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
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.