A DNA aptamer screening tool for mismatch analysis and hairpin detection & drawing
Project description
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'), ('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
)
# Start the search
af.search(search_space=100_000)
# Visualize a discovered hairpin structure
af.draw_hairpin("AGATCTTGCATCGGCTTGTTCT") # Example sequence
# Draw all hairpin structure of all found so far.
af.draw()
📁 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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aptamerforge-0.1.0.tar.gz.
File metadata
- Download URL: aptamerforge-0.1.0.tar.gz
- Upload date:
- Size: 10.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1862fc2f98e27274fa8c70464fc23c775813f74f4f7a22cba5180cb935c4a125
|
|
| MD5 |
22a69594700f1374f285f0dfc1bac257
|
|
| BLAKE2b-256 |
428812b61bbc87f213e51271574f129bee8891f5cbe91d24f76968f54e8df52b
|
File details
Details for the file aptamerforge-0.1.0-py3-none-any.whl.
File metadata
- Download URL: aptamerforge-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e9d592aceb758e21b3d0ef5aa350f4cfff6a260235346a2bbf7b5c23a3276d8b
|
|
| MD5 |
6b89ec05292d74753188835bb260124f
|
|
| BLAKE2b-256 |
194880f0a58b2b7838140c42464fecc31db9c5f3d9f162c2d9d6137276287e50
|