ensembl.vep.corpus.exporter.formats.file package#

FASTA, GFF3 and VCF corpus export.

Submodules#

ensembl.vep.corpus.exporter.formats.file.base module#

A coordinated FASTA, GFF3 and VCF corpus exporter.

class ensembl.vep.corpus.exporter.formats.file.base.FileCorpusExporter[source]#

Bases: object

Write a corpus as one coordinated file bundle.

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

Write a corpus as FASTA, GFF3 and VCF, with a manifest describing it.

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

  • directory (Path) – Directory that receives the coordinated file bundle.

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

Returns:

Counts, parameters, and content identity for the written files.

Return type:

CorpusManifest

Raises:

FileExistsError – If a corpus file exists and force was not given.

ensembl.vep.corpus.exporter.formats.file.base.distinct_variants(corpus)[source]#

Return each variant once, under its name, in generated order.

Return type:

list[tuple[str, VariationAllele]]

ensembl.vep.corpus.exporter.formats.file.fasta module#

FASTA rendering for corpora.

ensembl.vep.corpus.exporter.formats.file.fasta.fasta_lines(corpora)[source]#

Yield one FASTA record per corpus chromosome, wrapped to a fixed width.

Return type:

Iterator[str]

ensembl.vep.corpus.exporter.formats.file.gff3 module#

GFF3 rendering for corpora.

ensembl.vep.corpus.exporter.formats.file.gff3.escape_attribute_value(value)[source]#

Percent-encode one scalar GFF3 attribute value.

Return type:

str

ensembl.vep.corpus.exporter.formats.file.gff3.gff3_lines(corpora)[source]#

Yield the GFF3 records for corpora.

Return type:

Iterator[str]

ensembl.vep.corpus.exporter.formats.file.vcf module#

VCF rendering for corpora.

ensembl.vep.corpus.exporter.formats.file.vcf.vcf_alleles(allele, sequence)[source]#

Return the (POS, REF, ALT) a VCF record spells an allele with.

Return type:

tuple[int, str, str]

ensembl.vep.corpus.exporter.formats.file.vcf.vcf_lines(corpora)[source]#

Yield the VCF records for corpora.

Return type:

Iterator[str]