mhcmatch 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (72) hide show
  1. mhcmatch-0.1.0/.github/workflows/ci.yml +29 -0
  2. mhcmatch-0.1.0/.github/workflows/docs.yml +47 -0
  3. mhcmatch-0.1.0/.github/workflows/publish.yml +86 -0
  4. mhcmatch-0.1.0/.gitignore +29 -0
  5. mhcmatch-0.1.0/LICENSE +674 -0
  6. mhcmatch-0.1.0/PKG-INFO +128 -0
  7. mhcmatch-0.1.0/README.md +96 -0
  8. mhcmatch-0.1.0/ROADMAP.md +204 -0
  9. mhcmatch-0.1.0/appendix/.latexmkrc +2 -0
  10. mhcmatch-0.1.0/appendix/Makefile +16 -0
  11. mhcmatch-0.1.0/appendix/confusion_mhc1_human.pdf +0 -0
  12. mhcmatch-0.1.0/appendix/diffusion_auc.pdf +0 -0
  13. mhcmatch-0.1.0/appendix/mhcmatch.pdf +0 -0
  14. mhcmatch-0.1.0/appendix/mhcmatch.tex +696 -0
  15. mhcmatch-0.1.0/appendix/pockets_mhc1_human.pdf +0 -0
  16. mhcmatch-0.1.0/appendix/pockets_mhc1_mouse.pdf +0 -0
  17. mhcmatch-0.1.0/appendix/pockets_mhc2_human.pdf +0 -0
  18. mhcmatch-0.1.0/appendix/pockets_mhc2_mouse.pdf +0 -0
  19. mhcmatch-0.1.0/appendix/promiscuity_mhc1_human.pdf +0 -0
  20. mhcmatch-0.1.0/appendix/promiscuity_mhc1_mouse.pdf +0 -0
  21. mhcmatch-0.1.0/appendix/promiscuity_mhc2_human.pdf +0 -0
  22. mhcmatch-0.1.0/appendix/promiscuity_mhc2_mouse.pdf +0 -0
  23. mhcmatch-0.1.0/appendix/promiscuity_shared_mhc1_human.pdf +0 -0
  24. mhcmatch-0.1.0/appendix/promiscuity_shared_mhc1_mouse.pdf +0 -0
  25. mhcmatch-0.1.0/appendix/promiscuity_shared_mhc2_human.pdf +0 -0
  26. mhcmatch-0.1.0/appendix/promiscuity_shared_mhc2_mouse.pdf +0 -0
  27. mhcmatch-0.1.0/appendix/refs.bib +259 -0
  28. mhcmatch-0.1.0/appendix/structural_pockets.pdf +0 -0
  29. mhcmatch-0.1.0/appendix/structural_pockets.svg +159 -0
  30. mhcmatch-0.1.0/bench/bench_diffusion.py +167 -0
  31. mhcmatch-0.1.0/bench/bench_speed.py +78 -0
  32. mhcmatch-0.1.0/bench/confusion.py +147 -0
  33. mhcmatch-0.1.0/bench/fisher_kernel.py +153 -0
  34. mhcmatch-0.1.0/bench/make_figures.py +150 -0
  35. mhcmatch-0.1.0/bench/promiscuity_graph.py +196 -0
  36. mhcmatch-0.1.0/bench/results/confusion_mhc1_human.md +10 -0
  37. mhcmatch-0.1.0/bench/results/cv_mhc1_human_full.md +6 -0
  38. mhcmatch-0.1.0/bench/results/cv_mhc1_human_shortlist.md +6 -0
  39. mhcmatch-0.1.0/bench/results/cv_mhc1_mouse_full.md +6 -0
  40. mhcmatch-0.1.0/bench/results/cv_mhc2_human_full.md +6 -0
  41. mhcmatch-0.1.0/bench/results/fisher_mhc1_human.md +8 -0
  42. mhcmatch-0.1.0/bench/results/locus_mhc1_human.md +8 -0
  43. mhcmatch-0.1.0/bench/results/locus_mhc2_human.md +7 -0
  44. mhcmatch-0.1.0/bench/results/transfer_mhc1_human.md +8 -0
  45. mhcmatch-0.1.0/bench/structural_figure.py +115 -0
  46. mhcmatch-0.1.0/bench/structural_pockets.py +178 -0
  47. mhcmatch-0.1.0/bench/transfer.py +93 -0
  48. mhcmatch-0.1.0/bench/tune_diffusion.py +308 -0
  49. mhcmatch-0.1.0/docs/Makefile +13 -0
  50. mhcmatch-0.1.0/docs/_static/custom.css +27 -0
  51. mhcmatch-0.1.0/docs/api.rst +50 -0
  52. mhcmatch-0.1.0/docs/conf.py +37 -0
  53. mhcmatch-0.1.0/docs/getting-started.rst +47 -0
  54. mhcmatch-0.1.0/docs/index.rst +44 -0
  55. mhcmatch-0.1.0/docs/requirements.txt +2 -0
  56. mhcmatch-0.1.0/environment.yml +34 -0
  57. mhcmatch-0.1.0/pyproject.toml +40 -0
  58. mhcmatch-0.1.0/setup.sh +30 -0
  59. mhcmatch-0.1.0/src/mhcmatch/__init__.py +44 -0
  60. mhcmatch-0.1.0/src/mhcmatch/cli.py +148 -0
  61. mhcmatch-0.1.0/src/mhcmatch/data/PROVENANCE.md +34 -0
  62. mhcmatch-0.1.0/src/mhcmatch/data/mhci_pseudo.fa +8286 -0
  63. mhcmatch-0.1.0/src/mhcmatch/data/mhcii_pseudo.fa +4418 -0
  64. mhcmatch-0.1.0/src/mhcmatch/data/structural_pockets_mhc1.tsv +6 -0
  65. mhcmatch-0.1.0/src/mhcmatch/data/structural_pockets_mhc2.tsv +5 -0
  66. mhcmatch-0.1.0/src/mhcmatch/diffusion.py +127 -0
  67. mhcmatch-0.1.0/src/mhcmatch/logo.py +65 -0
  68. mhcmatch-0.1.0/src/mhcmatch/proteome.py +89 -0
  69. mhcmatch-0.1.0/src/mhcmatch/pseudoseq.py +300 -0
  70. mhcmatch-0.1.0/src/mhcmatch/search.py +50 -0
  71. mhcmatch-0.1.0/src/mhcmatch/store.py +356 -0
  72. mhcmatch-0.1.0/tests/test_mhcmatch.py +235 -0
@@ -0,0 +1,29 @@
1
+ name: ci
2
+
3
+ on:
4
+ push:
5
+ branches: [dev, master]
6
+ pull_request:
7
+ branches: [dev, master]
8
+ workflow_dispatch:
9
+
10
+ permissions:
11
+ contents: read
12
+
13
+ jobs:
14
+ test:
15
+ runs-on: ubuntu-latest
16
+ strategy:
17
+ fail-fast: false
18
+ matrix:
19
+ python-version: ["3.10", "3.12"]
20
+ steps:
21
+ - uses: actions/checkout@v4
22
+ - uses: actions/setup-python@v5
23
+ with:
24
+ python-version: ${{ matrix.python-version }}
25
+ cache: pip
26
+ - name: Install (pulls seqtree from PyPI; pure-Python package, no build)
27
+ run: pip install -e ".[test]"
28
+ - name: Run tests
29
+ run: pytest -q
@@ -0,0 +1,47 @@
1
+ name: docs
2
+
3
+ on:
4
+ push:
5
+ branches: [dev, master]
6
+ workflow_dispatch:
7
+
8
+ permissions:
9
+ contents: read
10
+ pages: write
11
+ id-token: write
12
+
13
+ # Per-ref so a dev push never cancels an in-flight master Pages deploy.
14
+ concurrency:
15
+ group: pages-${{ github.ref }}
16
+ cancel-in-progress: true
17
+
18
+ jobs:
19
+ build:
20
+ runs-on: ubuntu-latest
21
+ steps:
22
+ - uses: actions/checkout@v4
23
+ - uses: actions/setup-python@v5
24
+ with:
25
+ python-version: "3.12"
26
+ - name: Install docs toolchain
27
+ # autodoc imports mhcmatch from src/ with seqtree and heavy deps mocked
28
+ # (docs/conf.py: autodoc_mock_imports), so the package/native deps are not needed.
29
+ run: pip install -r docs/requirements.txt
30
+ - name: Build HTML (fail on warnings)
31
+ run: sphinx-build -W --keep-going -b html docs docs/_build/html
32
+ - uses: actions/upload-pages-artifact@v3
33
+ with:
34
+ path: docs/_build/html
35
+
36
+ deploy:
37
+ needs: build
38
+ # The github-pages environment only allows deploys from the default branch; on dev we
39
+ # validate the build (above) but skip deployment so the workflow stays green.
40
+ if: github.ref == 'refs/heads/master'
41
+ runs-on: ubuntu-latest
42
+ environment:
43
+ name: github-pages
44
+ url: ${{ steps.deployment.outputs.page_url }}
45
+ steps:
46
+ - id: deployment
47
+ uses: actions/deploy-pages@v4
@@ -0,0 +1,86 @@
1
+ name: Publish To PyPI
2
+
3
+ on:
4
+ release:
5
+ types:
6
+ - published
7
+ workflow_dispatch:
8
+
9
+ permissions:
10
+ contents: read
11
+
12
+ jobs:
13
+ build:
14
+ # mhcmatch is pure Python (hatchling) -> one sdist + one universal wheel via `build`.
15
+ runs-on: ubuntu-latest
16
+ steps:
17
+ - uses: actions/checkout@v4
18
+ - uses: actions/setup-python@v5
19
+ with:
20
+ python-version: "3.12"
21
+ - name: Install build tooling
22
+ run: python -m pip install --upgrade pip build twine
23
+ - name: Build sdist + wheel
24
+ run: python -m build
25
+ - name: Check distributions
26
+ run: python -m twine check dist/*
27
+ - name: Upload distributions
28
+ uses: actions/upload-artifact@v4
29
+ with:
30
+ name: python-dist
31
+ path: dist/
32
+
33
+ smoke:
34
+ name: Smoke-test wheel (py${{ matrix.python-version }})
35
+ needs: build
36
+ runs-on: ubuntu-latest
37
+ strategy:
38
+ fail-fast: false
39
+ matrix:
40
+ python-version: ["3.10", "3.12"]
41
+ steps:
42
+ - uses: actions/setup-python@v5
43
+ with:
44
+ python-version: ${{ matrix.python-version }}
45
+ - uses: actions/download-artifact@v4
46
+ with:
47
+ name: python-dist
48
+ path: dist/
49
+ - name: Install built wheel (deps incl. seqtree resolved from PyPI)
50
+ run: |
51
+ pip install --upgrade pip
52
+ pip install dist/*.whl
53
+ - name: Import mhcmatch
54
+ run: python -c "import mhcmatch; print('[OK] mhcmatch', mhcmatch.__version__)"
55
+
56
+ publish:
57
+ name: Publish To PyPI
58
+ needs: [build, smoke]
59
+ runs-on: ubuntu-latest
60
+ environment: pypi
61
+ permissions:
62
+ contents: read
63
+ id-token: write # required for OIDC trusted publishing
64
+ steps:
65
+ - uses: actions/checkout@v4
66
+ - uses: actions/download-artifact@v4
67
+ with:
68
+ name: python-dist
69
+ path: dist/
70
+ - name: Validate package version matches release tag
71
+ if: github.event_name == 'release'
72
+ run: |
73
+ python - <<'PY'
74
+ from pathlib import Path
75
+ import tomllib
76
+ version = tomllib.loads(Path("pyproject.toml").read_text())["project"]["version"]
77
+ tag = "${{ github.event.release.tag_name }}"
78
+ norm = tag[1:] if tag.startswith("v") else tag
79
+ if version != norm:
80
+ raise SystemExit(f"Version mismatch: pyproject.toml={version}, tag={tag}")
81
+ print(f"Version check passed: {version} == {tag}")
82
+ PY
83
+ - name: List distributions
84
+ run: ls -R dist/
85
+ - name: Publish distributions to PyPI
86
+ uses: pypa/gh-action-pypi-publish@release/v1
@@ -0,0 +1,29 @@
1
+ .venv/
2
+ __pycache__/
3
+ *.pyc
4
+ *.egg-info/
5
+ dist/
6
+ build/
7
+ docs/_build/
8
+ .pytest_cache/
9
+ .ruff_cache/
10
+ .DS_Store
11
+
12
+ # Large reference proteomes for source lookup are fetched, not committed
13
+ data/proteomes/
14
+ *.fasta
15
+ *.fasta.gz
16
+
17
+ # figure intermediates (keep the generated .pdf; regenerate via bench/*.py)
18
+ appendix/*.dat
19
+ appendix/*.gp
20
+ appendix/*.dot
21
+
22
+ # LaTeX build artifacts (keep .tex, .bib, .pdf)
23
+ appendix/*.aux
24
+ appendix/*.log
25
+ appendix/*.out
26
+ appendix/*.bbl
27
+ appendix/*.blg
28
+ appendix/*.fls
29
+ appendix/*.fdb_latexmk