Making Sense from Sequence
cogent3 is a Python library for the analysis of biological 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.
Check out the other tabs on this page for installation instructions and highlights of what you can do with cogent3. See the links at the top of the page for an image gallery and detailed user guides.
For most uses, we recommend installation with the “extra” dependencies as these add support for visualisation and Jupyter notebooks.
pip install "cogent3[extra]"
For users on HPC systems, do the vanilla installation.
pip install cogent3
cogent3 provides an extensive suite of capabilities for manipulating and analysing sequence data. For instance, the ability to read standard biological data formats, manipulate sequences by their annotations, to perform multiple sequence alignment (app docs) using any of our substitution models, phylogenetic reconstruction and tree manipulation, manipulation of tabular data, visualisation of phylogenies (image gallery) and much more.
Differences in the frequency of nucleotides between species are common. In such cases, non-reversible models of sequence evolution are required for robust estimation of important quantities such as branch lengths, or measuring natural selection (Kaehler et al. 2015, 2017) (see using non-stationary models.). We have done more than just invent these new methods, we have established the most robust algorithms (Schranz et al. 2008) for their implementation and their suitability for real data (Verbyla et al. 2013).
You don’t have to be an expert in structural programming languages (like Python) to use cogent3! Interactive usage in Jupyter notebooks and a functional programming style interface lowers the barrier to entry. Individuals comfortable with R should find this interface less complex. (See the cogent3 apps documentation.)
cogent3 has a plugin architecture that allows third-party packages to extend its capabilities. Plugins integrate seamlessly – users access new functionality through familiar cogent3 methods without changing their workflow. Plugins can provide hook-style computation backends (e.g. piqtree for phylogenetic inference via Alignment.quick_tree()), rust-based k-mer counting (via cogent3-pykmertools), new formats for reading and writing sequences, alternate storage backends such as cogent3-h5seqs for HDF5-compressed sequence collections (see third-party storage), and custom annotation database backends. Want to write a plugin? Get in touch.