BioSight/python/phi/__init__.py
allaun 41fcbc3daa feat(init): initial BioSight commit — equation-to-DNA Φ encoding
BioSight encodes mathematical equations as 30-base hachimoji DNA
sequences for Adleman/Lipton-style DNA computing.

4-layer Φ mapping:
  Layer 1: F(E) — byte-class histogram on Δ₇
  Layer 3: τ(E) + δ(E) — parse tree structure
  Layer 4: 6 consistency rules → allele-specific PCR pass/fail

Independent phi/ modules:
  charclass, ast_parse, consistency, embed, output

Build: python3 -m py_compile — all modules clean
2026-06-23 18:27:35 -05:00

22 lines
841 B
Python

"""
phi — SilverSight Equation-to-DNA Φ Encoding Pipeline
Independent modules, each reusable without the others:
charclass Layer 1: 8-class byte histogram → Δ₇
ast_parse Layer 3: AST parsing → τ and δ distributions
consistency Layer 4: 6 consistency rules → ADMIT/QUARANTINE
embed Core Φ: (F, τ, δ) → 30-base hachimoji DNA sequence
output FASTQ, Adleman graph, PCR primer protocol
Usage:
from phi import encode_phi
result = encode_phi("d_F(p,q) = 2*arccos(sum(sqrt(p_i*q_i)))")
print(result["dna_sequence"])
"""
from .embed import encode_phi
from .output import to_fastq, to_adleman_graph, design_filtering_protocol, PRIMER_DESIGN
from .charclass import compute_F
from .ast_parse import compute_tau, compute_delta
from .consistency import check_consistency, CONSISTENCY_RULES