Quality Control
Quality control is split into local sample filtering and global SNP filtering.
Local QC
exclude_samples_by_missing_rate runs PLINK --mind to remove samples whose missing genotype rate exceeds the configured threshold:
plink --bfile <plink_prefix> --mind <threshold> --make-bed --out <new_prefix>
The output prefix is written under the center's configured output.log_dir, and the client updates its active plink_prefix.
Global QC
During global_qc, each client computes:
- Genotype counts and HWE values with
compute_genotype_counts, usingplink --freqandplink --hardy. - SNP missingness counts with
compute_missingness_counts, usingplink --missing. - Threshold arrays containing MAF, missingness, and HWE thresholds.
Clients pack these arrays as typed payloads and encrypt them for peers. The server forwards the ciphertext arrays during global_qc; it does not compute the exclusion list.
During global_qc_response, each client decrypts peer payloads and _compute_exclusion_list then:
- Sums all genotype and missingness arrays.
- Derives unified thresholds from all clients.
- Computes MAF, missingness rate, and HWE chi-square p-values for each SNP.
- Returns the SNP IDs that should be excluded locally.
SNP filtering
Clients apply the returned exclusion list with exclude_snps:
plink --bfile <plink_prefix> --exclude <exclude_file> --make-bed --out <new_prefix>
If the exclusion list is empty, the original plink_prefix is kept.