From 05fcd498dd5e54672a5ad4bf055fa9be7dedb698 Mon Sep 17 00:00:00 2001 From: Omer Weissbrod Date: Sun, 5 May 2024 11:22:32 +0300 Subject: [PATCH] bug fix in support for organisms with a different number of chromosomes --- ldsc.py | 3 +++ ldsc_polyfun/sumstats.py | 1 + 2 files changed, 4 insertions(+) diff --git a/ldsc.py b/ldsc.py index 8b873f6..0ac093c 100755 --- a/ldsc.py +++ b/ldsc.py @@ -603,6 +603,9 @@ def ldscore(args, log): parser.add_argument('--num-chr-sets', type=int, default=22, help='Number of chromosome sets for loco computations') +parser.add_argument('--num-chr', type=int, default=22, + help='Number of chromosomes for the target organism (default is 22)') + parser.add_argument('--no-standardize-ridge', default=False, action='store_true', help='disable Ridge standardization') diff --git a/ldsc_polyfun/sumstats.py b/ldsc_polyfun/sumstats.py index f6dc258..49ec4a3 100644 --- a/ldsc_polyfun/sumstats.py +++ b/ldsc_polyfun/sumstats.py @@ -248,6 +248,7 @@ def _merge_and_log(ld, sumstats, noun, log): def _read_ld_sumstats(args, log, fh, alleles=True, dropna=True): + _N_CHR = args.num_chr sumstats = _read_sumstats(args, log, fh, alleles=alleles, dropna=dropna) ref_ld = _read_ref_ld(args, log) n_annot = len(ref_ld.columns) - 2 #Changed to -2 because we also have chromosome column now