Tooling for accessing and managing primer schemes
Project description
Primaschema
A toolkit for fetching, validating and interrogating tiled amplicon PCR primer scheme definitions. Provides convenient programmatic access to the PHA4GE primer-schemes repository, a community repository of tiled amplicon primer schemes.
Production install (Python 3.12+)
Recommended:
uv tool install primaschema
Alternatives:
pipx install primaschema
# or
python -m pip install primaschema
Quick start
Download a scheme from the default index and validate it:
primaschema get example-scheme/400/v1.0.0 --output ./schemes
primaschema validate ./schemes/example-scheme/400/v1.0.0/info.json
Show CLI help or version:
primaschema --help
primaschema --show-version
Common commands
create: Create a new scheme from aprimer.bedandreference.fasta.validate: Validate a single scheme or all schemes under a directory.rebuild: Recompute checksums, regenerate scheme README, and optionally reformatprimer.bed.index: Build or update anindex.jsonfor a local schemes directory.get: Download schemes from an index (default is the PHA4GE primer-schemes index).modify: Update contributors, vendors, tags, status, license, target organisms, and algorithm fields.
Scheme creation
mkdir -p ./schemes && rm -rf ./schemes/example-scheme
primaschema create \
--name example-scheme \
--amplicon-size 400 \
--version v1.0.0 \
--contributors "name=Alice Smith,email=alice@example.org" \
--target-organisms "common_name=Example organism,ncbi_tax_id=000001" \
--status VALIDATED \
--bed-path ./example-scheme.primer.bed \
--reference-path ./example-scheme.reference.fasta \
--primer-schemes-path ./schemes
The scheme is written to ./schemes/example-scheme/400/v1.0.0/.
Environment
Many commands accept --primer-schemes-path. You can also set it once:
export PRIMER_SCHEMES_PATH=./schemes
Development
git clone https://github.com/pha4ge/primaschema.git
cd primaschema
uv sync --all-extras
uv run primaschema --help
uv run pytest
uv run pre-commit install
uv run pre-commit run --all-files
uv sync --all-extras installs optional dependencies, including the dev extra (e.g. pytest, pre-commit, ruff) defined in pyproject.toml.
The Pydantic model (src/primaschema/schema/info.py) is generated from the LinkML schema (src/primaschema/schema/info.yml). After modifying the schema, regenerate with:
uv run gen-pydantic src/primaschema/schema/info.yml --meta None > src/primaschema/schema/info.py
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file primaschema-0.3.0.tar.gz.
File metadata
- Download URL: primaschema-0.3.0.tar.gz
- Upload date:
- Size: 30.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8193595cceb18a7874153680b22a71e5754073be6907828db4519ca3fb435496
|
|
| MD5 |
1bf7801aad50a45be75b37892f21e1fc
|
|
| BLAKE2b-256 |
361affeb464dd77e1a9684482954550e91ef62b9e472cc73216b547edc95bace
|
File details
Details for the file primaschema-0.3.0-py3-none-any.whl.
File metadata
- Download URL: primaschema-0.3.0-py3-none-any.whl
- Upload date:
- Size: 35.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.9.11 {"installer":{"name":"uv","version":"0.9.11"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
22361a8cc8b0125be3119c7321f42ce03ff0173c1b913fdd2bcab98dcb996f9a
|
|
| MD5 |
1085bf91e5d778afff4b0888e2f965bc
|
|
| BLAKE2b-256 |
2dd599f2ccdeb179d2b7f543f84eb22698b5bcec8bde58896bb6f55da004b0d3
|