Skip to main content

agtools: A Software Framework to Manipulate Assembly Graphs

DOI GitHub License Python

install with bioconda Conda PyPI version Downloads Open In Colab

CI Codacy Badge codecov CodeQL Advanced GitHub last commit (branch) Documentation Status

agtools (pronounced as a-g-tools) is a Python framework for manipulating assembly graphs for downstream metagenomic applications, with a focus on the Graphical Fragment Assembly (GFA) format. It offers a command-line interface for tasks such as graph format conversion, segment filtering, and component extraction. Supported formats include GFA, FASTG, ASQG and GraphViz DOT. Additionally, it provides a Python package interface that exposes assembler-specific functionality for advanced analysis and integration based on the GFA format.

For detailed instructions on installation and usage, please refer to the documentation hosted at Read the Docs.

Installing agtools

Using pip

You can install agtools from PyPI using pip.

pip install agtools

Using conda

You can install agtools from Bioconda using conda or mamba.

mamba install -c bioconda agtools

For development

Please follow the steps below to install agtools using flit for development.

# clone repository
git clone https://github.com/Vini2/agtools.git

# move to gbintk directory
cd agtools

# create and activate conda env
conda env create -f environment.yml
conda activate agtools

# install using flit
flit install -s --python `which python`

# test installation
agtools --help

Available subcommands in agtools

Run agtools --help or agtools -h to list the help message for agtools.

Usage: agtools [OPTIONS] COMMAND [ARGS]...

  agtools: A Software Framework to Manipulate Assembly Graphs

Options:
  -v, --version  Show the version and exit.
  -h, --help     Show this message and exit.

Commands:
  stats        Compute statistics about the graph
  rename       Rename segments, paths and walks in a GFA file
  concat       Concatenate two or more GFA files
  filter       Filter segments from GFA file
  clean        Clean a GFA file based on segments in a FASTA file
  flye2contig  Build a contig-level GFA file from a Flye assembly graph
  component    Extract a component containing a given segment
  fastg2gfa    Convert FASTG file to GFA format
  gfa2fastg    Convert GFA file to FASTG format
  asqg2gfa     Convert ASQG file to GFA format
  gfa2asqg     Convert GFA file to ASQG format
  gfa2dot      Convert GFA file to DOT format (GraphViz)
  gfa2fasta    Get segments in FASTA format
  gfa2adj      Get adjacency matrix of the assembly graph

Documentation

Please refer to the complete documentation available at Read the docs.

Issues and Questions

If you want to test (or break) agtools give it a try and report any issues and suggestions under agtools Issues.

If you come across any questions, please have a look at the agtools FAQ page. If your question is not here, feel free to post it under agtools Issues.

If you want to request a feature, please post it under agtools Issues as a feature request.

Citation

agtools is publlished in Bioinformatics Advances with DOI: 10.1093/bioadv/vbag126. If you use agtools in your work, please cite as follows.

Vijini Mallawaarachchi, George Bouras, Ryan R Wick, Susanna R Grigson, Bhavya Papudeshi, Robert A Edwards, agtools: A Software Framework to Manipulate Assembly Graphs, Bioinformatics Advances, Volume 6, Issue 1, 2026, vbag126, https://doi.org/10.1093/bioadv/vbag126

@article{10.1093/bioadv/vbag126,
    author = {Mallawaarachchi, Vijini and Bouras, George and Wick, Ryan R and Grigson, Susanna R and Papudeshi, Bhavya and Edwards, Robert A},
    title = {agtools: a software framework to manipulate assembly graphs},
    journal = {Bioinformatics Advances},
    volume = {6},
    number = {1},
    pages = {vbag126},
    year = {2026},
    month = {01},
    abstract = {Assembly graphs are a fundamental data structure used by genome and metagenome assemblers to represent sequences and their overlap information, facilitating the assembler in constructing longer genomic fragments. Apart from their core use in assemblers, assembly graphs have become increasingly important in a range of downstream applications such as metagenomic binning, plasmid detection, viral genome resolution, and haplotype phasing. However, there is a need for a comprehensive tool that allows programmatic access to manipulate assembly graphs (e.g. parse, convert, filter, and analyze) across different assembly graph formats.Here we present agtools, an open-source Python framework to manipulate assembly graphs produced by commonly used assemblers. agtools provides a command-line interface for tasks such as assembly graph format conversion, segment filtering, and component extraction. It also exposes a Python package interface to load, query, and analyze assembly graphs from popular genome and metagenome assemblers. This enables streamlined assembly-graph-based analyses that can be integrated into other bioinformatics software and workflows.The source code of agtools is hosted on GitHub at https://github.com/Vini2/agtools and the documentation is available at https://agtools.readthedocs.io/. agtools can also be installed from Bioconda (https://anaconda.org/bioconda/agtools) and PyPI (https://pypi.org/project/agtools/).},
    issn = {2635-0041},
    doi = {10.1093/bioadv/vbag126},
    url = {https://doi.org/10.1093/bioadv/vbag126},
    eprint = {https://academic.oup.com/bioinformaticsadvances/article-pdf/6/1/vbag126/68223878/vbag126.pdf},
}

Metadata

Release files for agtools 1.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for agtools 1.2.0
File Size Uploaded Provenance Actions
agtools-1.2.0.tar.gz 47.4 kB Without provenance Details for agtools-1.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for agtools 1.2.0
File Interpreter ABI Platform Actions
agtools-1.2.0-py3-none-any.whl Python 3 none any Details for agtools-1.2.0-py3-none-any.whl

Total release size: 109.9 kB

Release files / agtools-1.2.0.tar.gz

Download URL agtools-1.2.0.tar.gz
Size 47.4 kB
Tags Source
SHA-256 checksum
How to use checksums
4880371f6122b4cb39ee7813badbd515862ceda83faa4f48b096a498d2a2886a
BLAKE2b-256 checksum
How to use checksums
652c99289f8f7c8457d527d0253c056739541dcd98bccefa89268ed8eaee7745
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Release files / agtools-1.2.0-py3-none-any.whl

Download URL agtools-1.2.0-py3-none-any.whl
Size 62.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3cffba1b6417459610b55a11730a55443a74f285f5f78a4b4b4f17d37a8095bc
BLAKE2b-256 checksum
How to use checksums
287688a48ca2e58e3a1594acb9f6a068b474c5aa90bdc7b2bae9f360b54de53f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for agtools 1.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page