Changelog
Source:NEWS.md
immunogenetr 1.2.0
CRAN release: 2026-04-14
Added
scopeparameter toHLA_match_summary_HCTwith options"locus"(default) and"genotype". Whenscope = "genotype"anddirection = "bidirectional", the function calculates GvH and HvG match summaries separately and returns the maximum of the two totals, rather than taking the minimum match at each locus before summing.Simplified
HLA_match_summary_HCTinternals: replaced the tibble parsing pipeline withstr_extract_all()andmap_int()for summing per-locus match counts.
immunogenetr 1.1.0
CRAN release: 2026-04-07
Internal code quality improvements: fixed typos in internal variable names, corrected test filenames, and cleaned up
globalVariables()declarations.Standardized all error messages to use
cli_abort()for consistent, informative error reporting across the package. Bumpedclidependency to >= 3.0.0.Added input validation to all exported functions. Functions now check for NULL, wrong types, and invalid parameter values before processing, providing clear error messages instead of cryptic failures. Added internal validation helper functions (
check_gl_string,check_data_frame,check_loci,check_logical_flag,check_homozygous_count,check_fields).Added
match.arg()validation formatch_gradeanddirectionparameters inHLA_match_summary_HCT.Refactored duplicated matching logic across
HLA_match_summary_HCT,HLA_match_number,HLA_mismatch_number, andHLA_mismatch_logical. Replaced repeated direction-branching code blocks with parameterized pipelines, significantly reducing code duplication with no changes to behavior.Optimized
HLA_mismatch_base: consolidated duplicated GvH/HvG mismatch calculation into a single parameterized code path, eliminated repeatedstrsplit()calls within the mismatch loop, and extracted duplicated locus-naming logic into a shared helper function.Optimized
HLA_mismatch_numberandHLA_mismatch_logicalto only compute the requested direction(s). Previously both functions always computed GvH and HvG regardless of the requested direction; now HvG, GvH, and SOT requests only compute a single direction, cuttingHLA_mismatch_basecalls in half. Bidirectional requests still compute both as needed. Also extracted duplicated multi-locus table-building code into internal helper functions.Expanded test coverage for
HLA_mismatch_logical,HLA_match_number, andHLA_mismatched_allelesusing themismatch_table_2010andmismatch_table_2016consensus reference tables, matching the existing comprehensive table-based tests inHLA_mismatch_number.Optimized
HLA_columns_to_GLstring: replaced 16 case-insensitive regex calls for locus detection with a singletolower()plusstartsWith()lookups (~7.5x faster), replaced the serologic namecase_whenwith a named vector lookup (~37x faster), and combined multiplestr_detect()calls for molecular typing detection into single patterns.Optimized
HLA_truncate: replaced four nearly-identicalif/elseblocks for field selection with a parameterized approach using computedkeep_cols/drop_colsvectors, reducing code duplication and improving maintainability.Optimized
ambiguity_table_to_GLstring: extracted acollapse_level()helper function to replace six repetitions of the conditionaldistinct()+summarise()pattern, significantly reducing code duplication.Optimized
GLstring_genotype_ambiguity: simplified the gene-separator error detection from a multi-step pipeline to a single vectorized check, and combined two separatestr_replace()+na_if()calls into one operation.Expanded test coverage for
HLA_column_repair,GLstring_genes,GLstring_regex, andread_HMLwith comprehensive tests covering format conversions, parameter combinations, edge cases, input validation, and error handling.Fixed
read_HMLto dynamically discover the XML namespace instead of hardcoding thed1:prefix. The function now usesxml_ns()to detect the namespace from the file, improving compatibility with HML files from different sources.Fixed null allele detection regex in
HLA_mismatch_baseto support locus names longer than 4 characters (e.g.HLA-DRB345). The lookbehind now allows up to 10 alphanumeric characters afterHLA-.Added a “Getting Started” vignette covering all major workflows: tabular-to-GL-string conversion, locus splitting, mismatch/match calculation, allele name utilities, and HML file reading.
Added a package-level help page (
?immunogenetr) organizing all exported functions and datasets by category.Added
inst/CITATIONfile for the package publication: Coskun & Brown (2026), “Immunogenetr: A comprehensive toolkit for clinical HLA informatics,” Human Immunology, 87(1):111619. doi:10.1016/j.humimm.2025.111619.
immunogenetr 1.0.1
CRAN release: 2025-10-22
- Added a disclaimer to the package for it being for research use only. Added a disclaimer to the help file for
HLA_truncateto warn users about the ability to make non-WHO-compliant allele names with certain settings. UpdatedHLA_mismatch_baseto better handle missing loci at the DRB3/4/5 locus.
immunogenetr 1.0.0
CRAN release: 2025-08-19
- Added
HLA_mismatch_allelesas a synonym ofHLA_mismatched_alleles. Added minimum versions in DESCRIPTION. Stable release; updated version to 1.0.0.
immunogenetr 0.3.1
CRAN release: 2025-06-25
- Updated
HLA_columns_to_GLstringto fix issues processing DRB3/4/5 alleles.
immunogenetr 0.3.0
CRAN release: 2025-06-18
- Updated
ambiguity_table_to_GLstringto remove duplicate entries from an ambiguity table as it is being processed to a GL string. Added this functionality toHLA_truncateso that truncated GL strings could optionally remove duplicates. AddedGLstring_to_ambiguity_tableas an alias forGL_string_expand_longer.