Skip to main content

Python bindings for the Gen graph database

Project description

Gen

Gen is a version control system for genetic sequences. It efficiently stores genome-length sequences and sequence variations, with native support for polyploid genomes and pooled genotypes. Each project is organized into a repository, where collections of sequences and associated data are stored and tracked over time. Within a repository, branches can be created to explore different modifications or variations without affecting the main project. These branches can later be merged to integrate results from different experiments or collaborators.

The gen client can import standard sequence file formats from sources like NCBI and genetic design tools. The sequence model takes the form of a graph structure as shown in the figure below. Each molecule is made up out of a network of nodes that represent sequence fragments, and edges that define how sequence fragments are connected. Multiple molecules are organized into collections that could represent the different chromosomes in a reference genome, proteins in a proteome, or pieces of DNA in a cloning reaction mixture. Molecules generally start out as a node that holds the reference sequence, and new edges and nodes are added for every sequence variant that is designed or observed. To reconstitute a linear sequence, the client walks from node to node along a defined path. This data model allows the representation of a wide range of biological complexity -- from a single molecule to complex cultivars and cell lines, including any naturally occurring variation in addition to intended engineering.

Figure 1

Figure 1: Block graph model representation of a sequence variant where two nucleotides AT are replaced by TG; the modified sequence (shown in bold) is stored as a path over a list of edges that address specific coordinates.

The block graph model is designed to be additive: new sequence variants only add to the graph, existing nodes are stable and do not have to be split to accomodate the new topology. This is different from the more commonly used segment graph model shown in Figure 2, and gen automatically converts between formats as needed.

Figure 2

Figure 2: Segment graph model corresponding to the sequence variant in Figure 1. The original sequence was split into 3 parts; the modified sequence path is defined by a list of nodes that refer to these segments. Nodes are labeled by their parent ID and starting coordinate, new edges internal to the reference are shown as dashed arrows.

Individual chromosomes or contigs are stored as block groups that refer to a specific grouping of edges from the main graph. Block groups are adressed on three facets: name, sample, and collection. The name is an identifier like "chromosome II", and the sample could refer to a real individual or a virtual outcome of an experiment. The meaning of a collection is flexible, and for example could refer to the type of data (genomic, protein, ...) or experiment.

Prebuilt binaries

Prebuilt binaries exist for various platforms and architectures on the Release page. The latest version can be found here.

Installing from Source

Make sure you have a Rust compiler installed on your system. You can install the Rust toolset using the rustup installer.

  1. Clone the source with git:

    git clone https://github.com/ginkgobioworks/gen.git
    cd rust
    
  2. Compile the gen package and its dependencies:

    cargo build --release
    
  3. You can find the gen executable in ./target/release/ or execute it via cargo:

    cargo run -- <arguments>
    

To cross-compile gen to run on a different architecture, you need to first add a target to the Rust toolchain and install a linker. For macOS to Linux this can be done as follows:

```
rustup target add x86_64-unknown-linux-gnu
brew install SergioBenitez/osxct/x86_64-unknown-linux-gnu
cargo build --release --target=x86_64-unknown-linux-gnu
```

The executable will be placed in ./target/x86_64-unknown-linux-gnu/release/

Usage

Gen is a command line tool with multiple subcommands that each have their own flags and arguments. The currently available commands are listed below and described in more detail here or built-in help pages (gen [COMMAND] --help).

Usage: gen [OPTIONS] [COMMAND]

Commands:
  import      Import a new sequence collection
  update      Update a sequence collection with new data
  init        Initialize a gen repository
  branch      Manage and create branches
  checkout    Migrate a database to a given operation
  reset       
  operations  View operations carried out against a database
  apply       
  export      Export a sequence collection
  defaults    Set a default database and collection to use
  help        Print this message or the help of the given subcommand(s)

Options:
  -d, --db <DB>  The path to the database you wish to utilize
  -h, --help     Print help
  -V, --version  Print version

Typical workflows are illustrated in these example workflows:

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

gen-0.1.27-cp314-cp314-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.14Windows x86-64

gen-0.1.27-cp314-cp314-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

gen-0.1.27-cp314-cp314-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gen-0.1.27-cp313-cp313-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.13Windows x86-64

gen-0.1.27-cp313-cp313-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

gen-0.1.27-cp313-cp313-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gen-0.1.27-cp312-cp312-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.12Windows x86-64

gen-0.1.27-cp312-cp312-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

gen-0.1.27-cp312-cp312-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gen-0.1.27-cp311-cp311-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.11Windows x86-64

gen-0.1.27-cp311-cp311-manylinux_2_28_x86_64.whl (3.9 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

gen-0.1.27-cp311-cp311-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

Details for the file gen-0.1.27-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.27-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 7c5aded1b54d3f0226f5f2dcb1ad02ca1bf74ab045471cc3eeba9a0818b443ef
MD5 b8ba5cf129bef0077e0378aeb3c5b08e
BLAKE2b-256 c167f5ad3cab76fcc5b605ec5f6d8964b726cee049c58b25a23e288b8ba7401e

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp314-cp314-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: gen-0.1.27-cp314-cp314-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 b04b41c2ff5361effa5e7aac178c6acc16b1320f97eb5948b2a877b304b45497
MD5 0a638c9a42eb0ad069f16a3c6d1f8dda
BLAKE2b-256 87df243a63c2080ff148a6f4acf0dff9e5f1630a7527630daba3d391cb9b5295

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp314-cp314-macosx_11_0_arm64.whl.

File metadata

  • Download URL: gen-0.1.27-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 5c3f59d4a98cf72d48b39a44caa34ae33cfc2ded71b3facdd0f686f6d6259621
MD5 b1f2a90c7f8147596ab026d8fbd06a7d
BLAKE2b-256 7a6b13d0bfbedbc7f04ce08bd25f50c38bfe0a62a84e84ed23b2d7ecb352a3da

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.27-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 ae1c61d45daec0849d8234db1b0620ae812234491733611637e33dca7f7b3185
MD5 d0d836f322c053418d77dab0172f5e5b
BLAKE2b-256 95a2f78f61fe6f427a91f7f4ec5a3a618812c7ff74e2d09d5449cd22dbfa6eff

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp313-cp313-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: gen-0.1.27-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 29a03aeeaab324a3504cf73389d484e87496545e1d9c885c6ad66bac6d7155b0
MD5 b4deedcfd704612a9cfc281ad5fe9266
BLAKE2b-256 9c2fb79a5f9a3bf6442a8f7a95a420bf83478e1c49b69a149d700aa533ab7b89

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp313-cp313-macosx_11_0_arm64.whl.

File metadata

  • Download URL: gen-0.1.27-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9bf6a75647550f4fc551df1874612266409747e223d197a8bd6032ca9a478bfa
MD5 4d9f999015eb4ae2c1c7a2d488cee8b7
BLAKE2b-256 50a9588ffebbd9510a7f85c6c552f2b6006603c9d768a9fb7874841aed161a24

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.27-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 e4441391f8b29f8947b0ecabde1769e15e4ae9fa3d890d69ec7195bdde7e111f
MD5 33be762dd71dc2f54b846439b21a01e5
BLAKE2b-256 23a96f20b8996abc4ef530bc1527533a1fdd5427952ff5cc785e67952d560185

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp312-cp312-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: gen-0.1.27-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e2bb59251f235a316e11abb42fb78738d5e0372dac27cca7a48977e05c0e61f3
MD5 d46aec8ffff1e9fc5cd77d08b236e093
BLAKE2b-256 6b7038f57e359c002d1fb97c24443b47216576d8c37585f5803a12781bf9d675

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

  • Download URL: gen-0.1.27-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c5e6303ee97d02cf5c11e70c6e39b031fdf325339f440d89e2ec3075e2ad4a29
MD5 db869e928a1dc57c32c74bd881a4d298
BLAKE2b-256 33bf0ea1d43592bc0e5df1f371e8cb463d79c328cb06623268d65b7eb24df83c

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.27-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 80e4e56c22e0e04a67bf40a1e468c204942e04873067174a18c8ff947b37c860
MD5 731a79cec1b4db7acb6cd9a5b2babe39
BLAKE2b-256 0432adb02e55dc2615bed6aeab110d4af58aeecd37579840d684230b4ea8134a

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp311-cp311-manylinux_2_28_x86_64.whl.

File metadata

  • Download URL: gen-0.1.27-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 64f9620e6915b097e11ce58a79d8441f6b40826ba9b5e3755b1d3fdb5a7a52e7
MD5 4ac53999268f585fc25af9dd4434b150
BLAKE2b-256 4807b6d264fb78f97343d30645162281c27e839ec188c47d8b6e4bc16a2bd369

See more details on using hashes here.

File details

Details for the file gen-0.1.27-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

  • Download URL: gen-0.1.27-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.2 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.10.5 {"installer":{"name":"uv","version":"0.10.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for gen-0.1.27-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 a62a6e972d180e887906cf3fe8eec5e28febdd3fa3f88a5faa8c7c5d77f4f74f
MD5 e7b9f1f0bc8b731270d4e77f0d3802be
BLAKE2b-256 f7b6a1bcca682c615dbb6823d4a8402915823254e7f6f641d09ce32033d55a07

See more details on using hashes here.

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