hlaCallsGranthamDistance {midasHLA} | R Documentation

## Calculate Grantham distance between HLA alleles

### Description

`hlaCallsGranthamDistance` calculate Grantham distance between two HLA alleles of a given, using original formula by Grantham R. 1974..

### Usage

    hlaCallsGranthamDistance(
      hla_calls,
      genes = c("A", "B", "C"),
      aa_selection = "binding_groove"
    )

### Arguments

`hla_calls` | HLA calls data frame, as returned by `readHlaCalls` function.
`genes` | Character vector specifying genes for which allelic distance should be calculated.
`aa_selection` | String specifying variable region in peptide binding groove which should be considered for Grantham distance calculation. Valid choices includes: `"binding_groove"`, `"B_pocket"`, `"F_pocket"`. See details for more information.

### Details

Grantham distance is calculated only for class I HLA alleles. First exons forming the variable region in the peptide binding groove are selected. Here we provide option to choose either `"binding_groove"` - exon 2 and 3 (positions 1-182 in IMGT/HLA alignments, however here we take 2-182 as many 1st positions are missing), `"B_pocket"` - residues 7, 9, 24, 25, 34, 45, 63, 66, 67, 70, 99 and `"F_pocket"` - residues 77, 80, 81, 84, 95, 116, 123, 143, 146, 147. Then all the alleles containing gaps, stop codons or indels are discarded. Finally distance is calculated for each pair.

See Robinson J. 2017. for more details on the choice of exons 2 and 3.

### Value

Data frame of normalized Grantham distances between pairs of alleles for each specified HLA gene. First column (`ID`) is the same as in `hla_calls`, further columns are named as given by `genes`.

### Examples

    hlaCallsGranthamDistance(MiDAS_tut_HLA, genes = "A")

[Package midasHLA version 1.2.0 Index]