Skip to main content

COmparative GENomics Toolkit 3: genomic sequence analysis within notebooks or on compute systems with 1000s of CPUs.

Project description

PyPI version PyPI Downloads Anaconda-Server Badge

Build Status coverall

PyPI - Python Version Ruff

CodeQL Codacy Badge

DOI

CZI's Essential Open Source Software for Science

cogent3 is a mature python library for analysis of genomic sequence data. We endeavour to provide a first-class experience within Jupyter notebooks, but the algorithms also support parallel execution on compute systems with 1000's of processors. A plugin system enables custom extensions to expand the library capabilities.

📣 Features & Announcements 📣

App foundations and more have a new home -- scinexus!

The cogent3 apps and plugin architecture remain the same, but we have extracted the app infrastructure into a new project called scinexus. The objective is to make this powerful framework available beyond cogent3. We also migrated the data stores and many generally useful utilities. e.g. open_, deserialisation of objects, and progress bars. Check out the documentation of scinexus to see what it provides.

Tracking citations of apps

We have built a mechanism for defining and tracking citations for apps, making it easier for users to correctly acknowledge app developer efforts. See the announcement on the home page for more details.

Drawing annotations from an annotation database

The new function cogent3.draw_annotations() can take an annotation database instance and returns a Drawable. This is useful for exploration of genome features without needing to load sequences.

The cogent3 code-sharing site 📚🔌

Share your cogent3 ecosystem code solutions for others to benefit from your awesomeness 😎. Or, just read / use the contributions from others.

We now support third-party plugins for annotation databases 📚🔌

If you want to contribute a third-party backend, get in touch!

diverse-seq has been rewritten in rust 🚀!

The sequence sampling tool diverse-seq, which provides multiple apps for sampling representative sequences, just got faster! The performance critical code has been rewritten in Rust. Give it a try 😀.

A new rust-based plugin for k-mer counting

We recently added a new count_kmers() method to the SequenceCollection and Sequence classes. Then, the developers of Pykmertools (with a bit of help from us) have released a cogent3-pykmertools app which makes their rust-based python module for counting k-mers available as seqs.count_kmers(k=k, use_hook="cogent3_pykmertools"). Install it with pip install cogent3-pykmertools and give it a try. And add a star to the Pykmertools repo!

Major advances in our progress towards a fully plugin-based architecture!

Cogent3 supports sequence storage plugins 📦🔌🚀

We have implemented the infrastructure to support alternative sequence storage plugins. These provide the backend storage for the new type sequence collections. We have implemented a proof-of-principle plugin cogent3-h5seqs for sequence storage based on the HDF5 format. This allows efficient storage of very large sequence collections (aligned or unaligned). See the readme for that project on how to use it.

Cogent3 supports sequence format parser and writer plugins 👓✍️🔌

We have implemented the infrastructure to support third-party provision of every bioinformaticians favourite game -- parsing / writing the multitude of sequence file formats. All builtin format parsers / writers are implemented as plugins. We use third-party versions by default.

Cogent3 implements plugin hooks 🔌🪝🎉

We have implemented the infrastructure to support hook-style plugins. We have defined a single hook now -- the new type Alignment.quick_tree() method checks for an external plugin for calculation. The developers of piqtree have made the rapid-NJ algorithm available for this hook! Once installed, it is used as aln.quick_tree(use_hook="piqtree").

Note For assistance in writing your own plugins, contact us via the cogent3 discussions page.

Now distributed with sample data!

We have added sample data sets for quick testing of different features. Check out cogent3.available_datasets() to see the available datasets. You can load one using cogent3.get_dataset(name).

Who is it for?

Anyone who wants to analyse sequence divergence using robust statistical models

cogent3 is unique in providing numerous non-stationary Markov models for modelling sequence evolution, including codon models. cogent3 also includes an extensive collection of time-reversible models (again including novel codon models). We have done more than just invent these new methods, we have established the most robust algorithms for their implementation and their suitability for real data. Additionally, there are novel signal processing methods focussed on statistical estimation of integer period signals.

🎬 Demo non-reversible substitution model

Anyone who wants to undertake exploratory genomic data analysis

Beyond our novel methods, cogent3 provides an extensive suite of capabilities for manipulating and analysing sequence data. You can manipulate sequences by their annotations, e.g.

🎬 Demo sequences with annotations

Plus, you can read standard tabular and biological data formats, perform multiple sequence alignment using any cogent3 substitution models, phylogenetic reconstruction and tree manipulation, manipulation of tabular data, visualisation of phylogenies and much more.

Beginner friendly approach to genomic data analysis

Our cogent3.app module provides a very different approach to using the library capabilities. Expertise in structural programming concepts is not essential!

🎬 Demo friendly coding

Installation

For most users we recommend

$ pip install "cogent3[extra]"

which installs support for data visualisation (which requires Plotly) and extensions for jupyter notebooks.

Note: In order to write Plotly figures to static image files you will need to install Chrome.

Minimal installation

If you're running on a high-performance computing system we recommend

$ pip install cogent3

which skips the data visualisation and notebook support.

Install with developer tools

Everything we use for cogent3 development.

$ pip install "cogent3[dev]"

Note: Installs all dependencies that can be installed using pip.

Installing the development version

$ pip install git+https://github.com/cogent3/cogent3.git@develop#egg=cogent3

Warning: The interface can change without warning on the development branch.

Installing using conda / mamba

Activate your conda environment, then

(myenv) $ conda install bioconda::cogent3

Project Information

cogent3 is released under the BSD-3 license, documentation is at cogent3.org, while cogent3 code is on GitHub. If you would like to contribute (and we hope you do!), we have created a companion c3dev GitHub repo which provides details on how to contribute and some useful tools for doing so.

Project History

cogent3 is a descendant of PyCogent. While there is much in common with PyCogent, the amount of change has been substantial, motivating the name change to cogent3. This name has been chosen because cogent was always the import name (dating back to PyEvolve in 2004) and it's Python 3 only.

Given this history, we are grateful to the multitude of individuals who have made contributions over the years. Many of these contributors were also co-authors on the original PyEvolve and PyCogent publications. Individual contributions can be seen by using "view git blame" on individual lines of code on GitHub, through git log in the terminal, and more recently the changelog.

Funding

Cogent3 has received funding support from the Australian National University and an Essential Open Source Software for Science Grant from the Chan Zuckerberg Initiative.

         

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cogent3-2026.4.20a0.tar.gz (17.9 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cogent3-2026.4.20a0-py3-none-any.whl (716.1 kB view details)

Uploaded Python 3

File details

Details for the file cogent3-2026.4.20a0.tar.gz.

File metadata

  • Download URL: cogent3-2026.4.20a0.tar.gz
  • Upload date:
  • Size: 17.9 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cogent3-2026.4.20a0.tar.gz
Algorithm Hash digest
SHA256 739b09bcb7deaf463803a8704e97f4dd4752fdeb2c186f97aeb820d718731df2
MD5 c6474db9e7e0224892d6e69f7f110658
BLAKE2b-256 3bf60d2ba66396e421b22f9e215d21f6baed0ab267f07384916db962ff593904

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogent3-2026.4.20a0.tar.gz:

Publisher: release.yml on cogent3/cogent3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file cogent3-2026.4.20a0-py3-none-any.whl.

File metadata

  • Download URL: cogent3-2026.4.20a0-py3-none-any.whl
  • Upload date:
  • Size: 716.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for cogent3-2026.4.20a0-py3-none-any.whl
Algorithm Hash digest
SHA256 caf5fba0ee27ce81e48ee7178f82b976dcf673805c59418ec201fa16aee67832
MD5 b9bb3fb6d175a67a169259ccc2cf5cde
BLAKE2b-256 9683f77c995547c494295f99a112edd6f2e76782c240c24aab472afb8ecb6093

See more details on using hashes here.

Provenance

The following attestation bundles were made for cogent3-2026.4.20a0-py3-none-any.whl:

Publisher: release.yml on cogent3/cogent3

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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