cellink.tl.external.estimate_heritability#
- cellink.tl.external.estimate_heritability(sumstats_file, 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, no_intercept=False, run=True, runner=None, **kwargs)#
Estimate SNP heritability using LD Score regression
Convenience wrapper around run_ldsc_heritability with validation and structured output.
- Parameters:
sumstats_file (str) – Path to munged summary statistics file (.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 for estimating h2
print_coefficients (bool, default False) – Print coefficient estimates
print_delete_vals (bool, default False) – Print delete values
samp_prev (float, optional) – Sample prevalence (for binary traits)
pop_prev (float, optional) – Population prevalence (for binary traits)
intercept_h2 (float, optional) – Constrain the LD Score regression intercept
no_intercept (bool, default False) – Force intercept to 1
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_heritability( ... sumstats_file="height_munged.sumstats.gz", ... ref_ld_chr="baseline_v1.2/baseline.", ... w_ld_chr="weights_hm3_no_hla/weights.", ... out_prefix="height_h2", ... )