Skip to content

Reference

A portable, hash-identified local germline reference built from your FASTA files and an annotation sidecar. Build it with Reference.from_fasta, store it with write, reload it offline with Reference.read, and run it with Experiment.on(reference).

See Portable local references for the workflow, the sidecar schema and the capability rules. Errors raised are GenAIRR.ReferenceArtifactError (with a kind) and GenAIRR.ReferenceCapabilityError.

Common members

Member Purpose
Reference.annotation_template(...) Build an annotation sidecar skeleton from FASTA files
Reference.from_fasta(...) Build a reference from FASTA files and a sidecar
Reference.read(path) / .write(path, replace=False) Load / store the portable file
.report() Records, annotations, findings, defaults and capabilities
.capabilities() Which features the evidence supports (.available, .explain, .phase_support)
.require(*names, evidence="assertion") Raise ReferenceCapabilityError unless the capabilities hold
.alleles, .records, .entities, .findings Inspect the catalogue
.catalogue_hash, .execution_hash, .artifact_hash Content identity
.to_json() The stored file text

Class reference

GenAIRR._reference.artifact.Reference

A portable, immutable germline reference built from local FASTA and annotations.

Create one with :meth:from_fasta (from FASTA files and an annotation sidecar), :meth:read or :meth:from_json (from a *.genairr-ref.json artifact). A reference never changes after construction: getters return tuples or copies, and the native configuration it hands to the engine is sealed.

annotation_template(*, v, j, d=None, reference, v_alignment='none') staticmethod

Return an annotation sidecar for these FASTA files with every annotation unknown.

reference is the sidecar's reference header (name, version, locus, chain_type, taxon, build_date). No support is claimed; unique J motif positions are listed under suggestions as candidates to verify, never as annotations.

from_fasta(*, v, j, annotations, d=None) classmethod

Build a reference from V, J (and, for vdj, D) FASTA files and an annotation sidecar.

Every FASTA record is accounted for; the default view holds every accepted allele in file order, and the explicit unfitted defaults profile supplies the models.

read(path) classmethod

Read and fully check a *.genairr-ref.json artifact (at most 64 MiB).

write(path, *, replace=False)

Write the artifact atomically; an existing file is kept unless replace=True.

report()

Identity, hashes, record accounting, alleles with their evidence, defaults and capabilities.

capabilities()

Which workflows this reference supports, and at which evidence level.

require(*names, evidence='assertion')

Raise :class:ReferenceCapabilityError unless every named capability is available.

evidence="source" additionally requires that the annotations behind each capability are source-supported rather than the author's assertions.

to_json()

The artifact text: canonical JSON followed by a newline.