export_genotypes
Export variant sets or filtered subsets of genotyping data from Gigwa to VCF, PLINK, or other file formats. Supports region, MAF, missing-data, individual, and metadata filters.
Instructions
Export a variant set — or a filtered/selected subset of it — to a file.
With none of the filter/selection parameters set, exports the whole set via Gigwa's
plain per-format export (format one of VCF (default), PLINK or
FLAPJACK; availability varies by build — check list_export_formats for what
this instance actually offers, and each format's variant-type/ploidy restrictions).
Passing any of region, selected_variant_types, min_maf/max_maf,
max_missing_data, individuals or metadata_fields instead drives Gigwa's
selection-aware export — the same endpoint the Gigwa web UI uses for a filtered
download — which additionally accepts any format the server advertises, including the
bgzipped "VCF.gz". keep_on_server leaves a copy in the user's Gigwa temp-output
area after this downloads it (default False).
For large sets this can take a while; raise timeout (seconds), or set
wait=False to return immediately once the export is kicked off instead of blocking
for the whole thing. A server that queues the work returns a download URL; check progress
with get_export_progress and, once it reports complete, retrieve the file with
fetch_export_file (that URL, plus output_path). wait=False always goes
through the selection-aware endpoint, even with no filters set. Some Gigwa builds
return the completed bytes immediately; in that case they are written to
output_path and no progress/fetch step is needed.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| wait | No | Block until the job finishes (True, default) or return immediately once it's kicked off (False) -- an import returns a progress token to poll with get_import_progress, an export returns a download URL to poll with get_export_progress and retrieve with fetch_export_file. | |
| format | No | Export format name, e.g. VCF (default), PLINK, FLAPJACK or VCF.gz; see list_export_formats for what this instance offers (and each format's type/ploidy restrictions). | VCF |
| region | No | Restrict analysis to a genomic window: 'chrom' or 'chrom:start-end' (1-based). | |
| max_maf | No | Maximum minor-allele frequency (0-1). | |
| min_maf | No | Minimum minor-allele frequency (0-1). | |
| timeout | No | Maximum seconds to wait for the export to complete. | |
| individuals | No | Individual-level identifiers to include in the export (e.g. from filter_individuals_by_metadata), not sample/callset ids; omit for all. Gigwa resolves each individual to all of its samples/callsets across runs server-side, including when an individual has more than one, so no manual sample mapping or dedup is needed. | |
| output_path | Yes | Destination file path for the export. | |
| keep_on_server | No | Also leave a copy of the export in the user's Gigwa temp-output area after downloading it here. | |
| metadata_fields | No | Individual metadata columns to embed in the export (from get_germplasm_metadata); omit for none. | |
| max_missing_data | No | Maximum per-variant missing-data fraction (0-1). | |
| variant_set_db_id | Yes | BrAPI variantSetDbId identifying the run (MODULE§project§run) -- copy the exact string from list_variant_sets / list_content, never assemble one by hand: the middle segment is a numeric project index, not the project's name, and a wrong guess fails with an opaque HTTP 500 rather than a clear error. | |
| selected_variant_types | No | Restrict the export to these variant types, ';'-joined (e.g. 'SNP' or 'SNP;INDEL'); omit for all types. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |