Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redux with a "P" option does not return P-groups for two-field or three-field alleles #230

Closed
gbiagini opened this issue Apr 24, 2023 · 7 comments · Fixed by #239
Closed
Assignees
Labels
bug Something isn't working

Comments

@gbiagini
Copy link

When supplying a two-field allele to ard.redux() with the "P" option, the allele name is generally returned instead of the P-group.

This may primarily affect alleles with additional four-field variants.

For example, ard.redux("B*07:02","P") returns B*07:02 (as does ard.redux("B*07:02:01","P")), while ard.redux("B*07:02:01:01","P") returns B*07:02P.
Similarly, ard.redux("DRB1*01:01","P") returns DRB1*01:01 (as does ard.redux("DRB1*01:01:01","P")), while ard.redux("DRB1*01:01:01:01","P") returns DRB1*01:01P.

For an example of an allele without a four-field variant that behaves normally, ard.redux("B*15:14","P") returns B*15:14P, as expected.

The expected behavior is that ard.redux() would return the same P-group for the two-field, three-field, and four-field equivalents of an allele.

The addition of P-groups to ard.redux() is very helpful and I thank you for this tool and for your time. I'm happy to aid in debugging if desired.

@pbashyal-nmdp pbashyal-nmdp self-assigned this Apr 24, 2023
@pbashyal-nmdp pbashyal-nmdp added this to the Post 1.0.0 milestone Apr 24, 2023
@pbashyal-nmdp
Copy link
Contributor

Thanks Giovanni for the detailed examples. I'll take a look at what's causing the difference.

@pbashyal-nmdp
Copy link
Contributor

Hello @gbiagini,

Just added the fix for P group mapping. Could you test it on your code ?
You can install from the current code with pip by:

pip install git+https://github.com/nmdp-bioinformatics/py-ard

@gbiagini
Copy link
Author

Hi @pbashyal-nmdp

I tested the same alleles listed above with the same results. Maybe I'm missing something about getting the updated code?

I tried installing py-ard from the standard pip install py-ard as well as the command you provided, with the same results.

I also tried reinstalling the IMGT database for version 3.52.0, but that didn't seem to change anything either.

I tested both the Python module and CLI. Results of the CLI pasted below.

image

@pbashyal-nmdp
Copy link
Contributor

pbashyal-nmdp commented Jun 23, 2023

It gives a correct answer on mine.

$ pyard -g "B*07:02" -r "P"
B*07:02P

It's not published yet(hopefully soon) so you can't do pip install py-ard yet.

Can you run pyard-status command and post it here? It should list what data you have.

$ pyard-status
-------------------------------------------
IMGT DB Version: Latest (3520)
You're up to date. 3520 is the most recent version.
File: /var/folders/nm/nyjkgrfn3fg207v5z5rz1w8m0000gp/T/pyard/pyard-Latest.sqlite3
Size: 558.89MB
-------------------------------------------
|Table Name          |Rows                |
|-----------------------------------------|
|dup_g               |                  67|
|dup_lgx             |                   1|
|g_group             |               14445|
|p_group             |               21157|
|lgx_group           |               14445|
|exon_group          |               13140|
|p_not_g             |                1690|
|xx_codes            |                1995|
|who_group           |               36036|
|alleles             |               39386|
|exp_alleles         |                  84|
|who_alleles         |               37068|
|mac_codes           |             1113880|
-------------------------------------------

@gbiagini
Copy link
Author

gbiagini commented Jun 23, 2023

I got it working just now!

Instead of forcing a re-install of the database through py-ard, I uninstalled py-ard again, deleted the entire cache in the /tmp/pyard directory, and then reinstalled again with the pip install git+https://github.com/nmdp-bioinformatics/py-ard command you provided.

Now "B*07:02" reduces to "B*07:02P".

Previously, I was forcing a re-install of the database after uninstalling and reinstalling py-ard. A clean install may have been what fixed the inconsistency on my end, can't say for sure.

image

@gbiagini
Copy link
Author

Thanks for all the help @pbashyal-nmdp!

@pbashyal-nmdp
Copy link
Contributor

Thanks for testing it and reporting the issue. It'll be part of py-ard with the next release of 1.0.1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants