cellink.tl.external.estimate_genetic_correlation#
- cellink.tl.external.estimate_genetic_correlation(sumstats_files, ref_ld_chr, w_ld_chr, out_prefix, overlap_annot=False, frqfile_chr=None, not_m_5_50=False, print_coefficients=False, print_delete_vals=False, samp_prev=None, pop_prev=None, intercept_h2=None, intercept_gencov=None, no_intercept=False, run=True, runner=None, **kwargs)#
Estimate genetic correlation using LD Score regression
Convenience wrapper around run_ldsc_genetic_correlation with validation and structured output.
- Parameters:
sumstats_files (list[str]) – List of paths to munged summary statistics files (.sumstats.gz)
ref_ld_chr (str) – Prefix for reference LD scores (with @, e.g., “baseline.”)
w_ld_chr (str) – Prefix for regression weights (with @, e.g., “weights.”)
out_prefix (str) – Prefix for output files
overlap_annot (bool, default False) – Use overlapping annotation model
frqfile_chr (str, optional) – Prefix for allele frequency files (required with overlap_annot)
not_m_5_50 (bool, default False) – Don’t restrict to common SNPs
print_coefficients (bool, default False) – Print coefficient estimates
print_delete_vals (bool, default False) – Print delete values
samp_prev (list[float], optional) – Sample prevalences for each trait (use None for quantitative traits)
pop_prev (list[float], optional) – Population prevalences for each trait
intercept_h2 (list[float], optional) – Constrain h2 intercepts for each trait
intercept_gencov (list[float], optional) – Constrain genetic covariance intercepts
no_intercept (bool, default False) – Force intercepts to 1 and 0
run (bool, default True) – Whether to execute the command or just return it
runner (LDSCRunner, optional) – Runner instance to use
**kwargs – Additional arguments passed to ldsc.py
- Return type:
- Returns:
dict Results dictionary with: - ‘log_file’: Path to log file (if run=True) - ‘files_created’: List of created files (if run=True) - ‘command’: Command string (if run=False)
Examples
>>> result = estimate_genetic_correlation( ... sumstats_files=["height_munged.sumstats.gz", "bmi_munged.sumstats.gz"], ... ref_ld_chr="baseline_v1.2/baseline.", ... w_ld_chr="weights_hm3_no_hla/weights.", ... out_prefix="height_bmi_rg", ... )