This monorepo contains the backend API and the database API. Before going further, please check out the project website and read the main project readme.
This repository contains two main packages and a CLI that are part of the OpenCloning project. Check out their respective readmes for more information on how to run them locally or using Docker:
- opencloning: the backend API for in silico cloning
- opencloning-db: the database API to store a collection of plasmids, primers, and lines.
- opencloning-cli: useful CLI for development and testing.
From the repository root:
# Install or update workspace dependencies
uv sync
# Run the cloning API
uv run uvicorn opencloning.main:app --reload --reload-exclude='.venv'From the repository root:
# Install or update workspace dependencies
uv sync
# Load required local runtime config
source .env.dev
# If you are using mac, you may have to stop any local Postgres instances running on port 5432
brew services stop postgresql
# Start local Postgres with dev/test/e2e databases
docker compose -f docker/docker-compose.postgres.yml up -d
# Seed the local database
uv run opencloning-cli db seed
# Run the database API
uv run uvicorn opencloning_db.combined:app --reload --reload-exclude='.venv'That will serve the cloning API at http://127.0.0.1:8000/cloning and the database API at http://127.0.0.1:8001/db.
This repository uses a uv workspace. In a workspace, dependencies are resolved in one shared environment, so imports can appear to work even when a package does not declare them in its own pyproject.toml.
To catch that, pre-commit runs deptry separately for opencloning and opencloning-db, each using that package’s pyproject.toml as the source of truth for declared dependencies.
Run them manually from the repository root:
uv run deptry --config packages/opencloning/pyproject.toml packages/opencloning/src
uv run deptry --config packages/opencloning-db/pyproject.toml packages/opencloning-db/srcYou can write python scripts to automate cloning using the python library pydna, which is now integrated with the OpenCloning data model. See the documentation for how to get started.
Check contribution guidelines in the main repository for general guidelines.
For more specific tasks:
- Creating a new type of source: follow the new source issue template. You can create an issue like that here.
Do not do the default:
uv add git+https://github.com/pydna-group/pydna --branch main
uv add git+https://github.com/pydna-group/pydna --rev 4fd760d075f77cceeb27969e017e04b42f6d0aa3
Instead, edit pyproject directly:
pydna @ git+https://github.com/pydna-group/pydna@fa00f2a1240bd2caae7a89c808a464f297209ecf
The reason for this is that otherwise you cannot install the package from pip from the repository, as the github version is not pinned. For the same reasons, you don't want to publish this to pypi, and this will make the action fail.
If resolution seems stale, clear uv’s cache:
uv cache clean