A Python package that converts DNA sequences into 'oiia' sounds.
Project description
DNA2oiia 🧬🎵🐱
Convert DNA/RNA sequences into sound using "oiia" phonetics. Each base maps to a sound: A=o, T/U=ii, C=a, G=e.
Table of Contents
Installation
pip install dna2oiia
Optional extras:
pip install dna2oiia[mp3] # MP3 export (requires pydub + ffmpeg)
pip install dna2oiia[tui] # Interactive terminal UI
pip install dna2oiia[streamlit] # Streamlit web app
CLI Usage
dna2oiia -s ATCGGATTA -o my_dna # Convert sequence to WAV
dna2oiia -f example.fasta -o output # Convert FASTA file
echo "ATCGATCG" | dna2oiia --play # Pipe from stdin and play
dna2oiia -s ATCGATCG --play # Play audio directly
dna2oiia -s ATCGATCG --speed 2.0 # Double speed
dna2oiia -s ATCG --repeat 4 # Repeat 4 times
dna2oiia -s ATCGGATTA --reverse-complement # Reverse complement
dna2oiia -s ATCGATCG --visualize # Colored base-to-sound mapping
dna2oiia -s ATCGGATTA --format mp3 # MP3 output (requires pydub)
Try famous sequences included in the repo:
dna2oiia -f examples/data/famous_sequences.fasta --play --visualize
Python API
from dna2oiia import dna_to_oiia, process_fasta, reverse_complement, validate_dna_sequence
# Single sequence
dna_to_oiia({"example": "ATCGGATTA"}, "output") # Creates output.wav
# FASTA file
sequences = process_fasta("example.fasta")
dna_to_oiia(sequences, "output")
# Stream to buffer
import io
buf = io.BytesIO()
dna_to_oiia({"seq": "ATCGGATTA"}, output_buffer=buf)
# Speed, repeat, reverse complement
dna_to_oiia({"fast": "ATCGATCG"}, "out", speed=2.0, repeat=3)
rc = reverse_complement("ATCG") # "CGAT"
Interactive TUI
pip install dna2oiia[tui]
dna2oiia-tui # or: dna2oiia --tui
Keyboard shortcuts: F5 Play | F6 Save WAV | F7 Reverse complement | Q Quit
Features: paste sequences or load FASTA files, live colored visualization, adjustable speed and repeat.
Streamlit Web App
pip install dna2oiia[streamlit]
streamlit run st_dna2oiia.py
Acknowledgments
Inspired by a conversation with IOB friends Nathan and Ibukun during a hackathon. The "oiia" sound is sourced from this YouTube video under fair use. Developed with AI assistance.
License
MIT License. Contributions welcome!
Project details
Release history Release notifications | RSS feed
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 dna2oiia-0.2.0.tar.gz.
File metadata
- Download URL: dna2oiia-0.2.0.tar.gz
- Upload date:
- Size: 1.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1322977066b62f916e6f7b49ea2272c75bfc860d8b3eda3c4c7808346a3a0702
|
|
| MD5 |
39e2533e5ec4646c2b039504881ef775
|
|
| BLAKE2b-256 |
cd4ead96f503fd3b5377eea078909034abc03d89ad18b403bc40e3f6d263beb3
|
Provenance
The following attestation bundles were made for dna2oiia-0.2.0.tar.gz:
Publisher:
publish.yml on ChenHsieh/dna2oiia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dna2oiia-0.2.0.tar.gz -
Subject digest:
1322977066b62f916e6f7b49ea2272c75bfc860d8b3eda3c4c7808346a3a0702 - Sigstore transparency entry: 1279266083
- Sigstore integration time:
-
Permalink:
ChenHsieh/dna2oiia@842b4d37e71bbda26de38f4e58c5aece37844fcb -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ChenHsieh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@842b4d37e71bbda26de38f4e58c5aece37844fcb -
Trigger Event:
release
-
Statement type:
File details
Details for the file dna2oiia-0.2.0-py3-none-any.whl.
File metadata
- Download URL: dna2oiia-0.2.0-py3-none-any.whl
- Upload date:
- Size: 1.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
be4012b9a386e9278a4af960e24f0b61fa9a9c0ad206bc8c4feddb7f9868fbc4
|
|
| MD5 |
669b8c92da5fc69a233e5f395a965cea
|
|
| BLAKE2b-256 |
7ac776ff640cfad2108cc86b887bb87f63acbd0e736adace081758818dc7514f
|
Provenance
The following attestation bundles were made for dna2oiia-0.2.0-py3-none-any.whl:
Publisher:
publish.yml on ChenHsieh/dna2oiia
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dna2oiia-0.2.0-py3-none-any.whl -
Subject digest:
be4012b9a386e9278a4af960e24f0b61fa9a9c0ad206bc8c4feddb7f9868fbc4 - Sigstore transparency entry: 1279266170
- Sigstore integration time:
-
Permalink:
ChenHsieh/dna2oiia@842b4d37e71bbda26de38f4e58c5aece37844fcb -
Branch / Tag:
refs/tags/v0.2.0 - Owner: https://github.com/ChenHsieh
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@842b4d37e71bbda26de38f4e58c5aece37844fcb -
Trigger Event:
release
-
Statement type: