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

Add hla normalization #107

Merged
merged 16 commits into from
Dec 24, 2024
Merged

Add hla normalization #107

merged 16 commits into from
Dec 24, 2024

Conversation

rhdolin
Copy link
Collaborator

@rhdolin rhdolin commented Dec 20, 2024

Description

  • app/common.py

    • import pyard
    • revise get_haplotype to search on HLA normal form
    • revise get_haplotype's handling of "|" (since this character is used within glstrings).
    • revise query_PharmGKB_by_haplotypes to enable case-insensitive and normal form search.
  • app/endpoints.py

    • revise find_subject_specific_haplotypes to enable case-insensitive and normal form search.
    • revise find_population_specific_haplotypes to fix and/or logic.
    • revise find_population_specific_haplotypes to to enable case-insensitive and normal form search.
  • add / revise test cases

@rhdolin rhdolin closed this Dec 20, 2024
@rhdolin rhdolin reopened this Dec 20, 2024
@rhdolin rhdolin requested a review from mihaitodor December 20, 2024 23:41
Copy link
Collaborator

@mihaitodor mihaitodor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice one Bob! There's just one small issue with initialising pyard in both app/common.py and app/utilities_endpoints.py. We should move that code somewhere in utilities, maybe in a new .py file.

app/common.py Outdated
Comment on lines 15 to 16
pyard_database_version = os.getenv('PYARD_DATABASE_VERSION', '3580')
ard = pyard.init(data_dir='./data/pyard', cache_size=1, imgt_version=pyard_database_version)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll have to do this in a single place to avoid duplication and having it loaded multiple times in memory. It's probably better to have a .py file for it in the utilities folder and have a wrapper function for ard.redux()` in there.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I took a stab at fixing this in d6b6121.

@mihaitodor mihaitodor merged commit 0c86166 into main Dec 24, 2024
2 checks passed
@mihaitodor mihaitodor deleted the add-hla-normalization branch December 24, 2024 01:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants