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

Uploaded CPython 3.14Windows x86-64

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

Uploaded CPython 3.14macOS 11.0+ ARM64

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

Uploaded CPython 3.13Windows x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

gen-0.1.26-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.26-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.26-cp314-cp314-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.26-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.26-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 50ff28948061568e88e8835b90ca33989d44499eb57b60b1c5a7bc54c26e6b70
MD5 bf4d6777937c7a752995d85f4fc243b8
BLAKE2b-256 34c0efef42d89774aade00e0eb2c5b288cfc3059c688e2afc8a1352f93af76c4

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 c04ad70558c3a12770f722c6c5c0b67467e67c3801d4053765dafde9fbe26bfd
MD5 2b8fc2e88cfa79998ab71165eb386dda
BLAKE2b-256 5fea73c4c6e3959dfce6d03ece226294f0ee389e6ec3cf03bf679d22cbf4656e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1a7efa9b6529605647eb3c32325408c51bdd6bef4744a08d3bc139eb9fcb82cc
MD5 ebff644946d3c771d5175393bae9fa56
BLAKE2b-256 f495ebc3fe0b24f120e1b1aa48ab7a54281e37791368f33cfbb75c02aea47d4d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 f93031fe46931a11cf6e915fccd898c8b3448c8c0eebf8f05ff13838e627faa8
MD5 f18822c62ed7392188651e1a17456b56
BLAKE2b-256 9e63b5f25e570a26e4a6ed7b58de883d69262241067aac77a9b53185163494b0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 317ad9970e5a0b735c3fb0b796fa9a4c083d57513299071af1c8f15405b6bc5a
MD5 05f95e0821a604b3af03b6fbf22e23cc
BLAKE2b-256 4e3a77a4c57a2afbe77423db5d9308434731582a6685a7864ad2b5f9970d86aa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 69866677c138e76547ef320cff6ec831c39c9d63055c64056a50e71c3c664abe
MD5 b9197baffcba2ffeb238fec48fd0bf06
BLAKE2b-256 e5190d6005bab9d6f61a8333def42e2a219e415c7075f69fffbcb7d684a9a621

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 5aea36136c3b44603841cb7beed67ae7930610e0437a50b8802c8704d2082956
MD5 03823b0d8e7ceb1b8cad5a2de91665c6
BLAKE2b-256 285a9f1418a08728f8c39e472f27fbe17b7e336731db0bec13d08dd189f0572f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 7617b265f00e4405c99ee67e74b34537250427fba5943d8efaedc0b30b0f38ea
MD5 901886e6eb71dd277444ff7f96782c44
BLAKE2b-256 e847d5e5e9f60e6bff9c9357409bf1dc81568e2c228d8ca3bc4eace3e9e96e51

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 655b1f44875763b5a7ea41566db12513def200b91ba22aa00bfc8fd17a212693
MD5 c55df548672cf77c2e0cf7b72f74715b
BLAKE2b-256 22934fbe49cf6e080f28521c392326b6cd77587d656a7cacabcfbbf20f9e8df7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 3edb08dc172e1198d2e9e602a8cf760f584ec0ae57128558d9e0da6d685e5347
MD5 2345bc75a6393cdf5fe1816e5e4b448d
BLAKE2b-256 be35f6206d591e9b1e71134fa22bf2380902206ecf7195b8d5aad61f484a3959

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e5826b84d570296f174e99dd67808d5a0c3197c5ef342df724bc1e82e3abecb5
MD5 a05e2ea08f5b6b68278f0723215adc53
BLAKE2b-256 3a636ea68ad09b69511ebc6b4e7ba9b2a35ed7af708f65f2185aacac51c79d05

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.26-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.26-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 7d2c878477db33a4598b6271a5fe8f562416b16dcee77f8e80cb499454cbdd79
MD5 0d456f57e525e4009a9a340a9ee47ab4
BLAKE2b-256 3df18b62068c636481bb4fb39b12b36236406357ffcbc8dda3439cd03ccdfd28

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