Exporters¶
Driven adapters that write domain objects to external file formats. Exporters are the inverse of readers: they consume immutable domain objects and produce a flat wire representation suitable for downstream tools or long-term storage.
Overview¶
Ports implemented¶
| Exporter | Port | Output |
|---|---|---|
BedRegionExporter |
RegionExporter |
BED 4 (chrom, start, end, name) |
TsvVariantExporter |
VariantExporter |
TSV with dynamic columns |
BedRegionExporter¶
Writes GenomicPosition objects to BED format. Handles the coordinate conversion
from the domain's 1-based inclusive to BED's 0-based half-open: start0 = start − 1,
end is unchanged. An optional padding value extends each region symmetrically.
Output is sorted by (chrom, start) by default.
TsvVariantExporter¶
Writes VariantAnnotation objects to a tab-separated file. Column layout is
discovered dynamically from the actual data present in the variant list —
no schema needs to be declared in advance:
- Core columns are always written (variant ID, chrom, position, alleles, type, zygosity, consequence on the canonical transcript, HGVS).
- For each classification source found (e.g.
clinvar):{source}_id,{source}_sig,{source}_evidence. - For each score name found (e.g.
cadd_phred): one column per score. - For each allele frequency population found:
{pop}_af,{pop}_ac,{pop}_an. - For each extra
Metadata.datakey:meta_{key}.
Column display names can be overridden via column_names (a dict[str, str]
mapping internal key → display label). By default these are loaded from the
adjacent tsv.toml.
Multi-value fields (e.g. multiple gene symbols or SO consequence terms) are
joined with mv_separator (default |). Floats are rounded to float_precision
decimal places (default 4).
BED¶
iris.adapters.driven.exporters.bed
¶
BED format exporter for genomic regions.
BedRegionExporter
¶
Bases: RegionExporter
Exports GenomicPosition objects to BED format (0-based half-open).
export
¶
Write positions to handle in BED format.
Source code in src/iris/adapters/driven/exporters/bed.py
TSV¶
iris.adapters.driven.exporters.tsv
¶
TSV format exporter for variant annotations.
TsvVariantExporter
¶
Bases: VariantExporter
Exports VariantAnnotation objects to tab-separated value format.
All data present in the supplied variants is exported automatically.
Column display names are resolved from column_names (internal_key → label);
any key not listed is used verbatim. By default column_names is loaded
from the adjacent tsv.toml.
export
¶
Write variants to handle in TSV format with all available columns.