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

For a download link, visit our Installation page.

Prebuilt binaries exist for Mac OS X and Linux on the Release page. The latest version can be found here. We do not currently support a Windows native binary.

Python library

Gen is available as a package on pypi.org, so you can install it with

pip install gen

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/genhub-bio/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.31-cp314-cp314-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.14Windows x86-64

gen-0.1.31-cp314-cp314-manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

gen-0.1.31-cp314-cp314-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gen-0.1.31-cp313-cp313-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.13Windows x86-64

gen-0.1.31-cp313-cp313-manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

gen-0.1.31-cp313-cp313-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gen-0.1.31-cp312-cp312-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.12Windows x86-64

gen-0.1.31-cp312-cp312-manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

gen-0.1.31-cp312-cp312-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gen-0.1.31-cp311-cp311-win_amd64.whl (3.9 MB view details)

Uploaded CPython 3.11Windows x86-64

gen-0.1.31-cp311-cp311-manylinux_2_28_x86_64.whl (4.5 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

gen-0.1.31-cp311-cp311-macosx_11_0_arm64.whl (3.8 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: gen-0.1.31-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 826c0f7b4cadfbe2aec02882879b49496ca5ec14b08be193f64b3cabfeff7123
MD5 abdae9feb77c5e401fd9ae92150fb15c
BLAKE2b-256 3059253de942b1f536147852406fbe14fb664b43d525f41a67ad9dd6a6710d25

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp314-cp314-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 f8bb09cc6dcda3e4d795ae2ac471f8d21213e46bb0937232b4e389d12467f553
MD5 ca30432e54a4a87ee23187c361882838
BLAKE2b-256 dbbee43e69fdf0f8fa0171baa06203c2f49b8afc69d61c27fa1c99f622ce7676

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fccaf95051e63338e04458263116911d991b32d14f89bef67c94b989aa3f1413
MD5 25e7e7d04e485c26aded6817cab198fa
BLAKE2b-256 3874970a1132fa24c3731427a2cb604be63c7d13d8cca231a2d6c3c7c1538bca

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 d13a49824ccb1f570d002d380cc507ebd5158be9bf54a1db83e06e0ea84a4d26
MD5 6b8b8a88273205e79ceacb200e2c6fcc
BLAKE2b-256 aa173fd3bdf221c62cd41325d78c617358e9a00c0f4e7f4cdbffaddb55352867

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 07cc3deb3a1bf23ac9f0e131e0200354b5bcb85e18011da35555f684f11c3aba
MD5 6ca403577d555f6483b4f6c129e9f58a
BLAKE2b-256 33b97497e828b953f78fa4b9a43c3e6485a6df54d5d0285cb332ddf747e8a6dd

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 8d0dcfd16faf112970df9c3ed2f91ae4abc4e168546f45225f2d303b4677284b
MD5 682e9fd5ae1f43f79b0755460c7cf5fd
BLAKE2b-256 9c1772a7104b2ab0cebaab57685e923bbb5aad563443a22cd8513d43d3a835b6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 7e5bc33676d2eb9b16f76da4cf0c55c4053af0107ace0ce13fb89153ae2c022c
MD5 f2d8f4b9b169fcfbedda6b59aee78c91
BLAKE2b-256 58d2ad6fde9ea71b970760a00314c958303d6b0ca7d576095ea76d9a1002a0c1

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1113ab536c869efea3e39bd33e409ed871cb854a6a6696df2f566621cabeaed2
MD5 bf115b0c0be84d23e98f274535e77b37
BLAKE2b-256 0e525193cfba9b7511a817cbcdcdfd3da6ab9b47f8a569d3c418ee1d30ab961c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9855109bcdd8c72105c28ad38938f7f49a544dfb8a3df561ba85b7529e989629
MD5 c5f498cce2f14704dacedadea8de09f0
BLAKE2b-256 5cb56d95e1f69f10d97603c1348906b4cf82e69a2b6651a359c12ae9d72b6027

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 3.9 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 05b0f043eea31e3f8dd64c74250058f96325553331d66b8af34faf8cfd883842
MD5 a243de6e52510c09b90687c564b5ef3d
BLAKE2b-256 af68041002d2a8d2a3d08f05d03990b61f1c71a2ce28acd1bb970ce87df2f8c2

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 4.5 MB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 a5b6b471f23ab386099287f72a52da788d1a1088376d011daace202e31f17877
MD5 c465eeacedf21327b9fa50b71e40a39f
BLAKE2b-256 da1a4b18626e9ceffa0a62196c541b3a8ee3c4ff5bad9eb277459dd9b0071e9c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.1.31-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 3.8 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.7 {"installer":{"name":"uv","version":"0.11.7","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.31-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b1ce36a4dad2a361acd364f8e3107282d539e461063355fc98a4406b5fd22980
MD5 14f08131f68a818e4b3388969d8ffcdc
BLAKE2b-256 4e2d8765432f9cd5821864e174a9dca7ba5ac4ecf4f72e7e67c93950a0c1087f

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