Skip to main content

A LinkML data model for OpenCloning

Project description

OpenCloning_LinkML

A LinkML data model for OpenCloning, a standardized schema for describing molecular cloning strategies and DNA assembly protocols.

Website

You can access the model documentation at https://opencloning.github.io/OpenCloning_LinkML

Migration from previous versions of the schema

If you have json files in older formats, you can migrate them to the latest version using the migrate command:

python -m opencloning_linkml.migrations.migrate file.json

This will create a new file with the same name but with the suffix _backup.json with the original data, and overwrite the original file with the migrated data.

You can also specify a target version to migrate to:

python -m opencloning_linkml.migrations.migrate file.json --target-version 0.2.9

And you can skip the backup (simply edit in place):

python -m opencloning_linkml.migrations.migrate file.json --no-backup

Developer Documentation

The python package can be installed from PyPI:

pip install opencloning-linkml
Use the `make` command to generate project artefacts:
  • make all: make everything
  • make deploy: deploys site

Creating a migration

To add a migration from version X.Y.Z to a new version A.B.C, follow these steps:

  1. Archive the current model: Save a copy of the current Pydantic model to src/opencloning_linkml/migrations/model_archive/vA_B_C.py. This file should contain the complete model classes for version A.B.C (typically copied from src/opencloning_linkml/datamodel/_models.py after generating the new version).

  2. Create the transformation file: Create a new file src/opencloning_linkml/migrations/transformations/vX_Y_Z_to_vA_B_C.py with a migration function

  3. Register the migration: Add the migration to src/opencloning_linkml/migrations/__init__.py:

    • Import the migration function: from .transformations.vX_Y_Z_to_vA_B_C import migrate_X_Y_Z_to_A_B_C
    • Add it to the load_migrations() return dictionary: ("X.Y.Z", "A.B.C"): migrate_X_Y_Z_to_A_B_C
  4. Add a test: Add a test to tests/test_migration.py to ensure the migration works as expected.

Example: See v0_2_8_to_v0_2_9.py for a simple transformation example, or v0_2_9_to_v_0_4_0.py for a more complex migration with ID remapping and structural changes.

Credits

This project was made with linkml-project-cookiecutter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opencloning_linkml-0.4.6.tar.gz (136.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opencloning_linkml-0.4.6-py3-none-any.whl (72.5 kB view details)

Uploaded Python 3

File details

Details for the file opencloning_linkml-0.4.6.tar.gz.

File metadata

  • Download URL: opencloning_linkml-0.4.6.tar.gz
  • Upload date:
  • Size: 136.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for opencloning_linkml-0.4.6.tar.gz
Algorithm Hash digest
SHA256 79e2e71b220b80846bd9296adbe08028937647b49e96ee7a726dd12068885c4e
MD5 aa511f7fd9ca93e95dae78413c46ead4
BLAKE2b-256 118f223521ec61e34c8c403672bb77df53f9aa5156217adcf609a575d0a9b10d

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencloning_linkml-0.4.6.tar.gz:

Publisher: pypi-publish.yaml on OpenCloning/OpenCloning_LinkML

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file opencloning_linkml-0.4.6-py3-none-any.whl.

File metadata

File hashes

Hashes for opencloning_linkml-0.4.6-py3-none-any.whl
Algorithm Hash digest
SHA256 442f29c4450dedbde7fbc2b750c448de8f15243a1d6d906767e60b7c90a688c0
MD5 a26864b98c0963dc43d28d05b5587ef7
BLAKE2b-256 96898aa1e9c5fdc2c2a126c3fe5d0309f261e11fbaf32b7bf0b4c4f905ff230a

See more details on using hashes here.

Provenance

The following attestation bundles were made for opencloning_linkml-0.4.6-py3-none-any.whl:

Publisher: pypi-publish.yaml on OpenCloning/OpenCloning_LinkML

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page