Skip to main content

API Reference

This page summarizes the runtime knobs users most often need when launching FedGWAS through Flower.

CLI entry point

Most local simulations should start from the packaged CLI:

fedgwas-sim --help

The command creates a local simulation project, configures examples and presets, runs readiness checks, launches Flower, and evaluates or collects outputs. See the main fedgwas-sim CLI documentation for the complete command reference.

Flower run config

KeyTypeDefaultPurpose
simulationbooleantrueSelects simulation-aware client behavior and output layout.
num-server-roundsinteger300Maximum Flower rounds. The strategy stops earlier when it reaches done.
config_pathstringexperiments/correctness/tiny_even/configsDirectory containing server/config.yaml and center_x/config.yaml files.
default-partition-bystringsamplesDefault partitioning mode for client initialization.
server_output_dirstringunsetOptional explicit server output directory override.
chunk_size / server_chunk_sizeintegerexperiment server.chunk_size or 1000Chunk size sent during init_chunks and init_chunks_lr.
lr_pad_tointegerexperiment server.lr_pad_to or 0Optional padding target for privacy-preserving tokens in local association filtering.
phenotype_fix_missing_to_casebooleanfalseCreates a derived PLINK prefix with missing phenotypes recoded for toy runs.

Example:

flwr run . local-simulation --stream --run-config \
'simulation=true num-server-rounds=100 config_path="experiments/correctness/tiny_even/configs"'

Center config files

Each center_x/config.yaml contains:

SectionPurpose
input_dataPLINK prefix and input type.
outputPer-center intermediate and log directories.
parametersChunk sizes, run tags, and anonymization offsets.
thresholdsFederated QC, relatedness screening, and association screening thresholds.
flowerDeployment address and nominal round count.
participationPer-stage opt-in flags.

Server config file

The server config is required at <config_path>/server/config.yaml unless server_output_dir is provided. It must define output.log_dir or output.intermediate_dir.

Main Python entry points

FileRole
pipeline/client_app.pyFlower ClientApp; creates FedLRClient and routes stages.
pipeline/server_app.pyFlower ServerApp; resolves config and creates the strategy.
pipeline/cli/sim.pyTyper application behind the fedgwas-sim command.
pipeline/server/strategy_strict.pyStage machine and encrypted relay orchestration.
pipeline/clients/base_client.pyPLINK chunking, anonymization, phenotype helpers.
pipeline/server/aggregator_king.pyServer-side KING chunk reconstruction and PLINK2 execution.
pipeline/server/aggregator_lr.pyServer-side LR chunk reconstruction and PLINK execution.