Skip to content

Potentially inconsistent validation of invalid alleles with group codes #356

@gp-ca

Description

@gp-ca

I'm working with py-ard and really like your allele validation but noticed potential inconsistent behavior with G groups.

Potential issue

DQB1*06:02:02G doesn't appear in the WMDA G group specifications, but py-ard handles it inconsistently across different operations.

Reproduction

import pyard
ard = pyard.init('3610')

print(ard._is_valid_allele("DQB1*06:02:02G"))  # True
print(ard.redux("DQB1*06:02:02G", "G"))        # DQB1*06:02:02
print(ard.redux("DQB1*06:02:02G", "lgx"))      # DQB1*06:02
print(ard.redux("DQB1*06:02:02G", "P"))        # InvalidAlleleError

Expected

DQB1*06:02:02G is not a valid WMDA G group, I expected it to be rejected in all operations.

I believe this happens because:

  • P mode validates G groups against self.ars_mappings.g_group.values()
  • modes (lg, lgx, G) and _is_valid_allele() strip "P" and "G"

-> any reason some operations accept invalid G groups while others reject them?

Environment

  • Operating System: Windows 10
  • py-ard version: 1.5.5
  • IMGT DB version: 3610
  • Python version: 3.9.13

Thanks for any clarification!

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions