k96nb01 / immunogenetr_package

0 stars 0 forks source link

Add an argument for homozygous alleles to mismatch functions #3

Closed k96nb01 closed 2 months ago

k96nb01 commented 3 months ago

The mismatch functions count a homozygous result as a single mismatch:

GL_string_recip <- "HLA-A*29:02+HLA-A*30:02"
GL_string_donor_homozygous <- "HLA-A*03:01+HLA-A*03:01"
GL_string_donor_heterozygous <- "HLA-A*03:01+HLA-A*68:01"

HLA_mismatch_number_HvG(GL_string_recip, GL_string_donor_homozygous, "A")
HLA_mismatch_number_HvG(GL_string_recip, GL_string_donor_heterozygous, "A")

This is the most common way to handle this, but we should give the option of having both alleles in a homozygous type be counted. Something like: HLA_mismatch_number_HvG(GL_string_recip, GL_string_donor_homozygous, locus, homozygous_count = 2), with 1 being the default.