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 DNA to RNA
  • Translate DNA in three reading frames
  • Generate reverse complements
  • Calculate GC content
  • Pairwise DNA sequence alignment

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

  • Display alignments in the terminal (when no --save argument provided)
  • Generate publication-quality PNG and TIFF alignment images
    • Save Pairwise DNA and protein alignments
    • Save multiple protein sequence alignments
    • Alignment row length can be tuned with --wrap
    • Argument --real-ruler displays residue number based on the first sequence, skipping gaps
  • Argument --diff displays alignment differences relative to a reference sequence
  • MSA optionally adds a consensus sequence with --consensus

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 then be imported and used directly.

from buttle import sequences

# Use functions from the sequences module

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

Pairwise DNA Alignment

Multiple Protein Sequence Alignment

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

$ buttle msa docs/examples/synthetic_example_proteins.fasta --save docs/images/synthetic_alignment.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.

The sequences used in this example are available in synthetic_example_proteins.fasta.

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. Known limitations include:

  • Multiple sequence alignment currently supports proteins only.
  • DNA alignment image output currently limited to PNG, and does not support some arguments.
  • Guide tree visualization is still experimental.

License

Buttle is licensed under the BSD 3-Clause License.

Metadata

Release files for buttle 0.3.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.3.0
File Size Uploaded Provenance Actions
buttle-0.3.0.tar.gz 163.4 kB With provenance Details for buttle-0.3.0.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for buttle 0.3.0
File Actions
buttle-0.3.0-cp315-cp315-win_amd64.whl CPython 3.15 CPython 3.15 Windows x86-64 Details for buttle-0.3.0-cp315-cp315-win_amd64.whl
buttle-0.3.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.3.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
buttle-0.3.0-cp315-cp315-macosx_11_0_arm64.whl CPython 3.15 CPython 3.15 macOS 11.0+ ARM64 Details for buttle-0.3.0-cp315-cp315-macosx_11_0_arm64.whl
buttle-0.3.0-cp315-cp315-macosx_10_12_x86_64.whl CPython 3.15 CPython 3.15 macOS 10.12+ x86-64 Details for buttle-0.3.0-cp315-cp315-macosx_10_12_x86_64.whl

Total release size: 1.6 MB

Release files / buttle-0.3.0.tar.gz

Download URL buttle-0.3.0.tar.gz
Size 163.4 kB
Tags Source
SHA-256 checksum
How to use checksums
59d4cdb4cf97c63005a14187c5637cba9c934a7f4c24946af1da440496998388
BLAKE2b-256 checksum
How to use checksums
f88df216845e133b363f34eefed4f40afd5abad9d7f684d1923b9f62d1f91af6
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 2, 2026.

Transparency log

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

Download URL buttle-0.3.0-cp315-cp315-win_amd64.whl
Size 276.6 kB
Tags CPython 3.15 Windows x86-64
SHA-256 checksum
How to use checksums
bf2e0657a4f2b521c27c903163ed14a11a8cd52b5f8a0d1fe81384703f583f48
BLAKE2b-256 checksum
How to use checksums
d3f7a7f0ae8485d27a89a831b21b534a2891702ac4b3e81d053ada02e5e5a4f7
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 2, 2026.

Transparency log

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

Download URL buttle-0.3.0-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 409.9 kB
Tags CPython 3.15 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
071ff7976958ee60d47957e74057ac5a37d31de4e9190658def507fcd3757ae5
BLAKE2b-256 checksum
How to use checksums
9311b6f995bd06ff8dac0c929830631c99198fe457a24eb366f552d4de136c07
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 2, 2026.

Transparency log

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

Download URL buttle-0.3.0-cp315-cp315-macosx_11_0_arm64.whl
Size 379.9 kB
Tags CPython 3.15 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
401e021e860e910d7f0b273a194d3795ac2e7a109bc62bec8b53f5e7dbde3011
BLAKE2b-256 checksum
How to use checksums
3bb22eed8e4f6e952effa6e97dfb30f45f62884f8f9ec96f34f9306005118e29
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 2, 2026.

Transparency log

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

Download URL buttle-0.3.0-cp315-cp315-macosx_10_12_x86_64.whl
Size 381.0 kB
Tags CPython 3.15 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
bc3f846e8cf7729f22ab2a30c2c38e3c1d146cdcc42cf742eb56cb135c6a462f
BLAKE2b-256 checksum
How to use checksums
64d988fdcd5d9a5fbd0e4bd9ad8cf6495efd0a12e931060737cbfec515e41891
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 2, 2026.

Transparency log

Security for buttle 0.3.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.3.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 2, 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