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

Uploaded CPython 3.13Windows x86-64

gen-0.1.22-cp313-cp313-manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.13macOS 11.0+ ARM64

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

Uploaded CPython 3.12Windows x86-64

gen-0.1.22-cp312-cp312-manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.12macOS 11.0+ ARM64

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

Uploaded CPython 3.11Windows x86-64

gen-0.1.22-cp311-cp311-manylinux_2_28_x86_64.whl (3.8 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

gen-0.1.22-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.22-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: gen-0.1.22-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.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 61339db49544c5d4b878d2f5f84bc5b3048692085454a54a8f339c54a0df0848
MD5 437c341f08b7df1ecb378397a6573976
BLAKE2b-256 66c30ae8f43366bfe03133fcac05ae02b3103985e7531609bcac18d72514b2d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 91c5f5274db8f8a3a8f8376a38b20bbe0c70a0918ba6a388f0f7a703b205c281
MD5 8d20b3b15e58c1650515604efc255bd7
BLAKE2b-256 045f41d0efde44b2a24fb52e5fac3583aa895bc12ee1d52020dc90ad3ae6a3bf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-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.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0d6810ce4f6fe7111348fee878d67dc2aa6722c8460644184023bad20534f4dc
MD5 ce902bf3fea8f65fe2cf1f51496ce737
BLAKE2b-256 2bf82432249e728bd228c50873247b9a7bc90f41dc8521be9834bb250f8bdfe1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-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.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 cb1c6b80fd5a9abe95ca8b8dfc81a05ce0c02d2e7bd0f6bba3044cbae84b244a
MD5 ba6c6986592ecd9a20627a85a9dc3c60
BLAKE2b-256 dfc4c54b469fac6e1d41df3b7dad21f6b71ee2ed7c244513ae2c2f1c0cfb592c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 30877b9836ba179bf2ffc44dd9b79b19c21bd94f31e8e96f8640230b29ecac95
MD5 9f8730db51d133c3ad192313485378ed
BLAKE2b-256 704c078ea834a6fc342135e707c498eaea65ac992c7ecb942e8390181bced217

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-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.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 27437a25586494a1af594a073005b83973d522911d2a188b31880fac9987edf0
MD5 46c03c0016e6674e8813e11bec96f3b2
BLAKE2b-256 32de8517accdebfa91ddfb44e51a40a94eb3632e0d93680b67c69d44feb2d44f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-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.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 534977a0e1dd9ecc4a3933ef6cfe41f66a293de69d76144d6c45063d06397e8d
MD5 bbc5ae1c3ef2b0443465322ee2093b69
BLAKE2b-256 7707d3093ebe170bdb220da98722a40bc04d94f86b227ac6123e2e9e3c123d7d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 75aba9abb8925ec6247b1f6ee0c08d034d1fe51a694927e9f426844dc0507739
MD5 122c5ab663388cdf469757a431feeca1
BLAKE2b-256 b9b0bdaaaf1af017912677b47b439c48dde06689332f2ca78542dc2b2d1ecdea

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.22-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.9.27 {"installer":{"name":"uv","version":"0.9.27","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.22-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 be6a3f480104615b3e3c69ea1f7bbfa55a351f590e0f8251f46e3ab15c949c4f
MD5 116f7e3af2e75e5b615f6a845f18f283
BLAKE2b-256 430caab210691ef7cd8176a2422febca7ed5c77908bae1e9f6c96949083d71aa

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