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.28-cp314-cp314-win_amd64.whl (3.2 MB view details)

Uploaded CPython 3.14Windows x86-64

gen-0.1.28-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.28-cp314-cp314-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

gen-0.1.28-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.28-cp313-cp313-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

gen-0.1.28-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.28-cp312-cp312-macosx_11_0_arm64.whl (3.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

gen-0.1.28-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.28-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.28-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.28-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.28-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8393d4188eca7afb2102001f569af9f9bd7431fa2b60b509b9ee0664278793b0
MD5 48a8fd8be789e6177124ea5fc81fc0df
BLAKE2b-256 5420744f662c9a40a05e3d76a9dc14bb5b4d13ddd990e74b1424df81dc4a6df9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 10a0aa6eb250ccdcfafe51a701204247504b8eca6090c71892648d0e82543781
MD5 7239dd77b4705310fcafa4190a99270d
BLAKE2b-256 5c7164c4a25819c45244efdf5a72ec228551502570b3f3e95bc46721b2ee7980

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 46f3230afff30ca5b5ff22b9ef5f5a3299144d34a5cb33cb73777969e08e8dfa
MD5 5003d54d67411a1e6a167001df408100
BLAKE2b-256 df2682db252a520e5a6de488e609fab74976d89d1e4dc372206972da13da3cd1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3a95bf1c12cb6efa46dae2c8046ca09667eb1e4f0ddacb5ae71b30a288b1727c
MD5 0144ff9ffc263b42095575844dd6a79c
BLAKE2b-256 338a67b06dbc41dab696f49c5cf83f00fe777c890b85c4febcd894c9b355fc73

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 60c0ed0ab745f14f312a80486f57696e566ddfa7d913940feba82e79c225c72b
MD5 8a2a834bf987ed6a7bd79318e0a17062
BLAKE2b-256 94ee42ac4ebff7f9e83681efd8886640fb2bd0cef1753d451ec063e4a8c72410

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31d87dc103cd837baf5d90a8962d406843a6c12fccd07eab7a94201278316620
MD5 83943fa9b7068035bcdcfaa73f689a23
BLAKE2b-256 9f48e26b16771f87469e0cc5617c8c4352081d53559b902e7edde8c06d061c7e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 36ec7187cd6c9ae9aee7fd862b0ad9c4790c03e92ac45e3042d02aa83cebf387
MD5 8ccad0fd6deae2719175a9c8c8be9aef
BLAKE2b-256 b36f7e1f8ca2a474310c3ae19baeac6ea4cdc824475020f325348b1e2f7f4cd3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e3452fd6d8b104b66d82236f80f8cf2eb61508431c8eec2ce34fff275bb1e31f
MD5 2718a3af8bc8cb043c467cc9079bf435
BLAKE2b-256 182fabff8d6d9256397237213f7cee91d7e2d310db64fdd8ef68fb51c8976b21

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 4cb20020cfb39699a6983f820b6e88e24761fe3b1035fdb9c9209e8161bec668
MD5 c279bc4db10b19bb037e40271638e091
BLAKE2b-256 a443e06fc2d11d2bcf4c99b16d855d27a17fcc1623763f61a7436101481b51f6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 73dce3dd8c05d051a115db39598182e5c3cb0ddf227f7abfb826e46de7f2eccc
MD5 15a6d09f3ed01535b15a7f3c1244b223
BLAKE2b-256 c2b4fe77ee7b0b70b854b66538930bed9ad6390c5a5f293a48a62309a90daf69

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 76237323cc46af74622e2e71b84f7239d4e4d1032221ca147139db5d0935680b
MD5 638bccc148044a62d1cb54527fa5aafe
BLAKE2b-256 020c00f04b4d74da91a91ed5a40503a45cdec56e2a64b54cd6056e855eae7f3d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.28-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.28-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3ae7c5034a79cc0e0ba66656b918e67247f75de6763f09b09fadab193825425b
MD5 933fccaeb24278ecb9dbebdbcd6f3a56
BLAKE2b-256 0c3ffc92be9df49b2168916ac05d10c590c7ec4b77f1d924cb271d9ce057bb12

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