Skip to content
BarzinLPublic

About

First-principles Ab Initio genomic analysis platform built from the ground-up with with the principle of epistemic humility.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

GenomeSim

License: AGPL v3 Python 3.10+

A small Python core for genomic predictions that carry their own confidence and provenance.

Most genomics tools emit a feature and leave you to guess how much to trust it. A gene predicted at 0.3 confidence and one at 0.99 arrive in the same GFF3 column. GenomeSim's types make the confidence, the evidence behind it, and the parameters that produced it inseparable from the result.

Status

Foundation only. What exists is the type system and the abstract interfaces - Confidence, Provenance, GenomicFeature, SequenceAnalyzer, ScaleBridge - with tests. No analyzers are implemented. The package installs and the types work; nothing here reads a genome yet.

Direction

The original plan was to grow this into a full ab initio annotation platform: ORF finding, motif scanning, gene prediction, a desktop app. A literature sweep in July 2026 found that plan not worth executing.

  • Ab initio annotation is occupied. Tiberius shipped v2.0.0 in April 2026 and Helixer landed in Nature Methods the same month, both predicting eukaryotic gene models from sequence alone with no RNA-seq. Reimplementing that solo is a losing race.
  • The planned ML wrappers are dated. Enformer (2021) and SpliceAI (2019) have been largely superseded by AlphaGenome and Evo 2, both published in Nature in early 2026.
  • The confidence idea addresses a real gap. Genomic deep-learning predictions "are typically provided without calibrated measures of uncertainty" (Zhou et al., npj AI, 2026). Mutational-signature attribution is measurably non-identifiable: in a benchmark of 13 tools, 99 of 100 synthetic samples scored a wrong answer better than the true one, and tool choice alone moved a clinical positivity rate from 19.7% to 37.9%.

So the confidence-and-provenance core is the part worth keeping. The annotation roadmap is not being pursued here.

Full evidence with citations and per-claim verification tiers: docs/research/genomic-instability-grounding.md.

Caveat on the current implementation: Confidence is a validated float with an averaging combiner. It is not calibrated - a score of 0.85 carries no guarantee of being right 85% of the time. Making it calibrated (conformal prediction, or fitting against a labelled set) is unbuilt work, not a property of the code today.

Install

git clone https://github.com/BarzinL/GenomeSim.git
cd GenomeSim
pip install -e ".[dev]"
pytest

Use

from genomesim import Confidence, GenomicFeature, Provenance

confidence = Confidence(
    score=0.78,
    method="homology-based",
    sources=["blast_evalue", "percent_identity"],
    supporting_evidence={"blast_evalue": 1e-50, "percent_identity": 0.92},
)

provenance = Provenance.create_now(
    analyzer="ExampleAnalyzer",
    version="0.1.0",
    parameters={"min_length": 100},
)

feature = GenomicFeature(
    start=1000,
    end=2500,
    strand="+",
    feature_type="gene",
    confidence=confidence,
    attributes={"id": "gene_001", "name": "hypothetical_protein"},
    provenance=provenance,
    sequence_id="chr1",
)

feature.length()    # 1500
feature.to_gff3()   # confidence and method land in the attributes column

Runnable version: examples/basic_types.py.

Types

Type Purpose
Confidence Score in [0, 1] plus the method, the uncertainty sources, and the supporting evidence. Validates its own range.
Provenance Analyzer, version, parameters, ISO-8601 timestamp, upstream dependencies, references.
GenomicFeature Half-open interval on a sequence, with strand, type, confidence and provenance. Exports GFF3.
SequenceScale Ordered enum, nucleotide through genome. Comparable, so a bridge can assert it moves upward.
AnalysisType Structural, compositional, functional, evolutionary, regulatory.
SequenceAnalyzer ABC: sequence in, features out, parameters exposed for provenance.
ScaleBridge ABC: lower-scale features in, higher-scale features out, with confidence aggregation.

Detail and worked examples: docs/developers/core-concepts.md. Design rationale: docs/developers/architecture.md.

Testing

pytest
pytest --cov=genomesim --cov-report=html

Contributing

See CONTRIBUTING.md. Given the status above, useful contributions are to the confidence and provenance machinery rather than to new analyzers.

License

AGPLv3 or later. Free for research, education and personal use; derivative works must be open source; network use triggers the sharing obligation. Commercial dual-licensing enquiries: barzin@duck.com.

Author: Barzin Lotfabadi (@BarzinL).

About

First-principles Ab Initio genomic analysis platform built from the ground-up with with the principle of epistemic humility.

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages