GvH vs HvG HLA mismatches: direction and homozygous loci
A mismatch has a direction. A host-versus-graft (HvG) mismatch is a donor allele that the recipient does not have; a graft-versus-host (GvH) mismatch is a recipient allele that the donor does not have. When both sides are heterozygous the two counts are equal, so the distinction is easy to miss. They differ when one side is homozygous at a locus.
This guide explains how the two counts are computed and where they diverge, using the definitions in HLA-Verify's published matching rules. It covers the arithmetic only. What a given direction of mismatch means for a transplant is a clinical question for the transplant centre and the literature it relies on.
The two definitions
The rules define them in terms of two-field names, after every name has been normalised against one IPD-IMGT/HLA release:
- HvG mismatches: donor names absent from the recipient (the rules gloss this as "host attacks graft").
- GvH mismatches: recipient names absent from the donor.
Both are counted per allele, like the grade itself. Another source may define direction differently, for example at antigen level, so check the definition before comparing counts from different systems.
Why heterozygous loci hide the difference
If both sides have two different alleles at a locus, every unmatched donor allele is paired with an unmatched recipient allele. One mismatch on the donor side means one mismatch on the recipient side.
Checked with the HLA-Verify engine at release 3.66.0: a recipient with B*07:02, B*44:02 and C*07:02, C*05:01, against a donor with B*07:02, B*44:03 and C*07:02, C*04:01, other loci identical, gives 6/8 with 2 HvG and 2 GvH mismatches. The counts agree, as they always will when both sides are heterozygous.
Where they diverge: homozygous loci
A homozygous person carries one allele twice. That breaks the symmetry. Four cases at the B locus, all computed at release 3.66.0 with HLA-A, -C and -DRB1 identical:
| Case | Recipient B | Donor B | Grade | HvG | GvH |
|---|---|---|---|---|---|
| Donor homozygous | B*07:02, B*44:02 | B*07:02, B*07:02 | 7/8 | 0 | 1 |
| Recipient homozygous | B*07:02, B*07:02 | B*07:02, B*44:02 | 7/8 | 1 | 0 |
| Both homozygous, same | B*07:02, B*07:02 | B*07:02, B*07:02 | 8/8 | 0 | 0 |
| Both homozygous, different | B*08:01, B*08:01 | B*07:02, B*07:02 | 8/10 (10/10 framework) | 2 | 2 |
Reading the first row: the donor has nothing the recipient lacks, so there is no HvG mismatch. The recipient has B*44:02, which the donor lacks, so there is one GvH mismatch. The second row is the mirror image.
The grade is the same in the first two rows, 7/8, even though the mismatch points in opposite directions. A single grade cannot tell them apart. That is the reason to report both counts whenever direction matters to the person reading the result.
How direction relates to the grade
The rules state that the bidirectional count of mismatches at a locus equals the larger of the two directional counts: max(HvG, GvH). In the first row above, max(0, 1) = 1, so the locus contributes one mismatch and the grade is 7/8. In the last row, max(2, 2) = 2.
That gives a quick consistency check for any report that lists both: at each locus, the mismatches implied by the grade should equal the larger directional count. If a report says 7/8 and shows two GvH mismatches at one locus, something is wrong.
Typing that only looks homozygous
The homozygous cases depend on the typing being genuinely homozygous. Two situations make a typing look homozygous when it may not be, and neither should be counted at face value:
- A single reported allele. A locus reported with one name instead of two could mean homozygosity, or a second allele that was not reported. HLA-Verify's typing check flags a locus with one reported allele as
single_allelerather than assuming the answer. - Low resolution. Two names that agree at the first field, such as two
B*07results, do not show that the person carries the same allele twice. At allele level, a first-field-only typing is reported aspotentialwithresolution_insufficientand left out of the count.
Whether a homozygous result reflects true homozygosity is a question for the typing laboratory. The arithmetic can only use what was reported.
Null alleles and direction
Directional counts compare names, and a null allele is a different name from its expressed relatives. Checked at release 3.66.0: a recipient with A*02:01, A*24:02 and a donor with A*02:01, A*24:09N gives 7/8, with 1 HvG and 1 GvH mismatch and a null_allele flag. Treating A*24:09N as an "A24" match would hide both directional mismatches. The null alleles guide covers why the N must stay in the name.
Counting direction in code
For one locus, with two-field names already normalised:
from collections import Counter
def directional(recipient, donor):
r, d = Counter(recipient), Counter(donor)
hvg = sum(1 for name in donor if name not in r) # donor names absent from recipient
gvh = sum(1 for name in recipient if name not in d) # recipient names absent from donor
matched = sum((r & d).values()) # multiset intersection
return matched, hvg, gvh
print(directional(["B*07:02", "B*44:02"], ["B*07:02", "B*07:02"])) # (1, 0, 1)
print(directional(["B*08:01", "B*08:01"], ["B*07:02", "B*07:02"])) # (0, 2, 2)
This mirrors the published rules: matched is the multiset intersection, and each direction counts names on one side that are absent from the other. The per-chromosome counting guide covers the grade itself. POST /v1/match returns the grade, the per-locus verdicts and both directional counts in one response, with the release named.
Frequently asked questions
What is the difference between GvH and HvG mismatches?
An HvG mismatch is a donor allele the recipient lacks; a GvH mismatch is a recipient allele the donor lacks. Both are counted per allele.
When do GvH and HvG counts differ?
They can differ only when exactly one side is homozygous at the locus. When both sides are heterozygous, or both are homozygous, the counts are equal.
Does a homozygous donor count as a mismatch?
It depends on the direction. A donor homozygous for an allele the recipient also carries adds no HvG mismatch, but the recipient's other allele is a GvH mismatch.
How do GvH and HvG relate to an 8/8 grade?
At each locus, the mismatches counted in the grade equal the larger of the two directional counts, so a grade alone cannot show which direction a mismatch points.
Sources
- https://github.com/jasonbrelsford/verifiable-science-envs/blob/main/sci_envs/families/matching/rules.py
- https://hlaverify.com/api
- https://huggingface.co/datasets/jason-brelsford/hla-bench
HLA-Verify is a research-and-evaluation tool for nomenclature and reference-release validation. It is not a medical device and this guide is not clinical advice. Send allele names, never patient identifiers.