Skip to content

Commit d28ec7e

Browse files
authored
Merge pull request #5 from cfe-lab/FoldClinicalIn
Continuing to consolidate the HLA algorithm again
2 parents a17122e + 850221f commit d28ec7e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

54 files changed

+364
-677579
lines changed

.devcontainer/devcontainer.json

Lines changed: 9 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -19,35 +19,29 @@
1919
"updateRemoteUserUID": true,
2020
"containerEnv": {
2121
"WORKON_HOME": "${containerWorkspaceFolder}/.venv",
22-
"PYTHONPATH": "${containerWorkspaceFolder}",
23-
"ORACLE_HOME": "/opt/oracle/instantclient",
24-
"LD_LIBRARY_PATH": "/opt/oracle/instantclient"
22+
"PYTHONPATH": "${containerWorkspaceFolder}"
2523
},
2624
"onCreateCommand": {
2725
"update apt": [
2826
"/usr/bin/apt",
2927
"update"
30-
],
31-
"sync venv/install if missing": [
32-
"/usr/local/bin/uv",
33-
"sync",
34-
"--frozen"
3528
]
29+
// "sync venv/install if missing": [
30+
// "/usr/local/bin/uv",
31+
// "sync",
32+
// "--frozen"
33+
// ]
3634
},
3735
"postCreateCommand": {
38-
"install ssh client": [
36+
"install apt packages": [
3937
"/usr/bin/apt",
4038
"install",
4139
"--no-install-recommends",
4240
"-y",
4341
"openssh-client",
4442
"libaio-dev",
45-
"unzip"
46-
],
47-
"install Instant Client": [
48-
"/usr/bin/env",
49-
"bash",
50-
"${containerWorkspaceFolder}/.devcontainer/install_instant_client.bash"
43+
"unzip",
44+
"yamllint"
5145
],
5246
"install Ruby": [
5347
"/usr/bin/apt",

.devcontainer/install_instant_client.bash

Lines changed: 0 additions & 7 deletions
This file was deleted.

.github/workflows/test.yml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,19 @@ jobs:
4747
- name: Run tests
4848
run: uv run pytest --junitxml=pytest.xml
4949

50-
# TODO: Look into github actions, these are out of date
51-
# - name: Upload coverage data
52-
# uses: actions/upload-artifact@v3
53-
# with:
54-
# name: coverage-data
55-
# path: coverage.xml
56-
57-
# - name: Publish Test Report
58-
# uses: mikepenz/action-junit-report@v3
59-
# if: success() || failure()
60-
# with:
61-
# report_paths: unit_test.xml
50+
- name: Upload coverage reports to Codecov
51+
uses: codecov/codecov-action@v5
52+
with:
53+
token: ${{ secrets.CODECOV_TOKEN }}
54+
55+
# - name: Publish Test Report
56+
# uses: mikepenz/action-junit-report@v5
57+
# if: success() || failure()
58+
# with:
59+
# report_paths: pytest.xml
60+
61+
- name: Upload test results to Codecov
62+
if: ${{ !cancelled() }}
63+
uses: codecov/test-results-action@v1
64+
with:
65+
token: ${{ secrets.CODECOV_TOKEN }}

.yamllint.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
ignore:
22
- .git/*
33
- .venv/*
4-
- src/easyhla/default_data/hla_standards.yaml
4+
- src/hla_algorithm/default_data/hla_standards.yaml
55

66
extends: default
77

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
1-
# pyEasyHLA
1+
# BC-CfE HLA algorithm
22

3-
[![pipeline status](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/badges/main/pipeline.svg)](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/commits/main)
4-
[![coverage report](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/badges/main/coverage.svg)](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/commits/main)
5-
[![Latest Release](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/badges/release.svg)](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/releases)
6-
7-
[[_TOC_]]
3+
[![test](https://github.com/cfe-lab/hla_algorithm/actions/workflows/test.yml/badge.svg)](https://github.com/cfe-lab/hla_algorithm/actions/workflows/test.yml)
4+
[![codecov](https://codecov.io/gh/cfe-lab/hla_algorithm/graph/badge.svg?token=ZJQKPBRTQB)](https://codecov.io/gh/cfe-lab/hla_algorithm)
5+
![GitHub Release](https://img.shields.io/github/v/release/cfe-lab/hla_algorithm?sort=semver)
86

97
## Objective
108

11-
This is a python implementation of [BBLab's hla-easy.rb](https://github.com/cfe-lab/bblab-server/blob/main/alldata/hla_class/hla-easy.rb) file. The goal is to remove the ruby dependency from BBLab.
9+
This is a Python implementation of the BC-CfE HLA algorithm. This algorithm has
10+
several interpretations, including [BBLab's hla-easy.rb](https://github.com/cfe-lab/bblab-server/blob/main/alldata/hla_class/hla-easy.rb) file. This project aims
11+
to consolidate all of our HLA algorithm versions into a single version.
1212

1313
## Testing
1414

15+
FIXME
16+
1517
The current validation method is to go to the [BBLab HLA Class tool page](https://hivresearchtools.bccfe.ca/django/tools/hla_class/), upload [test.fasta](https://github.com/cfe-lab/bblab-server/blob/main/tests/test.fasta) in `HLA Type C`, and assert that its output matches [the output kept in version control](https://github.com/cfe-lab/bblab-server/blob/main/tests/hla_class/HLA-C%20batch%20mode%20test%20data%20OUTPUT.csv).
1618

1719
## TODO

pyproject.toml

Lines changed: 30 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["hatchling", "uv-dynamic-versioning"]
33
build-backend = "hatchling.build"
44

55
[project]
6-
name = "easyhla"
6+
name = "hla_algorithm"
77
description = ''
88
readme = "README.md"
99
requires-python = ">=3.10"
@@ -29,20 +29,17 @@ dependencies = [
2929
"numpy>=2.2.3",
3030
"pydantic>=2.10.6",
3131
"pydantic-numpy>=8.0.1",
32-
"pytz>=2025.1",
3332
"pyyaml>=6.0.2",
3433
"requests>=2.32.3",
3534
"typer>=0.15.2",
3635
"types-pyyaml>=6.0.12.20250516",
3736
"types-requests>=2.32.4.20250611",
38-
"uv-dynamic-versioning>=0.8.2",
3937
]
4038

4139
[dependency-groups]
4240
dev = [
4341
"mypy>=1.15.0",
4442
"mypy-extensions>=1.0.0",
45-
"oracledb>=3.1.0",
4643
"pandas>=2.2.3",
4744
"pandas-stubs>=2.2.3.241126",
4845
"pre-commit>=4.1.0",
@@ -52,47 +49,38 @@ dev = [
5249
"pytest-mock>=3.14.0",
5350
"pytest-xdist>=3.6.1",
5451
"ruff>=0.9.9",
55-
"sqlalchemy>=2.0.40",
56-
"types-pytz>=2025.1.0.20250204",
52+
"uv-dynamic-versioning>=0.8.2",
5753
]
5854

5955
[project.urls]
60-
Documentation = "https://github.com/cfe-lab/pyeasyhla/blob/main/README.md"
61-
Issues = "https://github.com/cfe-lab/pyeasyhla/issues"
62-
Source = "https://github.com/cfe-lab/pyeasyhla"
56+
Documentation = "https://github.com/cfe-lab/hla_algorithm/blob/main/README.md"
57+
Issues = "https://github.com/cfe-lab/hla_algorithm/issues"
58+
Source = "https://github.com/cfe-lab/hla_algorithm"
6359

6460
[project.scripts]
65-
clinical_hla = "easyhla.clinical_hla:main"
66-
interpret_from_json = "easyhla.interpret_from_json:main"
67-
bblab = "easyhla.bblab:main"
68-
update_alleles = "easyhla.update_alleles:main"
69-
update_frequency_file = "easyhla.update_frequency_file:main"
70-
71-
[project.optional-dependencies]
72-
database = [
73-
"oracledb>=3.1.0",
74-
"sqlalchemy>=2.0.40",
75-
]
61+
interpret_from_json = "hla_algorithm.interpret_from_json:main"
62+
update_alleles = "hla_algorithm.update_alleles:main"
63+
update_frequency_file = "hla_algorithm.update_frequency_file:main"
7664

7765
[tool.hatch.version]
7866
source = "uv-dynamic-versioning"
7967

8068
[tool.hatch.build]
8169
include = [
82-
"src/easyhla/__about__.py",
83-
"src/easyhla/__init__.py",
84-
"src/easyhla/__main__.py",
85-
"src/easyhla/easyhla.py",
86-
"src/easyhla/interpret_from_json_lib.py",
87-
"src/easyhla/interpret_from_json.py",
88-
"src/easyhla/models.py",
89-
"src/easyhla/py.typed",
90-
"src/easyhla/update_alleles.py",
91-
"src/easyhla/update_frequency_file_lib.py",
92-
"src/easyhla/update_frequency_file.py",
93-
"src/easyhla/utils.py",
94-
"src/easyhla/default_data/hla_standards.yaml",
95-
"src/easyhla/default_data/hla_frequencies.csv",
70+
"src/hla_algorithm/_version.py",
71+
"src/hla_algorithm/__init__.py",
72+
"src/hla_algorithm/__main__.py",
73+
"src/hla_algorithm/hla_algorithm.py",
74+
"src/hla_algorithm/interpret_from_json_lib.py",
75+
"src/hla_algorithm/interpret_from_json.py",
76+
"src/hla_algorithm/models.py",
77+
"src/hla_algorithm/py.typed",
78+
"src/hla_algorithm/update_alleles.py",
79+
"src/hla_algorithm/update_frequency_file_lib.py",
80+
"src/hla_algorithm/update_frequency_file.py",
81+
"src/hla_algorithm/utils.py",
82+
"src/hla_algorithm/default_data/hla_standards.yaml",
83+
"src/hla_algorithm/default_data/hla_frequencies.csv",
9684
]
9785
exclude = [
9886
"tests",
@@ -101,10 +89,10 @@ skip-excluded-dirs = true
10189
directory = "output"
10290

10391
[tool.hatch.build.targets.wheel]
104-
packages = ["src/easyhla"]
92+
packages = ["src/hla_algorithm"]
10593

10694
[tool.hatch.build.hooks.version]
107-
path = "src/easyhla/_version.py"
95+
path = "src/hla_algorithm/_version.py"
10896
template = '''
10997
__version__ = "{version}"
11098
'''
@@ -132,15 +120,13 @@ branch = true
132120
parallel = true
133121
source = ["src"]
134122
omit = [
135-
"src/easyhla/__init__.py",
136-
"src/easyhla/__about__.py",
137-
"src/easyhla/__main__.py",
123+
"src/hla_algorithm/__init__.py",
124+
"src/hla_algorithm/_version.py",
125+
"src/hla_algorithm/__main__.py",
138126
"tests/__init__.py",
139-
"src/easyhla/bblab.py",
140-
"src/easyhla/clinical_hla.py",
141-
"src/easyhla/interpret_from_json.py",
142-
"src/easyhla/update_alleles.py",
143-
"src/easyhla/update_frequency_file.py",
127+
"src/hla_algorithm/interpret_from_json.py",
128+
"src/hla_algorithm/update_alleles.py",
129+
"src/hla_algorithm/update_frequency_file.py",
144130
"src/scripts/*.py",
145131
]
146132

ruby/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
*.gem

ruby/hla_algorithm.gemspec

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Gem::Specification.new do |s|
2+
s.name = "hla_algorithm"
3+
s.version = ENV['HLA_ALGORITHM_VERSION'] || '0.0.0'
4+
s.summary = "Ruby wrapper for the Python-based BC-CfE HLA interpretation algorithm"
5+
s.files = ['lib/hla_algorithm.rb']
6+
s.authors = [
7+
"Brian Wynhoven",
8+
"Chanson Brumme",
9+
"Conan Woods",
10+
"Rosemary McCloskey",
11+
"David Rickett",
12+
"Richard Liang"
13+
]
14+
# Associate this gem with a GitHub repo; this allows the gems to be
15+
# automatically associated with the repo when pushed to GitHub Packages.
16+
s.metadata = {
17+
"github_repo" => "ssh://github.com/cfe-lab/hla_algorithm"
18+
}
19+
end
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def analyze(seqs, locus='B')
5656
"seq1" => seqs[0],
5757
"seq2" => seqs[1],
5858
"locus" => locus,
59-
"hla_std_path" => File.expand_path(@hla_std_path),
60-
"hla_freq_path" => File.expand_path(@hla_freq_path)
59+
"hla_std_path" => nil,
60+
"hla_freq_path" => nil
6161
}
6262

6363
if (!@hla_std_path.nil?)

0 commit comments

Comments
 (0)