ensembl.vep.corpus.exporter package#

Corpus export formats and registry.

Subpackages#

Submodules#

ensembl.vep.corpus.exporter.base module#

The corpus exporter contract.

class ensembl.vep.corpus.exporter.base.CorpusExporter(*args, **kwargs)[source]#

Bases: Protocol

Write a corpus in one output format.

export(corpus, directory, *, force=False)[source]#

Write a corpus and return its manifest.

Parameters:
  • corpus (Corpus) – Corpus to export.

  • directory (Path) – Destination directory.

  • force (bool, default: False) – Whether existing format files may be replaced.

Returns:

Description and identity of the exported representation.

Return type:

CorpusManifest

ensembl.vep.corpus.exporter.manifest module#

The manifest written beside an exported corpus.

class ensembl.vep.corpus.exporter.manifest.CorpusManifest(*, kind, spec, fuzz, step, seeds, parameters, chromosomes, transcripts, variants, overlaps, identity, files)[source]#

Bases: object

Describe an exported corpus.

Variables:
  • kind (str) – Which corpus kind was written.

  • spec (dict[str, object]) – Complete registered construction specification.

  • fuzz (int | None) – Compatibility fuzz count for synthetic corpora.

  • step (int | None) – Compatibility sweep step for synthetic corpora.

  • seeds (dict[str, dict[str, int]]) – The seeds each written corpus was built from, per kind.

  • parameters (str) – The spec’s parameter hash.

  • chromosomes (tuple[str, ...]) – Sequence region names written.

  • transcripts (int) – Transcripts written.

  • variants (int) – Distinct variants written.

  • overlaps (int) – Overlaps the corpus pairs those variants into.

  • identity (str) – A hash of the corpus files.

  • files (tuple[str, ...]) – The file names written beside this manifest.

chromosomes: tuple[str, ...]#
files: tuple[str, ...]#
fuzz: int | None#
identity: str#
kind: str#
overlaps: int#
parameters: str#
seeds: dict[str, dict[str, int]]#
spec: dict[str, object]#
step: int | None#
to_json()[source]#

Return the manifest as indented JSON.

Return type:

str

transcripts: int#
variants: int#

ensembl.vep.corpus.exporter.registry module#

Registry for corpus exporters.

ensembl.vep.corpus.exporter.registry.available_exporters()[source]#

Return the sorted set of registered exporter names.

Return type:

tuple[str, ...]

ensembl.vep.corpus.exporter.registry.get_exporter(name)[source]#

Return a new registered exporter.

Raises:

KeyError – If no exporter is registered under name.

Return type:

CorpusExporter

ensembl.vep.corpus.exporter.registry.register_exporter(name)[source]#

Register an exporter factory under a name.

Return type:

Callable[[ExporterFactoryT], ExporterFactoryT]