bulik/ldsc

IndexError: list index out of range

Closed this issue · 1 comments

Hi there!

While running partitioned heritability analysis for one of my samples i keep getting the "IndexError: list index out of range" error. I am using summary statistics that were formatted using munge_sumstats.py and all the files including Baseline model LD scores, standard regression weights, allele frequencies used were built from 1000 Genomes Phase 3 for European population and were taken from https://alkesgroup.broadinstitute.org/LDSCORE/ . My script:

ldsc.py
--h2 ${disease_type}_ldsc.sumstats.gz
--ref-ld-chr 1000G_Phase3_baselineLD_v2.2_ldscores/baselineLD., msFOXA_Hg37.
--out ${disease_type}_20.06.2023
--overlap-annot
--frqfile-chr 1000G_Phase3_frq/1000G.EUR.QC.
--w-ld-chr 1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.
--print-coefficients

Error message:

  • LD Score Regression (LDSC)
  • Version 1.0.1
  • (C) 2014-2019 Brendan Bulik-Sullivan and Hilary Finucane
  • Broad Institute of MIT and Harvard / MIT Department of Mathematics
  • GNU General Public License v3

Call:
./ldsc.py
--h2 /rds/general/user/$USER/projects/epinott/live/scripts/ldsc/required_files/GWAS_munge/AD_Jan_ldsc.sumstats.gz
--ref-ld-chr /rds/general/user/$USER/projects/epinott/live/scripts/ldsc/required_files/1000G_Phase3_baselineLD_v2.2_ldscores/baselineLD.,/rds/general/user/$USER/projects/epinott/live/user_analysed_data/Janis/ldsc/annot_file/msFOXA_Hg37.
--out /rds/general/user/$USER/projects/epinott/live/user_analysed_data/Janis/ldsc/heritability/AD_Jan_20.06.2023
--overlap-annot
--frqfile-chr /rds/general/user/$USER/projects/epinott/live/scripts/ldsc/required_files/1000G_Phase3_frq/1000G.EUR.QC.
--w-ld-chr /rds/general/user/$USER/projects/epinott/live/scripts/ldsc/required_files/1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.
--print-coefficients

Beginning analysis at Wed Jun 21 14:52:35 2023
Reading summary statistics from /rds/general/user/$USER/projects/epinott/live/scripts/ldsc/required_files/GWAS_munge/AD_Jan_ldsc.sumstats.gz ...
Read summary statistics for 1146109 SNPs.
Reading reference panel LD Score from /rds/general/user/$USER/projects/epinott/live/scripts/ldsc/required_files/1000G_Phase3_baselineLD_v2.2_ldscores/baselineLD.,/rds/general/user/$USER/projects/epinott/live/user_analysed_data/Janis/ldsc/annot_file/msFOXA_Hg37.[1-22] ... (ldscore_fromlist)
Traceback (most recent call last):
File "/rds/general/user/$USER/projects/epinott/live/scripts/ldsc/ldsc/ldsc.py", line 644, in
sumstats.estimate_h2(args, log)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 326, in estimate_h2
args, log, args.h2)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 243, in _read_ld_sumstats
ref_ld = _read_ref_ld(args, log)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 82, in _read_ref_ld
'reference panel LD Score', ps.ldscore_fromlist)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 152, in _read_chr_split_files
out = parsefunc(_splitp(chr_arg), _N_CHR, **kwargs)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/parse.py", line 103, in ldscore_fromlist
y = ldscore(fh, num)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/parse.py", line 147, in ldscore
first_fh = sub_chr(fh, chrs[0]) + suffix
IndexError: list index out of range

Analysis finished at Wed Jun 21 14:52:55 2023
Total time elapsed: 19.2s
Traceback (most recent call last):
File "/rds/general/user/$USER/projects/epinott/live/scripts/ldsc/ldsc/ldsc.py", line 644, in
sumstats.estimate_h2(args, log)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 326, in estimate_h2
args, log, args.h2)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 243, in _read_ld_sumstats
ref_ld = _read_ref_ld(args, log)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 82, in _read_ref_ld
'reference panel LD Score', ps.ldscore_fromlist)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/sumstats.py", line 152, in _read_chr_split_files
out = parsefunc(_splitp(chr_arg), _N_CHR, **kwargs)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/parse.py", line 103, in ldscore_fromlist
y = ldscore(fh, num)
File "/rds/general/project/epinott/live/scripts/ldsc/ldsc/ldscore/parse.py", line 147, in ldscore
first_fh = sub_chr(fh, chrs[0]) + suffix
IndexError: list index out of range

Could you please advise me on why the error could be occurring. Thank you in advance!

If anyone has the same issue, for me it was to do with the wrong path to the annotation file