Metadata-Version: 2.4
Name: blixa
Version: 1.0.6
Summary: Blixa: A Domain-Specific Language for Biological Research
Author: AHMED TARIG AHMED ABDALGALEEL
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy==2.1.1
Requires-Dist: pandas==2.2.3
Requires-Dist: biopython==1.86
Requires-Dist: scanpy==1.10.3
Requires-Dist: anndata==0.10.9
Requires-Dist: matplotlib==3.9.2
Requires-Dist: seaborn==0.13.2
Requires-Dist: scikit-learn==1.5.2
Requires-Dist: statsmodels==0.14.4
Requires-Dist: joblib==1.4.2
Requires-Dist: pytest==8.3.3
Requires-Dist: seqfold==0.10.2
Requires-Dist: gseapy==1.1.4
Dynamic: author
Dynamic: description
Dynamic: description-content-type
Dynamic: license-file
Dynamic: requires-dist
Dynamic: requires-python
Dynamic: summary

# README.md

# 🧬 Blixa Research Language (Blixa) - Core Syntax v1.0

Blixa is a domain-specific programming language designed exclusively for biological researchers[cite: 1]. It provides a seamless, unified syntax to perform complex bioinformatics, single-cell analytics, structural biology, and statistical computations without requiring deep knowledge of the underlying scientific libraries or algorithms[cite: 1].

## 🏗️ Architecture & Philosophy

The language operates on a layered architecture: **Researcher -> Biological Syntax -> Language Runtime -> Python Bridge -> Scientific Libraries -> Computation**[cite: 1]. 
Every command is highly contextualized to biological objects, returning usable results and preserving immutability[cite: 1]. Analytical details, data transformations, and algorithm parameters are managed internally by the Runtime[cite: 1].

### Project Layout
* **`core/`**: Contains the primary runtime objects (`DNA`, `RNA`, `Protein`, `Gene`, `Cell`, `Cells`, `Experiment`, `Workflow`, `Result`) and shared abstractions[cite: 1].
* **`modules/`**: Specialized scientific libraries loaded dynamically (`genomics`, `singlecell`, `proteomics`, `crispr`, `epigenetics`, etc.)[cite: 1].
* **`transpiler/`**: Houses the custom DSL parser (`BioParser`) and the AST executor (`PythonBridge`)[cite: 1].
* **`exceptions/`**: Strict biological and sequence validation handlers (`BioError`, `SequenceValidationError`)[cite: 1].

---

## 🧬 Core Objects

You can instantiate biological objects directly[cite: 1]:
* `dna("ATGCGT")` - DNA sequences[cite: 1].
* `rna("AUGCGU")` - RNA sequences[cite: 1].
* `protein("MEEPQSD")` - Amino acid sequences[cite: 1].
* `gene("PAX6")` - Biological genes[cite: 1].
* `cell("stem")` - Single-cell instances[cite: 1].
* `cells("experiment.h5ad")` - Cell populations / scRNA-seq datasets[cite: 1].
* `experiment("name")` - Multi-condition experiment design[cite: 1].
* `workflow("name")` - Automated analytical pipelines[cite: 1].

### Shared Universal Methods
All biological objects share a universal interface[cite: 1]:
* `.value()`, `.len()`, `.at(pos)`, `.slice(start, end)`, `.head(n)`, `.tail(n)`[cite: 1]
* `.find(seq)`, `.find_all(seq)`, `.rep(seq)`[cite: 1]
* `.valid()`, `.validate()`, `.info()`, `.summary()`, `.graph(type)`, `.save(file)`[cite: 1]

### General & Statistical Functions
* `len()`, `mean()`, `median()`, `std()`, `distribution()`[cite: 1]
* `compare()`, `correlation()`, `align()`, `t_test()`, `anova()`, `fdr_correct()`[cite: 1]
* `load(file)`, `save(data, file)`, `export(data, file)`, `integrate()`, `parallel()`[cite: 1]

---

## 🧪 Domain-Specific Capabilities

### 1. Genomics (DNA & RNA)
* **DNA Methods:** `.gc()`, `.rev()`, `.comp()`, `.rev_comp()`, `.set()`, `.insert()`, `.delete()`, `.mutate()`, `.composition()`, `.codons()`, `.motifs()`, `.motif()`, `.promoter()`, `.orfs()`, `.transcribe()`, `.translate()`, `.methylation()`, `.snp()`[cite: 1]
* **RNA Methods:** `.gc()`, `.rev()`, `.comp()`, `.rev_comp()`, `.translate()`, `.dna()`, `.fold()`, `.structure()`[cite: 1]

### 2. Proteomics
* **Protein Methods:** `.weight()`, `.charge()`, `.pi()`, `.hydrophobicity()`, `.hydro()`, `.domains()`, `.structure()`, `.mutate()`, `.interact()`, `.bind()`, `.complex()`[cite: 1]

### 3. Single-Cell Transcriptomics
* **Cell Population (`cells`):** `.filter(min_genes, max_mito)`, `.normalize()`, `.variable_genes()`, `.reduce("pca")`, `.cluster("leiden")`, `.umap()`, `.trajectory()`, `.pseudotime()`, `.find_cells()`, `.expression()`, `.distribution()`, `.correlation()`, `.markers()`, `.classify()`, `.de()`, `.gsea()`, `.batch_correct()`, `.integrate()`, `.lineage()`, `.variants()`, `.histone_mods()`, `.chromatin_state()`, `.atac_seq()`, `.pca_variance()`[cite: 1]
* **Single Cell (`cell`):** `.expression()`, `.markers()`, `.state()`, `.type`, `.label`, `.pluripotency_score()`, `.differentiate()`, `.reprogram()`, `.lineage()`[cite: 1]

### 4. Gene Analysis & CRISPR Engineering
* **Gene Methods:** `.dna()`, `.rna()`, `.protein()`, `.promoter()`, `.exons()`, `.introns()`, `.expression()`, `.cells()`, `.compare()`, `.query()`, `.enrich()`[cite: 1]
* **CRISPR (requires `use crispr`):** `.crispr_design()`, `.knockout()`, `.knockin(seq)`[cite: 1]

### 5. Experiment & Results Management
* **Experiment:** `.add(sample, cond)`, `.get(name)`, `.compare(c1, c2)`, `.compare_all()`, `.timecourse()`, `.filter()`, `.normalize()`, `.cluster()`, `.t_test()`, `.anova()`, `.report()`[cite: 1]
* **Results:** Analytical operations natively return a `result` object supporting: `.info()`, `.summary()`, `.top(n)`, `.sort()`, `.filter()`, `.select()`, `.at(idx)`, `.column(name)`, `.graph()`, `.fdr_correct()`, `.enrich()`, `.gsea()`, `.confusion_matrix()`[cite: 1]

---

## 🧩 Specialized Modules

To keep the core language stable, advanced domain capabilities are loaded dynamically[cite: 1]:

    use genomics
    use transcriptomics
    use singlecell
    use proteomics
    use structure
    use stemcell
    use crispr
    use epigenetics
    use statistics
    use pathways
    use variants
    use integration
    use visualization

---

## ⚙️ Workflows & Python Integration

### Automating Pipelines
Workflows record abstract operations to be executed on multiple datasets[cite: 1]:

    workflow1 = workflow("neural_analysis")
    with workflow1:
        sample.filter(min_genes=300)
        sample.normalize()
        sample.reduce("pca")
        sample.cluster("leiden")
        sample.umap()

    workflow1.run(new_sample)
    workflow1.save("neural_analysis")

### Native Python Integration
Blixa supports native Python logic seamlessly inside a `python:` block[cite: 1]:

    python:
        for cell in sample:
            if cell.expression("pax6") > 3:
                print(cell.id)

---

## 🚀 Execution

To run a Blixa script `.blx` or enter the interactive REPL[cite: 1]:

    # Execute a script
    python run.py analysis.blx

    # Start the interactive REPL
    python run.py
