Learn R Programming

immunogenetr

immunogenetr is a comprehensive toolkit for clinical HLA informatics. It is built on tidyverse principles and makes use of genotype list string (GL string, https://glstring.org/) for storing and using HLA genotype data.

Specific functionalities of this library include:

  • Coercion of HLA data in tabular format to and from GL string.
  • Calculation of matching and mismatching in all directions, with multiple output formats.
  • Automatic formatting of HLA data for searching within a GL string.
  • Truncation of molecular HLA data to a specific number of fields.
  • Reading HLA genotypes in HML files and extracting the GL string.

Table of Contents

Installation

You may install immunogenetr from CRAN with the below line of code:

install.packages("immunogenetr")

Usage

To demonstrate some functionality of immunogenetr we will use an internal dataset to perform match grades for a putative recipient/donor pair.

library(immunogenetr)
library(tidyverse)

# The "HLA_typing_1" dataset is installed with immunogenetr, and contains high resolution typing at all classical 
# HLA loci for ten individuals.

print(HLA_typing_1)
patientA1A2C1C2B1B2DRB345_1DRB345_2DRB1_1DRB1_2DQA1_1DQA1_2DQB1_1DQB1_2DPA1_1DPA1_2DPB1_1DPB1_2
1A*24:02A*29:02C*07:04C*16:01B*44:02B*44:03DRB5*01:01DRB5*01:01DRB1*15:01DRB1*15:01DQA1*01:02DQA1*01:02DQB1*06:02DQB1*06:02DPA1*01:03DPA1*01:03DPB1*03:01DPB1*04:01
2A*02:01A*11:05C*07:01C*07:02B*07:02B*08:01DRB3*01:01DRB4*01:03DRB1*03:01DRB1*04:01DQA1*03:03DQA1*05:01DQB1*02:01DQB1*03:01DPA1*01:03DPA1*01:03DPB1*04:01DPB1*04:01
3A*02:01A*26:18C*02:02C*03:04B*27:05B*54:01DRB3*02:02DRB4*01:03DRB1*04:04DRB1*14:54DQA1*01:04DQA1*03:01DQB1*03:02DQB1*05:02DPA1*01:03DPA1*02:02DPB1*02:01DPB1*05:01
4A*29:02A*30:02C*06:02C*07:01B*08:01B*13:02DRB4*01:03DRB4*01:03DRB1*04:01DRB1*07:01DQA1*02:01DQA1*03:01DQB1*02:02DQB1*03:02DPA1*01:03DPA1*02:01DPB1*01:01DPB1*16:01
5A*02:05A*24:02C*07:18C*12:03B*35:03B*58:01DRB3*02:02DRB3*02:02DRB1*03:01DRB1*14:54DQA1*01:04DQA1*05:01DQB1*02:01DQB1*05:03DPA1*01:03DPA1*02:01DPB1*10:01DPB1*124:01
6A*01:01A*24:02C*07:01C*14:02B*49:01B*51:01DRB3*03:01DRBX*NNNNDRB1*08:01DRB1*13:02DQA1*01:02DQA1*04:01DQB1*04:02DQB1*06:04DPA1*01:03DPA1*01:04DPB1*04:01DPB1*15:01
7A*03:01A*03:01C*03:03C*16:01B*15:01B*51:01DRB4*01:01DRBX*NNNNDRB1*01:01DRB1*07:01DQA1*01:01DQA1*02:01DQB1*02:02DQB1*05:01DPA1*01:03DPA1*01:03DPB1*04:01DPB1*04:01
8A*01:01A*32:01C*06:02C*07:02B*08:01B*37:01DRB3*02:02DRB5*01:01DRB1*03:01DRB1*15:01DQA1*01:02DQA1*05:01DQB1*02:01DQB1*06:02DPA1*01:03DPA1*02:01DPB1*04:01DPB1*14:01
9A*03:01A*30:01C*07:02C*12:03B*07:02B*38:01DRB3*01:01DRB5*01:01DRB1*03:01DRB1*15:01DQA1*01:02DQA1*05:01DQB1*02:01DQB1*06:02DPA1*01:03DPA1*01:03DPB1*04:01DPB1*04:01
10A*02:05A*11:01C*07:18C*16:02B*51:01B*58:01DRB3*03:01DRB5*01:01DRB1*13:02DRB1*15:01DQA1*01:02DQA1*01:03DQB1*06:01DQB1*06:09DPA1*01:03DPA1*01:03DPB1*02:01DPB1*104:01

immunogenetr uses genotype list strings (GL strings) for most functions, including the matching and mismatching functions. To easily convert the genotypes found in “HLA_typing_1” to GL strings we can use the HLA_columns_to_GLstring function:

HLA_typing_1_GLstring <- HLA_typing_1 %>% 
  mutate(GL_string = HLA_columns_to_GLstring(., HLA_typing_columns = A1:DPB1_2), .after = patient) %>% 
  # Note the syntax for the `HLA_columns_to_GLstring` arguments - when this function is used inside 
  # of a `mutate` function to make a new column in a data frame, "." is used in the first argument 
  # to tell the function to use the working data frame as the source of the HLA typing columns.
  select(patient, GL_string)

print(HLA_typing_1_GLstring)
patientGL_string
1HLA-A*24:02+HLA-A*29:02^HLA-C*07:04+HLA-C*16:01^HLA-B*44:02+HLA-B*44:03^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*15:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*01:02^HLA-DQB1*06:02+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*03:01+HLA-DPB1*04:01
2HLA-A*02:01+HLA-A*11:05^HLA-C*07:01+HLA-C*07:02^HLA-B*07:02+HLA-B*08:01^HLA-DRB3*01:01+HLA-DRB3*01:03^HLA-DRB1*03:01+HLA-DRB1*04:01^HLA-DQA1*03:03+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*03:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01
3HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
4HLA-A*29:02+HLA-A*30:02^HLA-C*06:02+HLA-C*07:01^HLA-B*08:01+HLA-B*13:02^HLA-DRB3*01:03+HLA-DRB3*01:03^HLA-DRB1*04:01+HLA-DRB1*07:01^HLA-DQA1*02:01+HLA-DQA1*03:01^HLA-DQB1*02:02+HLA-DQB1*03:02^HLA-DPA1*01:03+HLA-DPA1*02:01^HLA-DPB1*01:01+HLA-DPB1*16:01
5HLA-A*02:05+HLA-A*24:02^HLA-C*07:18+HLA-C*12:03^HLA-B*35:03+HLA-B*58:01^HLA-DRB3*02:02+HLA-DRB3*02:02^HLA-DRB1*03:01+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*05:03^HLA-DPA1*01:03+HLA-DPA1*02:01^HLA-DPB1*10:01+HLA-DPB1*124:01
6HLA-A*01:01+HLA-A*24:02^HLA-C*07:01+HLA-C*14:02^HLA-B*49:01+HLA-B*51:01^HLA-DRB3*03:01^HLA-DRB1*08:01+HLA-DRB1*13:02^HLA-DQA1*01:02+HLA-DQA1*04:01^HLA-DQB1*04:02+HLA-DQB1*06:04^HLA-DPA1*01:03+HLA-DPA1*01:04^HLA-DPB1*04:01+HLA-DPB1*15:01
7HLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01
8HLA-A*01:01+HLA-A*32:01^HLA-C*06:02+HLA-C*07:02^HLA-B*08:01+HLA-B*37:01^HLA-DRB3*02:02+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*02:01^HLA-DPB1*04:01+HLA-DPB1*14:01
9HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01
10HLA-A*02:05+HLA-A*11:01^HLA-C*07:18+HLA-C*16:02^HLA-B*51:01+HLA-B*58:01^HLA-DRB3*03:01+HLA-DRB3*01:01^HLA-DRB1*13:02+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*01:03^HLA-DQB1*06:01+HLA-DQB1*06:09^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*02:01+HLA-DPB1*104:01

The “HLA_typing_1_GLstring” data frame now contains a row with a GL string for each individual, containing their full HLA genotype in a single string. Let’s select one individual to act as a recipient, and one to act as a donor.

# Select one case each for recipient and donor.
HLA_typing_1_GLstring_recipient <- HLA_typing_1_GLstring %>% 
  filter(patient == 7) %>% 
  rename(GL_string_recipient = GL_string, case = patient)

HLA_typing_1_GLstring_donor <- HLA_typing_1_GLstring %>% 
  filter(patient == 9) %>% 
  rename(GL_string_donor = GL_string) %>% 
  select(-patient)

# Combine the tables so recipient and donor are on the same row.
HLA_typing_1_recip_donor <- bind_cols(
  HLA_typing_1_GLstring_recipient, 
  HLA_typing_1_GLstring_donor
  )

print(HLA_typing_1_recip_donor)
caseGL_string_recipientGL_string_donor
7HLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01

We now have a data frame with a recipient and donor HLA genotype on one row. Let’s try out some of the mismatching functions on this data.

HLA_typing_1_recip_donor_mismatches <- HLA_typing_1_recip_donor %>% 
  mutate(A_MM_GvH = HLA_mismatch_logical(
                      GL_string_recipient, 
                      GL_string_donor, 
                      "HLA-A", 
                      direction = "GvH"), 
                    .after = case) %>% 
  mutate(A_MM_HvG = HLA_mismatch_logical(
                      GL_string_recipient, 
                      GL_string_donor, 
                      "HLA-A", 
                      direction = "HvG"), 
                    .after = A_MM_GvH)

print(HLA_typing_1_recip_donor_mismatches)
caseA_MM_GvHA_MM_HvGGL_string_recipientGL_string_donor
7TRUETRUEHLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01

The HLA_mismatch_logical function determines if there are any mismatches at a particular locus. We’ve determined that at the HLA-A locus there are not any mismatches in the graft-versus-host direction, but are in the host-versus-graft direction. We can use the HLA_mismatched_alleles function to tell us what those mismatches are:

HLA_typing_1_recip_donor_mismatched_allles <- HLA_typing_1_recip_donor %>% 
  mutate(A_HvG_MMs = HLA_mismatched_alleles(
                        GL_string_recipient, 
                        GL_string_donor, 
                        "HLA-A", 
                        direction = "HvG"), 
                      .after = case)

print(HLA_typing_1_recip_donor_mismatched_allles)
caseA_HvG_MMsGL_string_recipientGL_string_donor
7HLA-A*30:01HLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01

The HLA_mismatched_alleles function reported that the “HLA-A*30:01” allele was mismatched in the HvG direction. Sometimes, however, we simply want to know how many mismatches are at a particular locus. We can do that with the HLA_mismatch_number function:

# Determine the number of bidirectional mismatches at several loci.
HLA_typing_1_recip_donor_MM_number <- HLA_typing_1_recip_donor %>% 
  mutate(ABCDRB1_MM = HLA_mismatch_number(
                        GL_string_recipient, 
                        GL_string_donor, 
                        c("HLA-A", "HLA-B", "HLA-C", "HLA-DRB1"), 
                        direction = "bidirectional"), 
                      .after = case)

print(HLA_typing_1_recip_donor_MM_number)
caseABCDRB1_MMGL_string_recipientGL_string_donor
7HLA-A=1HLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01

We might want to calculate an HLA match summary for stem cell transplantation. We can use the HLA_match_summarry_HCT function for this:

# The match_grade argument of "Xof8" will return the number of matches at the HLA-A, B, C, and DRB1 loci.
HLA_typing_1_recip_donor_8of8_matching <- HLA_typing_1_recip_donor %>% 
  mutate(ABCDRB1_matching = HLA_match_summary_HCT(
                              GL_string_recipient, 
                              GL_string_donor, 
                              direction = "bidirectional", 
                              match_grade = "Xof8"), 
                            .after = case)

print(HLA_typing_1_recip_donor_8of8_matching)
caseABCDRB1_matchingGL_string_recipientGL_string_donor
71HLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01

Clearly, this recipient and donor are not a great match. Let’s see how we could use this workflow to find the best-matched donor from several options. To do this, we’ll choose a case from “HLA_typing_1” and compare it to all the cases in that data set:

# Select one case to be the recipient.
HLA_typing_1_GLstring_candidate <- HLA_typing_1_GLstring %>% 
  filter(patient == 3) %>% 
  select(GL_string) %>% 
  rename(GL_string_recip = GL_string)

# Join the recipient to the 10-donor list and perform matching
HLA_typing_1_GLstring_donors <- HLA_typing_1_GLstring %>% 
  rename(GL_string_donor = GL_string, donor = patient) %>% 
  cross_join(HLA_typing_1_GLstring_candidate) %>%
  mutate(ABCDRB1_matching = HLA_match_summary_HCT(
                              GL_string_recip, 
                              GL_string_donor, 
                              direction = "bidirectional", 
                              match_grade = "Xof8"), 
                            .after = donor) %>%
  arrange(desc(ABCDRB1_matching))

print(HLA_typing_1_GLstring_donors)
donorABCDRB1_matchingGL_string_donorGL_string_recip
38HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
21HLA-A*02:01+HLA-A*11:05^HLA-C*07:01+HLA-C*07:02^HLA-B*07:02+HLA-B*08:01^HLA-DRB3*01:01+HLA-DRB3*01:03^HLA-DRB1*03:01+HLA-DRB1*04:01^HLA-DQA1*03:03+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*03:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
51HLA-A*02:05+HLA-A*24:02^HLA-C*07:18+HLA-C*12:03^HLA-B*35:03+HLA-B*58:01^HLA-DRB3*02:02+HLA-DRB3*02:02^HLA-DRB1*03:01+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*05:03^HLA-DPA1*01:03+HLA-DPA1*02:01^HLA-DPB1*10:01+HLA-DPB1*124:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
10HLA-A*24:02+HLA-A*29:02^HLA-C*07:04+HLA-C*16:01^HLA-B*44:02+HLA-B*44:03^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*15:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*01:02^HLA-DQB1*06:02+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*03:01+HLA-DPB1*04:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
40HLA-A*29:02+HLA-A*30:02^HLA-C*06:02+HLA-C*07:01^HLA-B*08:01+HLA-B*13:02^HLA-DRB3*01:03+HLA-DRB3*01:03^HLA-DRB1*04:01+HLA-DRB1*07:01^HLA-DQA1*02:01+HLA-DQA1*03:01^HLA-DQB1*02:02+HLA-DQB1*03:02^HLA-DPA1*01:03+HLA-DPA1*02:01^HLA-DPB1*01:01+HLA-DPB1*16:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
60HLA-A*01:01+HLA-A*24:02^HLA-C*07:01+HLA-C*14:02^HLA-B*49:01+HLA-B*51:01^HLA-DRB3*03:01^HLA-DRB1*08:01+HLA-DRB1*13:02^HLA-DQA1*01:02+HLA-DQA1*04:01^HLA-DQB1*04:02+HLA-DQB1*06:04^HLA-DPA1*01:03+HLA-DPA1*01:04^HLA-DPB1*04:01+HLA-DPB1*15:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
70HLA-A*03:01+HLA-A*03:01^HLA-C*03:03+HLA-C*16:01^HLA-B*15:01+HLA-B*51:01^HLA-DRB3*01:01^HLA-DRB1*01:01+HLA-DRB1*07:01^HLA-DQA1*01:01+HLA-DQA1*02:01^HLA-DQB1*02:02+HLA-DQB1*05:01^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
80HLA-A*01:01+HLA-A*32:01^HLA-C*06:02+HLA-C*07:02^HLA-B*08:01+HLA-B*37:01^HLA-DRB3*02:02+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*02:01^HLA-DPB1*04:01+HLA-DPB1*14:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
90HLA-A*03:01+HLA-A*30:01^HLA-C*07:02+HLA-C*12:03^HLA-B*07:02+HLA-B*38:01^HLA-DRB3*01:01+HLA-DRB3*01:01^HLA-DRB1*03:01+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*05:01^HLA-DQB1*02:01+HLA-DQB1*06:02^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*04:01+HLA-DPB1*04:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01
100HLA-A*02:05+HLA-A*11:01^HLA-C*07:18+HLA-C*16:02^HLA-B*51:01+HLA-B*58:01^HLA-DRB3*03:01+HLA-DRB3*01:01^HLA-DRB1*13:02+HLA-DRB1*15:01^HLA-DQA1*01:02+HLA-DQA1*01:03^HLA-DQB1*06:01+HLA-DQB1*06:09^HLA-DPA1*01:03+HLA-DPA1*01:03^HLA-DPB1*02:01+HLA-DPB1*104:01HLA-A*02:01+HLA-A*26:18^HLA-C*02:02+HLA-C*03:04^HLA-B*27:05+HLA-B*54:01^HLA-DRB3*02:02+HLA-DRB3*01:03^HLA-DRB1*04:04+HLA-DRB1*14:54^HLA-DQA1*01:04+HLA-DQA1*03:01^HLA-DQB1*03:02+HLA-DQB1*05:02^HLA-DPA1*01:03+HLA-DPA1*02:02^HLA-DPB1*02:01+HLA-DPB1*05:01

We can see that donor 3 is the only donor with an 8/8 match for the recipient.

License

This project is licensed under the GNU General Public License v3.0.

Disclaimer

This library is intended for research use. Any application making use of this package in a clinical setting will need to be independently validated according to local regulations.

Copy Link

Version

Install

install.packages('immunogenetr')

Monthly Downloads

176

Version

1.0.1

License

GPL (>= 3)

Issues

Pull Requests

Stars

Forks

Maintainer

Nicholas Brown

Last Published

October 23rd, 2025

Functions in immunogenetr (1.0.1)

HLA_typing_1

Synthetic HLA typing data for 10 individuals for the HLA-A, B, C, DRB1, DRB3/4/5, DQB1, DQA1, DPB1 and DPA1 loci.
HLA_typing_LIS

Synthetic HLA typing data for 10 individuals for the HLA-A, B, C, DRB1, DRB3, DRB4, DRB5, DQB1, DQA1, DPB1 and DPA1 loci. Data formatted to resemble a HistoTrac table.
HLA_truncate

HLA_truncate
read_HML

read_HML
HLA_validate

HLA_validate
HLA_match_number

HLA_match_number
mismatch_table_2016

Consensus mismatch numbers for every possible allele combination at a single locus, from the 2016 publication.
HLA_match_summary_HCT

HLA_match_summary_HCT
GLstring_gene_copies_combine

GLstring_gene_copies_combine
GLstring_expand_longer

GLstring_expand_longer
Haplotype_frequencies

Ten HLA-A~C~B~DRB3/4/5~DRB1~DQA1~DQB1~DPA1~DPB1 haplotypes and their frequencies in the global population.
HLA_columns_to_GLstring

HLA_columns_to_GLstring
GLstring_genotype_ambiguity

GLstring_genotype_ambiguity
GLstring_genes_expanded

GLstring_genes_expanded
HLA_column_repair

HLA_column_repair
GLstring_genes

GLstring_genes
GLstring_to_ambiguity_table

GLstring_to_ambiguity_table
GLstring_regex

GLstring_regex
HLA_dictionary

Data on HLA alleles in the 2008 HLA dictionary
HLA_mismatch_number

HLA_mismatch_number
HLA_mismatch_logical

HLA_mismatch_logical
HLA_mismatch_base

HLA_mismatch_base
HLA_mismatch_alleles

HLA_mismatch_alleles
ambiguity_table_to_GLstring

ambiguity_table_to_GLstring
mismatch_table_2010

Consensus mismatch numbers for every possible allele combination at a single locus, from the 2010 publication.
HLA_mismatched_alleles

HLA_mismatched_alleles
HLA_prefix_remove

HLA_prefix_remove
HLA_prefix_add

HLA_prefix_add