Skip to main content

Logo Buttle was developed as a lightweight collection of bioinformatics utilities for common sequence-analysis tasks, with an emphasis on convenient command-line use. It provides tools for working with DNA and protein sequences, including sequence manipulation, peptide properties, motif searching, pairwise alignment, and multiple sequence alignment.

Buttle is currently under active development.

Features

General sequence tools

  • Search for sequences and report their positions
  • Calculate sequence length
  • Calculate pairwise percent identity for sequences in a FASTA file

DNA sequences

  • Transcribe to RNA
  • Translate in three reading frames
  • Generate reverse complements
  • Calculate GC content
  • Pairwise sequence alignment from two raw sequence arguments
    • Rust backend by default, with a Python backend available
  • Multiple sequence alignment (MSA) from FASTA files or FASTA-formatted strings
    • Rust backend by default, with a Python backend available

Protein sequence tools

  • Calculate protein net charge
  • Calculate molecular weight
  • Calculate extinction coefficient
  • Identify and highlight potential N-linked glycosylation sites
  • Compare two sequences and look for conserved motifs of varying lengths
  • Pairwise sequence alignment from two raw sequence arguments
    • Rust backend by default, with a Python backend available
  • Multiple sequence alignment (MSA) from FASTA files or FASTA-formatted strings
    • Rust backend by default, with a Python backend available

Rendering

  • Print alignments in the terminal (when no --save argument provided)
  • Generate publication-quality PNG and TIFF alignment images
    • Pairwise DNA and Protein alignments
    • Multiple DNA and Protein sequence alignments
    • Alignment row length can be tuned with --wrap
    • Argument --real-ruler displays residue number based on the first sequence, skipping gaps
      • Optionally add a number at which the ruler numbering will start (defaults to 1)
  • Argument --diff displays alignment differences relative to a reference sequence (first sequence in FASTA file)
  • Argument --consensus optionally adds a consensus sequence to the bottom of an MSA
  • Argument --tree displays an average-linkage clustering of pairwise sequence distances, not a phylogenetic reconstruction

Installation/Requirements

Buttle is distributed through PyPI and requires Python 3.15 or newer. Prebuilt wheels include both the Python modules and the compiled Rust extension, so Rust and Cargo are not required when installing a compatible wheel.

Command-line installation

Install Buttle as a standalone command-line tool using uv:

uv tool install buttle

Alternatively, install it with pip:

pip install buttle

Once installed, run:

buttle --help

Using Buttle in Python

To add Buttle to an existing Python project:

uv add buttle

Or install it into your active Python environment:

pip install buttle

Buttle's Python modules can also be imported and used directly.

from buttle import sequences

# Access functions from the sequences module
output = sequences.find_position(sequence, search_string)

For convenience, commonly used classes and functions are also exposed at the package's top level:

from buttle import find_position

# Call functions directly without referencing their modules
output = find_position(sequence, search_string)

Building from source

Prebuilt wheels include the compiled Rust extension, so Rust and Cargo are not required for normal installation on supported platforms. To build Buttle from source, you'll need Python 3.15+, Rust/Cargo, and a compatible build environment. The Rust toolchain (the Rust compiler and Cargo build system) can be installed from https://rustup.rs.

To verify that Rust is installed, run

rustc --version
cargo --version

Rust is only required during installation to compile the extension; it is not required to run Buttle afterward.

Using uv to install buttle from source

Installing uv:

The following instructions use uv to install Buttle from source. Other Python build tools may also be used. If you don't already have uv installed, follow the official installation instructions at

https://docs.astral.sh/uv/getting-started/installation/

On macOS and Linux, you can install it with:

curl -LsSf https://astral.sh/uv/install.sh | sh

Verify the installation:

uv --version

Install Python 3.15:

uv python install 3.15

Clone the repository:

git clone https://github.com/DJV512/buttle/
cd buttle

Finally, install Buttle using uv:

uv tool install --python 3.15 .

After installation:

buttle -h

Usage

Buttle provides a command-line interface:

buttle <command> [options]

For a list of available commands:

buttle -h

For help with an individual command:

buttle msa -h

Development

Rebuilding the Rust extension

After modifying Rust source code, rebuild and reinstall Buttle from the repository root:

uv tool install --reinstall -e .

This recompiles the Rust extension and updates the globally installed buttle command.

Examples

Translate DNA in all three forward reading frames.

$ buttle translate acttactggtcgtagtca
Frame 1: TYWS*S
Frame 2: LTGRS
Frame 3: LLVVV

GC Content

$ buttle gc atgacggtagctagtagctacgtatcattcatctatccgcgcgtagtagtacgt
Total bases: 54
A: 13
C: 12
G: 13
T: 16
AT Content: 53.70
GC Content: 46.30

Display protein charge, molecular weight, and extinction coefficient together with props, or calculate each individually.

$ buttle props adlsykfehyaskgascwedasdkflsdad
Charge = -4
Molecular Weight = 3357.6
Extinction Coefficient = 8370

Pairwise Alignment of DNA or Protein

$ buttle dna_align atctcatgcgtcgtacgtacgt tgcatgcgtacgtagtcgatgtc --diff

Pairwise DNA Alignment

Multiple Sequence Alignment

Buttle implements a custom progressive multiple sequence alignment algorithm using an average-linkage guide tree with tunable affine gap open and extension penalties. For Proteins, Buttle uses BLOSUM62-based scoring. Optional "X" residues can be used as alignment anchors. For DNA, Buttle uses fixed base match and mismatch scoring. Computationally intensive operations are accelerated using a Rust extension.

$ buttle msa docs/examples/synthetic_example_proteins.fasta --save docs/images/synthetic_alignment_protein.png --diff --wrap 100

Multiple Protein Sequence Alignment

Conservative substitutions are shown in purple, non-conservative substitutions in red, and gaps as black dashes. When --diff is enabled, identities to the reference sequence are shown as dots. For DNA, conservative substitutions are disabled.

The Protein sequences used in this example are available in synthetic_example_proteins.fasta. A similar set of synthetic DNA sequences is available in synthetic_example_dna.fasta.

If the --tree argument is supplied, the average-linkage guide tree that was used to construct the multiple sequence alignment is printed to the terminal in a readable, hierarchical format. * represents internal Cluster nodes.

root
├── *
│   ├── *
│   │   ├── *
│   │   │   ├── Synthetic_Alpha
│   │   │   └── Synthetic_Beta
│   │   └── Synthetic_Delta
│   └── Synthetic_Gamma
└── Synthetic_Epsilon

Rust vs Python

The computationally intensive sequence alignment algorithms in Buttle were originally implemented in Python and subsequently ported to Rust to improve performance. The Rust implementations are used by default, but the original Python implementations remain available for comparison, testing, and experimentation. When Buttle is installed, you can select the Python implementation for supported alignment commands using:

buttle msa sequences.fasta --backend python

Omitting --backend uses the Rust implementation.

Installation note: Buttle includes a compiled Rust extension, even when using the Python alignment backend. Python-only installation is not currently supported.

Development status

Buttle is currently in development. Interfaces and command-line options may change before version 1.0. If you find any issues, please report them here.

License

Buttle is licensed under the BSD 3-Clause License.

Metadata

Release files for buttle 0.4.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 buttle 0.4.0
File Size Uploaded Provenance Actions
buttle-0.4.0.tar.gz 164.7 kB With provenance Details for buttle-0.4.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for buttle 0.4.0
File Actions
buttle-0.4.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for buttle-0.4.0-cp315-cp315-win_amd64.whl
buttle-0.4.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.15 CPython 3.15 Linux glibc 2.17+ x86-64 Details for buttle-0.4.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
buttle-0.4.0-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for buttle-0.4.0-cp315-cp315-macosx_11_0_arm64.whl
buttle-0.4.0-cp315-cp315-macosx_10_12_x86_64.whl CPython 3.15 CPython 3.15 macOS 10.12+ x86-64 Details for buttle-0.4.0-cp315-cp315-macosx_10_12_x86_64.whl

Total release size: 1.6 MB

Release files / buttle-0.4.0.tar.gz

Download URL buttle-0.4.0.tar.gz
Size 164.7 kB
Tags Source
SHA-256 checksum
How to use checksums
88507fddb1a6bf74bd9f698284f0a22aaef9ff5a90c73ef02d58d012b55535ee
BLAKE2b-256 checksum
How to use checksums
0b43a055b9c3ed2972665eeb4586f555da0fea0749fa30754c8c2e02f152bb8b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / buttle-0.4.0-cp315-cp315-win_amd64.whl

Download URL buttle-0.4.0-cp315-cp315-win_amd64.whl
Size 280.0 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
7023a417bae06c89c8b4d2667390f659b590589b1ba3a3f2631a4f4eab52ac88
BLAKE2b-256 checksum
How to use checksums
0caea1b2472b4f0cb82af63992e9b7817ac9478c6fb3bcee7007379ad426d66c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / buttle-0.4.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL buttle-0.4.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 412.5 kB
Tags CPython 3.15 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
9c86fddc87db5e54c076cdd033b72771404cb2244811d7ed0016b14289f5709a
BLAKE2b-256 checksum
How to use checksums
9b1caa2fe57c59af59eea6ba91a2b9f4f03d1ca45e70a6e6e72d2872e3d45bd2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / buttle-0.4.0-cp315-cp315-macosx_11_0_arm64.whl

Download URL buttle-0.4.0-cp315-cp315-macosx_11_0_arm64.whl
Size 382.7 kB
Tags CPython 3.15 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
1bcbf13ef9e3b7e19b5a6444db271ee81c297583e8cca06a219f87d3d66112d5
BLAKE2b-256 checksum
How to use checksums
dfc06c1f62eb6f47679998991191e4b9098f97d8c96417be41c29001ccddcc22
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Release files / buttle-0.4.0-cp315-cp315-macosx_10_12_x86_64.whl

Download URL buttle-0.4.0-cp315-cp315-macosx_10_12_x86_64.whl
Size 383.5 kB
Tags CPython 3.15 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
4aac86668d1ed6305f12652c6d80dcf9abd637841a7ce8191141983a54e41f0f
BLAKE2b-256 checksum
How to use checksums
a9bff863724c05b353400a9aba617717595b97379dda0cb5b5b012360719ae85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

Security for buttle 0.4.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.

Full provenance

All 5 files in this release have been uploaded with provenance metadata.

Select from 5 files

Attestation for buttle-0.4.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 11, 2026.

Transparency log

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