AptamerForge
AptamerForge is a Python-based DNA aptamer screening engine that intelligently detects and scores DNA sequences with specific mismatch motifs (e.g., T–T, G–G, etc.) embedded within hairpin loops. It leverages thermodynamic modeling using ViennaRNA to identify aptamer candidates with favorable folding energies. This version supports multiple mismatch targets and includes functionality for drawing the discovered hairpin structures.
🔬 Features
- ✅ Support for multiple mismatch types (e.g., T–T, G–G, A–A)
- ✅ Folding energy computation using ViennaRNA
- ✅ Hairpin motif detection with loop and stem size thresholds
- ✅ Visualization of valid hairpin structures
- ✅ Multi-core processing (optional)
- ✅ Export results to CSV
- ✅ Lightweight and fast — pure Python with minimal dependencies
🛠 Installation
First ensure you have ViennaRNA installed and accessible in your Python environment (via the RNA Python bindings). Then install AptamerForge:
pip install aptamerforge
Usage
from aptamerforge import AptamerForge
# Define your mismatch targets (e.g., T–T and G–G)
af = AptamerForge(
target_mismatch=('tt', 'gg'), #you could also do ('gg',), ('tt',), ('aa',), ('cc', 'aa'), ('ct', 'ag') etc
strand_length=24,
min_mismatch_count=3,
min_loop_count=3,
min_stem_count=5,
min_mfe=-13,
temperature=37,
author='Your Name', # it will be shown in the drawing of the sequence's hairpin structure.
title='Your title for the drawing' # will be shown on the drawing as the title.
)
# Start the search
af.search(search_space=100_000)
# Visualize a discovered hairpin structure
af.draw("AGATCTTGCATCGGCTTGTTCT") # Example sequence
# Draw all hairpin structure of all found so far.
af.draw_all(width=3200, height=2700)
📁 Output
Results are logged to a CSV file with filename the user chooses, or if empty, file named after the mismatches the user selects (e.g., tt-gg-aptamers.csv). Each entry includes: • Sequence • Sequence Length • Mismatch Count in Stem • Stem Count • Loop Count • Dangle Count • Minimum Free Energy (kcal/mol) • Time found
🔧 Requirements
• Python 3.7+
• pandas
• ViennaRNA (with Python bindings)
• matplotlib
• pycairo (for Hairpin visualization)
Install dependencies:
pip install pandas matplotlib
For ViennaRNA bindings:
conda install -c bioconda viennarna
For Cairo
- Simple installation for most users.
pip install pycairo
🟢 macOS (with Homebrew)
brew install cairo
pip install pycairo
🟠 Ubuntu/Debian Linux
sudo apt update
sudo apt install libcairo2-dev
pip install pycairo
🟣 Windows
- Use the pre-built Cairo binaries: Install GTK (which includes Cairo) via MSYS2 or GTK installer.
- Then install Pycairo:
pip install pycairo
If errors persist, use conda:
conda install -c conda-forge pycairo
📄 License
MIT License
🤝 Contributing
Pull requests are welcome! If you’d like to contribute to adding more pairing rules, improve drawing functions, or support RNA as well, feel free to fork the project and submit a PR.
🧬 Author
Developed by William Asamoah (cephaswills@gmail.com), a passionate bioinformatics innovator applying AI and embedded computing in biotechnology and energy systems.
Metadata
Release files for aptamerforge 0.1.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| aptamerforge-0.1.7.2.tar.gz | 11.1 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| aptamerforge-0.1.7.2-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.9 kB
Release files / aptamerforge-0.1.7.2.tar.gz
| Download URL | aptamerforge-0.1.7.2.tar.gz |
|---|---|
| Size | 11.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
611a28f30269c8487eb1d4e1f31ffaa16a1d703a03d456ea0e68974677cd7307
|
|
BLAKE2b-256 checksum How to use checksums |
3db1e84b09c0e90e8c0963ef8b1b598238f8fe56d8626e4dd9c74e240e258488
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|
Release files / aptamerforge-0.1.7.2-py3-none-any.whl
| Download URL | aptamerforge-0.1.7.2-py3-none-any.whl |
|---|---|
| Size | 9.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
adacd7f5f100c2fc57a2b33c066dfee0256e5e6f131b381e73ebf29caaa9ad7d
|
|
BLAKE2b-256 checksum How to use checksums |
3846fd8b37e50ed00fa9305c9a194224dca4d5c24b69fc2dcfd93d0ffdd13359
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.3
|