cellink.tl.external.estimate_ld_scores_from_bimfile#
- cellink.tl.external.estimate_ld_scores_from_bimfile(bfile_prefix, out_prefix, ld_wind_cm=1.0, ld_wind_kb=None, ld_wind_snp=None, annot_file=None, thin_annot=False, print_snps=None, maf_min=0.01, run=True, runner=None, **kwargs)#
Estimate LD scores from PLINK bfile (works with any bfile, including 1000G)
- Parameters:
bfile_prefix (str) – Path to PLINK binary files (without .bed/.bim/.fam extension)
out_prefix (str) – Prefix for output files
ld_wind_cm (float, default 1.0) – LD window size in centiMorgans
ld_wind_kb (int, optional) – LD window size in kilobases (alternative to ld_wind_cm)
ld_wind_snp (int, optional) – LD window size in number of SNPs (alternative to ld_wind_cm)
annot_file (str, optional) – Annotation file for computing category-specific LD scores
thin_annot (bool, default False) – Thin the annot file by removing columns with <1% SNPs
print_snps (str, optional) – File with SNP IDs to restrict LD score computation
maf_min (float, default 0.01) – Minimum MAF threshold
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: - ‘ld_scores_file’: Path to LD scores file (if run=True) - ‘files_created’: List of created files (if run=True) - ‘command’: Command string (if run=False)
Examples
>>> # Using 1000G reference panel >>> result = estimate_ld_scores_from_bimfile( ... bfile_prefix="1000G_EUR_Phase3_plink/1000G.EUR.QC.22", ... out_prefix="my_ldscores_chr22", ... annot_file="immune_genes.22.annot.gz", ... print_snps="hm3_snps.txt", ... )