Skip to Content
NotebooksWhat a dataset knows

What a dataset knows

Dimensions, and the provenance of each one. This page is rendered from a real run on every docs build — every value below was computed by the engine, not typed out. The notebook itself is ordinary Python you can download and run.

marimo edit examples/notebooks/01_what_a_dataset_knows.py # as a notebook python examples/notebooks/01_what_a_dataset_knows.py # or as a plain script

Read the source on GitHub 


1 — What a dataset knows

Loading a file in Ligase does not just open it. The loader reads the headers and works out the file’s dimensions: which organism, which reference build, which naming style, which coordinate convention, which samples.

Crucially, it also records where it learned each one. That is what makes the error messages later worth reading.

reference = lg.reference(str(fixtures / 'tiny_bare.fasta'), organism='test') reference
<Reference Reference crates/ligase-core/tests/fixtures/tiny_bare.fasta>

What it worked out

dimensionvaluelearned from
organismtestdeclared
reference2 contigs, 40 bpfrom FASTA contigs: crates/ligase-core/tests/fixtures/tiny_bare.fasta
contig_namingbare (Ensembl/NCBI style)from FASTA deflines: crates/ligase-core/tests/fixtures/tiny_bare.fasta

Note the difference in the last column. organism says declared — no FASTA states its species, so a human had to. But reference and contig_naming were inferred from the file itself.

This matters for a reason the project cares about: a filename is not evidence. hg38.fa may hold anything. So reference identity comes from the contigs — their names, lengths and MD5s.

The evidence behind reference

contiglengthmd5
120 bpa965a71aa3690f60…
220 bp89c2d6e069f386ba…

Two references match when this table matches — not when their filenames do.

Last updated on