Reference-panel SNP count (the M_ref used to standardise tau*)
Source:R/sldsc_wrapper.R
compute_sldsc_M_ref.Rd`M_ref` is the number of SNPs in the REFERENCE PANEL over which heritability is partitioned in the sLDSC model (`h2(C) = sum_j in M_ref a_C(j) sum_C' tau_C' a_C'(j)`). It is panel-defined and is **not** the regression SNP set (HapMap3 ~1M) nor any HM3-subsetted target output:
`maf_cutoff > 0` (Gazal/Finucane convention): count MAF > cutoff SNPs across all `.frq` files (the same set polyfun's `.l2.M_5_50` sums).
`maf_cutoff == 0` (all-M variant): count ALL SNPs across all `.frq` files (the same set polyfun's `.l2.M` sums).
`target_anno_dir` is a fallback only, used when no `.frq` directory is given; that fallback counts `.l2.ldscore` rows and is WRONG when the target was HM3-subsetted (it then yields the regression SNP count, not M_ref).
Usage
compute_sldsc_M_ref(
target_anno_dir = NULL,
frqfile_dir = NULL,
plink_name = "ADSP_chr",
maf_cutoff = 0.05
)Arguments
- target_anno_dir
Character or NULL. Fallback only - directory of `.l2.ldscore` files. Used only when `frqfile_dir` is unavailable.
- frqfile_dir
Character or NULL. Directory of PLINK `.frq` files; the preferred (recommended) source of M_ref.
- plink_name
Character. Filename prefix of `.frq` files.
- maf_cutoff
Numeric, default `0.05`.