A FastAPI wrapper around
naturalis/barcode_validator.
It validates batches of DNA barcodes against the upstream package's marker-specific
length and ambiguity criteria and also rejects non-IUPAC characters.
Supported markers are COI-5P, matK, rbcL, ITS, and ITS2.
Python 3.11–3.13 is supported.
uv sync --extra dev
uv run uvicorn app.main:app --reloadOpen http://localhost:8000/docs for the generated OpenAPI UI.
curl -X POST http://localhost:8000/v1/validate \
-H 'content-type: application/json' \
-d '{
"marker": "ITS",
"barcodes": [
{"id": "sample-1", "sequence": "ACGTACGT"}
],
"min_length": 8,
"max_ambiguities": 0
}'The response contains one result per barcode, individual check outcomes, and an
all_valid batch summary. Whitespace is removed from sequences and bases are
normalized to uppercase.
Request limits:
- 100 barcodes per request
- 100,000 characters per barcode before whitespace normalization
This API reports validation_scope: "core_structural". It uses the upstream
package's structural measurement and marker-criteria classes for:
- IUPAC DNA alphabet checks
- minimum barcode length
- maximum ambiguous-base count
It does not perform HMM alignment, stop-codon analysis, or taxonomic validation. Those upstream workflows require HMMER and project-specific taxonomy/reference data, which are not meaningful without deployment-specific configuration.
uv run --extra dev pytest
uv run --extra dev ruff check .docker build -t dna-barcode-validator-api .
docker run --rm -p 8000:8000 dna-barcode-validator-apiThe repository includes a Render Blueprint and a GitHub Actions
CI workflow. Pull requests and pushes to main run linting and tests. Render
deploys pushes to main only after those GitHub checks pass.
One-time setup:
- In Render, create a new Blueprint and connect this GitHub repository. Render
will read
render.yamland create the Docker web service. - Confirm that the service is linked to the repository's
mainbranch and that Auto-Deploy is set to After CI Checks Pass. The Blueprint'sautoDeployTrigger: checksPassconfigures this automatically when synced. - Push or merge a commit to
main. GitHub Actions will run the checks, and Render will deploy the commit after they succeed.
No GitHub deploy-hook secret is required. The configured /health endpoint is
used by Render to decide when the new instance is ready to receive traffic.