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

Uploaded CPython 3.14Windows x86-64

gen-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.14manylinux: glibc 2.28+ x86-64

gen-0.2.0-cp314-cp314-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.14macOS 11.0+ ARM64

gen-0.2.0-cp313-cp313-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.13Windows x86-64

gen-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.28+ x86-64

gen-0.2.0-cp313-cp313-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.13macOS 11.0+ ARM64

gen-0.2.0-cp312-cp312-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.12Windows x86-64

gen-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.28+ x86-64

gen-0.2.0-cp312-cp312-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

gen-0.2.0-cp311-cp311-win_amd64.whl (10.0 MB view details)

Uploaded CPython 3.11Windows x86-64

gen-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl (11.4 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.28+ x86-64

gen-0.2.0-cp311-cp311-macosx_11_0_arm64.whl (10.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

File details

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

File metadata

  • Download URL: gen-0.2.0-cp314-cp314-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.14, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp314-cp314-win_amd64.whl
Algorithm Hash digest
SHA256 8bc4afa7ede0ef42be67cf500f70eadaacbe4ff5ea87e73a6bd090b2fd53acde
MD5 2e3576474c540cb4cbb35fa82f9b5cf5
BLAKE2b-256 9ec235b806cf936c41f017555dcff01f0ab2ea1423a16004d9fd0ab11fb166ee

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp314-cp314-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.14, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp314-cp314-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 1def510080c93f456a33e308485445aa585fac89ac16ff306dc9e79ab50d262a
MD5 5bcbe332009d11cfd8a2b9fafe7ac33e
BLAKE2b-256 67cba8cbf99059d1ca808e1463a5240fa671b8ebdd4c7197a7297991178aeb13

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp314-cp314-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.14, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp314-cp314-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 f25b186d6ddb12d93333392d7a9fd858da5a1b3b2471212a154a5484eec410d3
MD5 1481daa361670e9fdeabb6f160cbb0ae
BLAKE2b-256 89e24ae71c8b01153782c6e5537352d1ebd710ddbaeda1029505d20060662d0d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 3c3887f2e406e63eed6153c182b9080192ca4e671d220944bd2077922c1ca209
MD5 61cd08546cd8ae37eed375491a430ff0
BLAKE2b-256 efa5207e39f868968b5ac82978b50590133f636865087392450baafa869bc2c9

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.13, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp313-cp313-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fe8fdca5df9c9063de2380ffe98bebac6bf29ef3cc7ea31d157a47e175ecc554
MD5 6ce17aa6edecfbfae37f5e6f92d79d12
BLAKE2b-256 1fe4217adbc9f6681217f36ae39e793c9c836d24975955682282fe0c188e3749

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp313-cp313-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.13, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp313-cp313-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 b4855767ee738084e3ac7d91cf244a404a9dcf8ce309586646fd6594727de0bc
MD5 a613d08cc949ed80ffa78c76c9fbb563
BLAKE2b-256 f06d6c723838c263338026a330ae1ace23fbce4c3765ea484b2ae41c6a7f28b7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 92f8a571b76c97780dec1b338c30fe833eb358ae82221babd40fd31edd0a883e
MD5 0413397e2a5208099f54bcf9926bf41e
BLAKE2b-256 02a7f98d9799921c126db0e705220047ea3df5e979525722d31bd6d3e3d83ce8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.12, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp312-cp312-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ad5f82c2a3f1c9ef104d6505c3f1f19ed5b9bb8588f6fa729a37c561aa810a96
MD5 5268d40331e15124ce7645938638617e
BLAKE2b-256 26ec40e6e021e23e795f6356d9dfbff672c54e2c7752337ed6f732b99e31079d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp312-cp312-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.12, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 155db6b9eb4ab92cf1ee90d7e80d6568f7214536203bbdf982faaa6056d7d895
MD5 5ab5b2765a40516f7bfe120cdef713d8
BLAKE2b-256 8ba5127afc5744d789942396aecf5566a2b9b3598b3451f379edb4fd5de069d3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 10.0 MB
  • Tags: CPython 3.11, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 c067d05fe656592eed6045902febff40dabe91138d83663a359e0ad805b59b16
MD5 848de7de22919fe731ccdd3a912a1536
BLAKE2b-256 9fb637094876084992fb366cf07ff2930191ba3e772a7ce3a1e8af67f333a4c7

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
  • Upload date:
  • Size: 11.4 MB
  • Tags: CPython 3.11, manylinux: glibc 2.28+ x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp311-cp311-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 844138b7930f2eab2bfe4059ee5bead21a2284f5559fb61e0ca865404fb22883
MD5 2c9c3b9683759a910d103da1324bada9
BLAKE2b-256 76384557d27d393e6954cb5635a99f39c1ff77e00ffd89a6a17c6b27cdb1892d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gen-0.2.0-cp311-cp311-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 10.3 MB
  • Tags: CPython 3.11, macOS 11.0+ ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.24 {"installer":{"name":"uv","version":"0.11.24","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.2.0-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 05c506642b9af13b619aad600641d104da93180ecb211fe87bb7e3f2fbcf4363
MD5 696531ffac1bdf4eef6e5b549f101bff
BLAKE2b-256 2cea295981bb4329dbab8da93444050e86e1cbf58049357dde7b81f1be68a6a1

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