Skip to content

Commit 9c69260

Browse files
Merge pull request #45 from LadnerLab/psp-pypi-package
Psp pypi package
2 parents b86a10d + 866702a commit 9c69260

10 files changed

Lines changed: 1047 additions & 1 deletion

File tree

.github/workflows/publish.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Publish
2+
3+
on:
4+
push:
5+
tags:
6+
- "v*"
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
test:
13+
runs-on: ubuntu-latest
14+
steps:
15+
- uses: actions/checkout@v4
16+
17+
- uses: actions/setup-python@v5
18+
with:
19+
python-version: "3.12"
20+
21+
- name: Install deps
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -e .[dev]
25+
26+
- name: Lint
27+
run: ruff check .
28+
29+
- name: Run tests
30+
run: pytest -m "unit or integration or e2e" --junitxml=pytest-all.xml
31+
32+
- name: Upload test report
33+
if: always()
34+
uses: actions/upload-artifact@v4
35+
with:
36+
name: release-test-report
37+
path: pytest-all.xml
38+
39+
build:
40+
needs: test
41+
runs-on: ubuntu-latest
42+
steps:
43+
- uses: actions/checkout@v4
44+
45+
- uses: actions/setup-python@v5
46+
with:
47+
python-version: "3.12"
48+
49+
- name: Build artifacts
50+
run: |
51+
python -m pip install --upgrade pip build twine
52+
python -m build
53+
python -m twine check dist/*
54+
55+
- name: Upload dist
56+
uses: actions/upload-artifact@v4
57+
with:
58+
name: dist
59+
path: dist/*
60+
61+
publish-testpypi:
62+
needs: build
63+
runs-on: ubuntu-latest
64+
environment: testpypi
65+
permissions:
66+
id-token: write
67+
contents: read
68+
steps:
69+
- uses: actions/download-artifact@v4
70+
with:
71+
name: dist
72+
path: dist
73+
74+
- uses: pypa/gh-action-pypi-publish@release/v1
75+
with:
76+
repository-url: https://test.pypi.org/legacy/
77+
78+
publish-pypi:
79+
needs: publish-testpypi
80+
runs-on: ubuntu-latest
81+
environment: pypi
82+
permissions:
83+
id-token: write
84+
contents: read
85+
steps:
86+
- uses: actions/download-artifact@v4
87+
with:
88+
name: dist
89+
path: dist
90+
91+
- uses: pypa/gh-action-pypi-publish@release/v1

README.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@
1111
PepSeqPred is a residue-level epitope prediction pipeline for protein workflows.
1212
It converts upstream assay and sequence data into training-ready artifacts, trains feed-forward neural network models on ESM-2 embeddings, produces binary residue masks for downstream inference, and supports post-training evaluation workflows on held-out datasets.
1313

14+
## Quickstart
15+
16+
PepSeqPred can be installed via:
17+
```bash
18+
pip install pepseqpred
19+
```
20+
21+
This API allows you to use any of the pretrained models in your own code, or load your own model(s) for downstream predictions.
22+
23+
Example usage:
24+
```python
25+
from pepseqpred import load_predictor
26+
27+
predictor = load_predictor("path/to/model.pt", device="cuda")
28+
result = predictor.predict_sequence("ACDEFGHIKLMNP")
29+
30+
print(result.binary_mask, result.n_epitopes)
31+
```
32+
33+
**Disclaimer:** The API is meant to be a simplified version of the overall codebase where you can build epitope inference into your existing/new workflows. To have more control over exactly how PepSeqPred works, feel free to fork this repository and ensure you adhere to the [GPL-3.0 license](LICENSE).
34+
1435
## About
1536

1637
PepSeqPred is designed for research workflows where you need to:

pyproject.toml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,23 @@ build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "pepseqpred"
7-
version = "1.0.0rc1"
7+
version = "0.1.2"
88
description = "Residue-level epitope prediction pipeline for peptide/protein workflows."
99
readme = "README.md"
1010
requires-python = ">=3.12"
11+
license = { file = "LICENSE" }
12+
authors = [
13+
{ name = "Jeffrey Hoelzel", email = "jmh2338@nau.edu" },
14+
{ name = "Jason Ladner", email = "jason.ladner@nau.edu" }
15+
]
16+
keywords = ["bioinformatics", "epitope", "protein", "esm2", "pytorch"]
17+
classifiers = [
18+
"Development Status :: 4 - Beta",
19+
"Intended Audience :: Science/Research",
20+
"Programming Language :: Python :: 3",
21+
"Programming Language :: Python :: 3.12",
22+
"Topic :: Scientific/Engineering :: Bio-Informatics"
23+
]
1124
dependencies = [
1225
"numpy>=2.3,<3",
1326
"pandas>=2.3,<3",
@@ -17,6 +30,11 @@ dependencies = [
1730
"optuna>=3.5,<5"
1831
]
1932

33+
[project.urls]
34+
Homepage = "https://github.com/LadnerLab/PepSeqPred"
35+
Repository = "https://github.com/LadnerLab/PepSeqPred"
36+
Issues = "https://github.com/LadnerLab/PepSeqPred/issues"
37+
2038
[project.optional-dependencies]
2139
dev = [
2240
"pytest>=8.0",

src/pepseqpred/__init__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"""Top-level package exports for PepSeqPred."""
2+
3+
from importlib.metadata import PackageNotFoundError, version
4+
5+
from pepseqpred.api import (
6+
PepSeqPredictor,
7+
PredictionResult,
8+
load_predictor,
9+
predict_fasta,
10+
predict_sequence
11+
)
12+
13+
try:
14+
__version__ = version("pepseqpred")
15+
except PackageNotFoundError:
16+
__version__ = "0+unknown"
17+
18+
__all__ = [
19+
"__version__",
20+
"PepSeqPredictor",
21+
"PredictionResult",
22+
"load_predictor",
23+
"predict_sequence",
24+
"predict_fasta"
25+
]

src/pepseqpred/api/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
"""Public-facing API for PepSeqPred inference."""
2+
3+
from pepseqpred.api.predictor import (
4+
PepSeqPredictor,
5+
load_predictor,
6+
predict_fasta,
7+
predict_sequence
8+
)
9+
from pepseqpred.api.types import PredictionResult
10+
11+
__all__ = [
12+
"PepSeqPredictor",
13+
"PredictionResult",
14+
"load_predictor",
15+
"predict_fasta",
16+
"predict_sequence"
17+
]

0 commit comments

Comments
 (0)