cellink.tl.external.calculate_ld#
- cellink.tl.external.calculate_ld(dd, prefix, out=None, window_kb=500, ld_window=99999, r2_threshold=0.2, run=True, save_cmd_file=None, plink_export_kwargs={})#
Estimate LD patterns using PLINK.
- Parameters:
dd (DonorData) – Object containing donor-level genotype (
dd.G) and cell-level expression data (dd.C).prefix (str) – PLINK binary file prefix (.bed/.bim/.fam).
out (str, optional) – Output prefix. Defaults to <prefix>_ld.
window_kb (int, default=500) – Window size in kilobases.
ld_window (int, default=99999) – LD window size in number of variants.
r2_threshold (float, default=0.2) – Minimum r² value to report.
run (bool, default=True) – Whether to run the command.
save_cmd_file (str, optional) – Path to save the command string.
plink_export_kwargs (dict, optional) – Additional keyword arguments for
to_plinkfunction.
- Return type:
DataFrame|str- Returns:
pd.DataFrame or str LD dataframe or command string.