mrnavax 0.14.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.
- mrnavax-0.14.0/.github/workflows/docs.yml +47 -0
- mrnavax-0.14.0/.github/workflows/publish.yml +93 -0
- mrnavax-0.14.0/.github/workflows/smoke.yml +98 -0
- mrnavax-0.14.0/.gitignore +15 -0
- mrnavax-0.14.0/CHANGELOG.md +525 -0
- mrnavax-0.14.0/LICENSE +12 -0
- mrnavax-0.14.0/LICENSE-AGPL +393 -0
- mrnavax-0.14.0/PKG-INFO +415 -0
- mrnavax-0.14.0/README.md +348 -0
- mrnavax-0.14.0/docs/api.md +48 -0
- mrnavax-0.14.0/docs/backends.md +66 -0
- mrnavax-0.14.0/docs/backends.zh-Hans.md +63 -0
- mrnavax-0.14.0/docs/backends.zh-Hant.md +63 -0
- mrnavax-0.14.0/docs/changelog.md +40 -0
- mrnavax-0.14.0/docs/contributing.md +81 -0
- mrnavax-0.14.0/docs/contributing.zh-Hans.md +76 -0
- mrnavax-0.14.0/docs/contributing.zh-Hant.md +76 -0
- mrnavax-0.14.0/docs/getting-started.md +62 -0
- mrnavax-0.14.0/docs/getting-started.zh-Hans.md +60 -0
- mrnavax-0.14.0/docs/getting-started.zh-Hant.md +60 -0
- mrnavax-0.14.0/docs/index.md +106 -0
- mrnavax-0.14.0/docs/index.zh-Hans.md +100 -0
- mrnavax-0.14.0/docs/index.zh-Hant.md +94 -0
- mrnavax-0.14.0/docs/license.md +22 -0
- mrnavax-0.14.0/docs/tools/codon.md +116 -0
- mrnavax-0.14.0/docs/tools/codon.zh-Hans.md +37 -0
- mrnavax-0.14.0/docs/tools/codon.zh-Hant.md +33 -0
- mrnavax-0.14.0/docs/tools/lnp.md +62 -0
- mrnavax-0.14.0/docs/tools/lnp.zh-Hans.md +61 -0
- mrnavax-0.14.0/docs/tools/lnp.zh-Hant.md +58 -0
- mrnavax-0.14.0/docs/tools/manufacture.md +55 -0
- mrnavax-0.14.0/docs/tools/manufacture.zh-Hans.md +53 -0
- mrnavax-0.14.0/docs/tools/manufacture.zh-Hant.md +50 -0
- mrnavax-0.14.0/docs/tools/neoantigen.md +120 -0
- mrnavax-0.14.0/docs/tools/neoantigen.zh-Hans.md +52 -0
- mrnavax-0.14.0/docs/tools/neoantigen.zh-Hant.md +52 -0
- mrnavax-0.14.0/docs/tools/scrna.md +206 -0
- mrnavax-0.14.0/docs/tools/scrna.zh-Hans.md +137 -0
- mrnavax-0.14.0/docs/tools/scrna.zh-Hant.md +133 -0
- mrnavax-0.14.0/docs/tools/spatial.md +136 -0
- mrnavax-0.14.0/docs/tools/spatial.zh-Hans.md +126 -0
- mrnavax-0.14.0/docs/tools/spatial.zh-Hant.md +126 -0
- mrnavax-0.14.0/docs/tools/trial.md +133 -0
- mrnavax-0.14.0/docs/tools/trial.zh-Hans.md +54 -0
- mrnavax-0.14.0/docs/tools/trial.zh-Hant.md +53 -0
- mrnavax-0.14.0/mkdocs.yml +135 -0
- mrnavax-0.14.0/mrnavax/__init__.py +6 -0
- mrnavax-0.14.0/mrnavax/alphamissense_integration.py +312 -0
- mrnavax-0.14.0/mrnavax/backends.py +1349 -0
- mrnavax-0.14.0/mrnavax/cli.py +179 -0
- mrnavax-0.14.0/mrnavax/codon_lineardesign.py +359 -0
- mrnavax-0.14.0/mrnavax/codon_optimizer.py +383 -0
- mrnavax-0.14.0/mrnavax/codon_protocols.py +189 -0
- mrnavax-0.14.0/mrnavax/codon_ribodecode.py +283 -0
- mrnavax-0.14.0/mrnavax/codon_ribodecode_adapter.py +491 -0
- mrnavax-0.14.0/mrnavax/examples/cas9.fasta +2 -0
- mrnavax-0.14.0/mrnavax/examples/cells.csv +21 -0
- mrnavax-0.14.0/mrnavax/examples/patient_summary.txt +5 -0
- mrnavax-0.14.0/mrnavax/examples/proteins.fasta +6 -0
- mrnavax-0.14.0/mrnavax/examples/ribo_weights_example.json +67 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/cas9_analysis.json +34 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/cas9_optimized.json +73 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/lnp_liver_cas9.json +51 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/lnp_lung_sarna.json +51 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/lnp_tumor.json +37 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/scrna_sample.json +1838 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/tp53_screen.json +52 -0
- mrnavax-0.14.0/mrnavax/examples/sample_outputs/trial_match.json +68 -0
- mrnavax-0.14.0/mrnavax/examples/tp53_variants.csv +6 -0
- mrnavax-0.14.0/mrnavax/examples/trials.jsonl +5 -0
- mrnavax-0.14.0/mrnavax/examples/variants_coding.csv +8 -0
- mrnavax-0.14.0/mrnavax/foundation_embedder.py +154 -0
- mrnavax-0.14.0/mrnavax/llm.py +247 -0
- mrnavax-0.14.0/mrnavax/lnp_advisor.py +260 -0
- mrnavax-0.14.0/mrnavax/manufacturability.py +546 -0
- mrnavax-0.14.0/mrnavax/medcpt_integration.py +159 -0
- mrnavax-0.14.0/mrnavax/medcpt_retriever.py +245 -0
- mrnavax-0.14.0/mrnavax/neoantigen_screener.py +352 -0
- mrnavax-0.14.0/mrnavax/protein_lm_adapter.py +380 -0
- mrnavax-0.14.0/mrnavax/protein_lm_protocols.py +170 -0
- mrnavax-0.14.0/mrnavax/sc_rna_pipeline.py +637 -0
- mrnavax-0.14.0/mrnavax/scgpt_integration.py +332 -0
- mrnavax-0.14.0/mrnavax/scripts/stmodule_shim.R +167 -0
- mrnavax-0.14.0/mrnavax/spatial_module_adapter.py +369 -0
- mrnavax-0.14.0/mrnavax/spatial_protocols.py +227 -0
- mrnavax-0.14.0/mrnavax/trial_llm.py +358 -0
- mrnavax-0.14.0/mrnavax/trial_matcher.py +397 -0
- mrnavax-0.14.0/mrnavax/trial_similar.py +413 -0
- mrnavax-0.14.0/mrnavax/variant_scorer.py +816 -0
- mrnavax-0.14.0/pyproject.toml +97 -0
- mrnavax-0.14.0/scripts/smoke.sh +34 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
name: docs
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
workflow_dispatch:
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
pages: write
|
|
11
|
+
id-token: write
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: pages
|
|
15
|
+
cancel-in-progress: true
|
|
16
|
+
|
|
17
|
+
jobs:
|
|
18
|
+
build:
|
|
19
|
+
runs-on: ubuntu-latest
|
|
20
|
+
steps:
|
|
21
|
+
- uses: actions/checkout@v4
|
|
22
|
+
|
|
23
|
+
- uses: actions/setup-python@v5
|
|
24
|
+
with:
|
|
25
|
+
python-version: "3.12"
|
|
26
|
+
|
|
27
|
+
- name: Install
|
|
28
|
+
run: |
|
|
29
|
+
python -m pip install --upgrade pip
|
|
30
|
+
pip install -e ".[docs]"
|
|
31
|
+
|
|
32
|
+
- name: Build
|
|
33
|
+
run: mkdocs build --strict
|
|
34
|
+
|
|
35
|
+
- uses: actions/upload-pages-artifact@v3
|
|
36
|
+
with:
|
|
37
|
+
path: site
|
|
38
|
+
|
|
39
|
+
deploy:
|
|
40
|
+
needs: build
|
|
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,93 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
|
|
3
|
+
# Publish Python distribution to PyPI via Trusted Publishing (OIDC).
|
|
4
|
+
# Triggered ONLY by tag pushes (e.g. `git tag v0.13.1 && git push --tags`).
|
|
5
|
+
#
|
|
6
|
+
# Setup (one-time, requires PyPI admin):
|
|
7
|
+
# 1. Go to https://pypi.org/manage/account/publishing/
|
|
8
|
+
# 2. Register a new pending trusted publisher:
|
|
9
|
+
# - Owner: rollroyces
|
|
10
|
+
# - Repository: mrnavax
|
|
11
|
+
# - Workflow: publish.yml <-- THIS file
|
|
12
|
+
# - Environment: pypi
|
|
13
|
+
# 3. Create the matching GitHub Environment in repo Settings → Environments:
|
|
14
|
+
# - "pypi" — require manual approval before deploy (recommended)
|
|
15
|
+
#
|
|
16
|
+
# Then future workflow:
|
|
17
|
+
# git tag vX.Y.Z && git push --tags
|
|
18
|
+
# # → builds dist → uploads to PyPI automatically (after approval).
|
|
19
|
+
|
|
20
|
+
on:
|
|
21
|
+
push:
|
|
22
|
+
tags:
|
|
23
|
+
- 'v*'
|
|
24
|
+
|
|
25
|
+
# Cancel any in-flight publish run when a new tag is pushed.
|
|
26
|
+
concurrency:
|
|
27
|
+
group: publish
|
|
28
|
+
cancel-in-progress: false # never cancel a partially-completed PyPI upload
|
|
29
|
+
|
|
30
|
+
# Required for OIDC token (Trusted Publishing).
|
|
31
|
+
permissions:
|
|
32
|
+
contents: read
|
|
33
|
+
id-token: write
|
|
34
|
+
|
|
35
|
+
jobs:
|
|
36
|
+
build:
|
|
37
|
+
name: Build distribution
|
|
38
|
+
runs-on: ubuntu-latest
|
|
39
|
+
|
|
40
|
+
steps:
|
|
41
|
+
- uses: actions/checkout@v4
|
|
42
|
+
with:
|
|
43
|
+
persist-credentials: false
|
|
44
|
+
|
|
45
|
+
- name: Set up Python
|
|
46
|
+
uses: actions/setup-python@v5
|
|
47
|
+
with:
|
|
48
|
+
python-version: "3.12"
|
|
49
|
+
|
|
50
|
+
- name: Install build
|
|
51
|
+
run: python -m pip install --upgrade pip build
|
|
52
|
+
|
|
53
|
+
- name: Build sdist + wheel
|
|
54
|
+
run: python -m build --sdist --wheel
|
|
55
|
+
|
|
56
|
+
- name: Verify built artifacts
|
|
57
|
+
run: |
|
|
58
|
+
ls -lh dist/
|
|
59
|
+
# Sanity-check that the wheel version matches the git tag.
|
|
60
|
+
WHL_VER=$(python -c "import tomllib; print(tomllib.load(open('pyproject.toml','rb'))['project']['version'])")
|
|
61
|
+
TAG_VER=${GITHUB_REF_NAME#v}
|
|
62
|
+
echo "pyproject version: $WHL_VER"
|
|
63
|
+
echo "git tag version: $TAG_VER"
|
|
64
|
+
if [ "$WHL_VER" != "$TAG_VER" ]; then
|
|
65
|
+
echo "::error::pyproject.toml version ($WHL_VER) does not match git tag ($TAG_VER)"
|
|
66
|
+
exit 1
|
|
67
|
+
fi
|
|
68
|
+
|
|
69
|
+
- name: Upload artifacts
|
|
70
|
+
uses: actions/upload-artifact@v4
|
|
71
|
+
with:
|
|
72
|
+
name: python-package-distributions
|
|
73
|
+
path: dist/
|
|
74
|
+
if-no-files-found: error
|
|
75
|
+
|
|
76
|
+
publish-to-pypi:
|
|
77
|
+
name: Publish to PyPI
|
|
78
|
+
needs: build
|
|
79
|
+
runs-on: ubuntu-latest
|
|
80
|
+
environment:
|
|
81
|
+
# Manual approval gate is configured under repo Settings → Environments → pypi
|
|
82
|
+
name: pypi
|
|
83
|
+
url: https://pypi.org/project/mrnavax/
|
|
84
|
+
|
|
85
|
+
steps:
|
|
86
|
+
- uses: actions/download-artifact@v4
|
|
87
|
+
with:
|
|
88
|
+
name: python-package-distributions
|
|
89
|
+
path: dist/
|
|
90
|
+
|
|
91
|
+
- name: Publish to PyPI
|
|
92
|
+
uses: pypa/gh-action-pypi-publish@release/v1
|
|
93
|
+
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
name: smoke
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
smoke:
|
|
11
|
+
name: python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.11", "3.12", "3.13", "3.14"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Set up Python ${{ matrix.python-version }}
|
|
22
|
+
uses: actions/setup-python@v5
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: CLI help (sanity)
|
|
27
|
+
run: |
|
|
28
|
+
python -m mrnavax.cli --help
|
|
29
|
+
for tool in codon neoantigen trial lnp scrna; do
|
|
30
|
+
python -m mrnavax.cli $tool --help
|
|
31
|
+
done
|
|
32
|
+
|
|
33
|
+
- name: Codon analyze
|
|
34
|
+
run: |
|
|
35
|
+
python -m mrnavax.cli codon \
|
|
36
|
+
--sequence mrnavax/examples/cas9.fasta \
|
|
37
|
+
--out /tmp/cas9_analysis.json
|
|
38
|
+
test -s /tmp/cas9_analysis.json
|
|
39
|
+
python -c "import json; d=json.load(open('/tmp/cas9_analysis.json')); assert d['n_codons']>0; assert 0<=d['cai']<=1; print('codon OK:', d['cai'])"
|
|
40
|
+
|
|
41
|
+
- name: Codon optimize
|
|
42
|
+
run: |
|
|
43
|
+
python -m mrnavax.cli codon \
|
|
44
|
+
--sequence mrnavax/examples/cas9.fasta --optimize \
|
|
45
|
+
--out /tmp/cas9_optimized.json
|
|
46
|
+
python -c "import json; d=json.load(open('/tmp/cas9_optimized.json')); assert d['after']['cai']>d['before']['cai']; print('optimize OK:', d['before']['cai'],'->',d['after']['cai'])"
|
|
47
|
+
|
|
48
|
+
- name: Neoantigen screen (mock)
|
|
49
|
+
run: |
|
|
50
|
+
python -m mrnavax.cli neoantigen \
|
|
51
|
+
--variants mrnavax/examples/tp53_variants.csv \
|
|
52
|
+
--hla HLA-A*02:01 --backend mock \
|
|
53
|
+
--out /tmp/tp53_screen.json
|
|
54
|
+
python -c "import json; d=json.load(open('/tmp/tp53_screen.json')); assert len(d['candidates'])>=5; print('neoantigen OK:', len(d['candidates']),'calls')"
|
|
55
|
+
|
|
56
|
+
- name: Trial match (mock)
|
|
57
|
+
run: |
|
|
58
|
+
python -m mrnavax.cli trial \
|
|
59
|
+
--patient mrnavax/examples/patient_summary.txt \
|
|
60
|
+
--trials mrnavax/examples/trials.jsonl --top-k 5 \
|
|
61
|
+
--backend mock \
|
|
62
|
+
--out /tmp/trial_match.json
|
|
63
|
+
python -c "import json; d=json.load(open('/tmp/trial_match.json')); assert len(d['ranked'])>=1; print('trial OK:', d['ranked'][0]['nct_id'])"
|
|
64
|
+
|
|
65
|
+
- name: LNP advise
|
|
66
|
+
run: |
|
|
67
|
+
for target in liver lung tumor; do
|
|
68
|
+
python -m mrnavax.cli lnp --target $target --cargo mRNA \
|
|
69
|
+
--intent "cancer vaccine" --out /tmp/lnp_$target.json
|
|
70
|
+
done
|
|
71
|
+
python -c "import json; d=json.load(open('/tmp/lnp_lung.json')); assert d['shortlist']; print('lnp OK:', len(d['shortlist']),'candidates')"
|
|
72
|
+
|
|
73
|
+
- name: scRNA pipeline
|
|
74
|
+
run: |
|
|
75
|
+
python -m mrnavax.cli scrna \
|
|
76
|
+
--expression mrnavax/examples/cells.csv \
|
|
77
|
+
--variants mrnavax/examples/variants_coding.csv \
|
|
78
|
+
--proteins mrnavax/examples/proteins.fasta \
|
|
79
|
+
--tumor-markers TP53,KRAS,BRAF \
|
|
80
|
+
--out /tmp/scrna.json
|
|
81
|
+
python -c "import json; d=json.load(open('/tmp/scrna.json')); assert d['n_cells']>0; assert d['n_candidate_peptides']>0; assert 'tumor_cluster' in d; print('scrna OK:', d['n_candidate_peptides'],'peptides from cluster', d['tumor_cluster'])"
|
|
82
|
+
|
|
83
|
+
- name: Backend integrity check (network-free)
|
|
84
|
+
env:
|
|
85
|
+
MRNA_AI_FORCE_MOCK: "1"
|
|
86
|
+
MRNA_AI_SKIP_MEDCPT_CHECK: "1"
|
|
87
|
+
run: |
|
|
88
|
+
python -m mrnavax.backends --check-all
|
|
89
|
+
# Also install-validate each optional extra's import path (without invoking models).
|
|
90
|
+
python -c "
|
|
91
|
+
# Stdlib-only core must work
|
|
92
|
+
from mrnavax import codon_optimizer, neoantigen_screener, trial_matcher, lnp_advisor, sc_rna_pipeline, llm, backends
|
|
93
|
+
print('core imports: OK')
|
|
94
|
+
|
|
95
|
+
# Optional: confirm mhcflurry is callable as a function even when not installed
|
|
96
|
+
from mrnavax.neoantigen_screener import _mhcflurry_available
|
|
97
|
+
print('mhcflurry_available():', _mhcflurry_available())
|
|
98
|
+
"
|