Association Analysis
Association analysis has two phases: local logistic regression filtering and final iterative LR.
Local LR filtering
During local_lr, each client runs:
plink --bfile <plink_prefix> --logistic --out <log_dir>/local_lr_temp
parse_insignificant_snps reads the resulting .assoc.logistic file and selects SNPs with P >= local_lr_threshold when configured, falling back to p_threshold. The client sends salted tokens for those SNPs instead of raw SNP IDs.
The server forwards token arrays back to clients. During local_lr_filter_response, clients compute the intersection locally, resolve local SNP IDs, and remove that intersection from local data with exclude_snps.
Iterative LR
After filtering, the workflow enters init_chunks_lr and iterative_lr:
- Clients repartition filtered data, usually by SNP.
- Clients send one encoded PLINK chunk per stage call.
run_server_lrreconstructs and merges chunks.- The server runs
plink --logistic. - The server parses
.assoc.logisticand returns SNP p-values. - Clients use persisted SNP map files to map anonymous SNP IDs back to local IDs when possible.
- Clients classify final p-values with
global_lr_thresholdwhen configured.
Current scope
The current implementation focuses on logistic regression for binary phenotypes. Continuous phenotypes, richer covariate handling, or alternate association tests should be added through the PLINK command construction, configuration schema, and result parsers.