Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 9 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,35 +19,29 @@
"updateRemoteUserUID": true,
"containerEnv": {
"WORKON_HOME": "${containerWorkspaceFolder}/.venv",
"PYTHONPATH": "${containerWorkspaceFolder}",
"ORACLE_HOME": "/opt/oracle/instantclient",
"LD_LIBRARY_PATH": "/opt/oracle/instantclient"
"PYTHONPATH": "${containerWorkspaceFolder}"
},
"onCreateCommand": {
"update apt": [
"/usr/bin/apt",
"update"
],
"sync venv/install if missing": [
"/usr/local/bin/uv",
"sync",
"--frozen"
]
// "sync venv/install if missing": [
// "/usr/local/bin/uv",
// "sync",
// "--frozen"
// ]
},
"postCreateCommand": {
"install ssh client": [
"install apt packages": [
"/usr/bin/apt",
"install",
"--no-install-recommends",
"-y",
"openssh-client",
"libaio-dev",
"unzip"
],
"install Instant Client": [
"/usr/bin/env",
"bash",
"${containerWorkspaceFolder}/.devcontainer/install_instant_client.bash"
"unzip",
"yamllint"
],
"install Ruby": [
"/usr/bin/apt",
Expand Down
7 changes: 0 additions & 7 deletions .devcontainer/install_instant_client.bash

This file was deleted.

28 changes: 16 additions & 12 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,15 +47,19 @@ jobs:
- name: Run tests
run: uv run pytest --junitxml=pytest.xml

# TODO: Look into github actions, these are out of date
# - name: Upload coverage data
# uses: actions/upload-artifact@v3
# with:
# name: coverage-data
# path: coverage.xml

# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v3
# if: success() || failure()
# with:
# report_paths: unit_test.xml
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}

# - name: Publish Test Report
# uses: mikepenz/action-junit-report@v5
# if: success() || failure()
# with:
# report_paths: pytest.xml

- name: Upload test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion .yamllint.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ignore:
- .git/*
- .venv/*
- src/easyhla/default_data/hla_standards.yaml
- src/hla_algorithm/default_data/hla_standards.yaml

extends: default

Expand Down
16 changes: 9 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
# pyEasyHLA
# BC-CfE HLA algorithm

[![pipeline status](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/badges/main/pipeline.svg)](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/commits/main)
[![coverage report](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/badges/main/coverage.svg)](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/commits/main)
[![Latest Release](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/badges/release.svg)](https://git-int.cfenet.ubc.ca/drickett/pyeasyhla/-/releases)

[[_TOC_]]
[![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)
[![codecov](https://codecov.io/gh/cfe-lab/hla_algorithm/graph/badge.svg?token=ZJQKPBRTQB)](https://codecov.io/gh/cfe-lab/hla_algorithm)
![GitHub Release](https://img.shields.io/github/v/release/cfe-lab/hla_algorithm?sort=semver)

## Objective

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.
This is a Python implementation of the BC-CfE HLA algorithm. This algorithm has
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
to consolidate all of our HLA algorithm versions into a single version.

## Testing

FIXME

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).

## TODO
Expand Down
74 changes: 30 additions & 44 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ requires = ["hatchling", "uv-dynamic-versioning"]
build-backend = "hatchling.build"

[project]
name = "easyhla"
name = "hla_algorithm"
description = ''
readme = "README.md"
requires-python = ">=3.10"
Expand All @@ -29,20 +29,17 @@ dependencies = [
"numpy>=2.2.3",
"pydantic>=2.10.6",
"pydantic-numpy>=8.0.1",
"pytz>=2025.1",
"pyyaml>=6.0.2",
"requests>=2.32.3",
"typer>=0.15.2",
"types-pyyaml>=6.0.12.20250516",
"types-requests>=2.32.4.20250611",
"uv-dynamic-versioning>=0.8.2",
]

[dependency-groups]
dev = [
"mypy>=1.15.0",
"mypy-extensions>=1.0.0",
"oracledb>=3.1.0",
"pandas>=2.2.3",
"pandas-stubs>=2.2.3.241126",
"pre-commit>=4.1.0",
Expand All @@ -52,47 +49,38 @@ dev = [
"pytest-mock>=3.14.0",
"pytest-xdist>=3.6.1",
"ruff>=0.9.9",
"sqlalchemy>=2.0.40",
"types-pytz>=2025.1.0.20250204",
"uv-dynamic-versioning>=0.8.2",
]

[project.urls]
Documentation = "https://github.com/cfe-lab/pyeasyhla/blob/main/README.md"
Issues = "https://github.com/cfe-lab/pyeasyhla/issues"
Source = "https://github.com/cfe-lab/pyeasyhla"
Documentation = "https://github.com/cfe-lab/hla_algorithm/blob/main/README.md"
Issues = "https://github.com/cfe-lab/hla_algorithm/issues"
Source = "https://github.com/cfe-lab/hla_algorithm"

[project.scripts]
clinical_hla = "easyhla.clinical_hla:main"
interpret_from_json = "easyhla.interpret_from_json:main"
bblab = "easyhla.bblab:main"
update_alleles = "easyhla.update_alleles:main"
update_frequency_file = "easyhla.update_frequency_file:main"

[project.optional-dependencies]
database = [
"oracledb>=3.1.0",
"sqlalchemy>=2.0.40",
]
interpret_from_json = "hla_algorithm.interpret_from_json:main"
update_alleles = "hla_algorithm.update_alleles:main"
update_frequency_file = "hla_algorithm.update_frequency_file:main"

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

[tool.hatch.build]
include = [
"src/easyhla/__about__.py",
"src/easyhla/__init__.py",
"src/easyhla/__main__.py",
"src/easyhla/easyhla.py",
"src/easyhla/interpret_from_json_lib.py",
"src/easyhla/interpret_from_json.py",
"src/easyhla/models.py",
"src/easyhla/py.typed",
"src/easyhla/update_alleles.py",
"src/easyhla/update_frequency_file_lib.py",
"src/easyhla/update_frequency_file.py",
"src/easyhla/utils.py",
"src/easyhla/default_data/hla_standards.yaml",
"src/easyhla/default_data/hla_frequencies.csv",
"src/hla_algorithm/_version.py",
"src/hla_algorithm/__init__.py",
"src/hla_algorithm/__main__.py",
"src/hla_algorithm/hla_algorithm.py",
"src/hla_algorithm/interpret_from_json_lib.py",
"src/hla_algorithm/interpret_from_json.py",
"src/hla_algorithm/models.py",
"src/hla_algorithm/py.typed",
"src/hla_algorithm/update_alleles.py",
"src/hla_algorithm/update_frequency_file_lib.py",
"src/hla_algorithm/update_frequency_file.py",
"src/hla_algorithm/utils.py",
"src/hla_algorithm/default_data/hla_standards.yaml",
"src/hla_algorithm/default_data/hla_frequencies.csv",
]
exclude = [
"tests",
Expand All @@ -101,10 +89,10 @@ skip-excluded-dirs = true
directory = "output"

[tool.hatch.build.targets.wheel]
packages = ["src/easyhla"]
packages = ["src/hla_algorithm"]

[tool.hatch.build.hooks.version]
path = "src/easyhla/_version.py"
path = "src/hla_algorithm/_version.py"
template = '''
__version__ = "{version}"
'''
Expand Down Expand Up @@ -132,15 +120,13 @@ branch = true
parallel = true
source = ["src"]
omit = [
"src/easyhla/__init__.py",
"src/easyhla/__about__.py",
"src/easyhla/__main__.py",
"src/hla_algorithm/__init__.py",
"src/hla_algorithm/_version.py",
"src/hla_algorithm/__main__.py",
"tests/__init__.py",
"src/easyhla/bblab.py",
"src/easyhla/clinical_hla.py",
"src/easyhla/interpret_from_json.py",
"src/easyhla/update_alleles.py",
"src/easyhla/update_frequency_file.py",
"src/hla_algorithm/interpret_from_json.py",
"src/hla_algorithm/update_alleles.py",
"src/hla_algorithm/update_frequency_file.py",
"src/scripts/*.py",
]

Expand Down
1 change: 1 addition & 0 deletions ruby/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.gem
19 changes: 19 additions & 0 deletions ruby/hla_algorithm.gemspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
Gem::Specification.new do |s|
s.name = "hla_algorithm"
s.version = ENV['HLA_ALGORITHM_VERSION'] || '0.0.0'
s.summary = "Ruby wrapper for the Python-based BC-CfE HLA interpretation algorithm"
s.files = ['lib/hla_algorithm.rb']
s.authors = [
"Brian Wynhoven",
"Chanson Brumme",
"Conan Woods",
"Rosemary McCloskey",
"David Rickett",
"Richard Liang"
]
# Associate this gem with a GitHub repo; this allows the gems to be
# automatically associated with the repo when pushed to GitHub Packages.
s.metadata = {
"github_repo" => "ssh://github.com/cfe-lab/hla_algorithm"
}
end
4 changes: 2 additions & 2 deletions src/easyhla/hla_algorithm.rb → ruby/lib/hla_algorithm.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ def analyze(seqs, locus='B')
"seq1" => seqs[0],
"seq2" => seqs[1],
"locus" => locus,
"hla_std_path" => File.expand_path(@hla_std_path),
"hla_freq_path" => File.expand_path(@hla_freq_path)
"hla_std_path" => nil,
"hla_freq_path" => nil
}

if (!@hla_std_path.nil?)
Expand Down
Loading