bulik / ldsc

LD Score Regression (LDSC)
GNU General Public License v3.0
652 stars 345 forks source link

Index error/ list index out of range #466

Open ruimin-1212 opened 1 week ago

ruimin-1212 commented 1 week ago

I am trying to calculate heritability and getting this error: Call: ./ldsc.py \ --h2 hearta.sumstats.gz \ --ref-ld-chr aCM/Add_all.chr3 \ --out aCM--print-coefficients \ --overlap-annot \ --frqfile-chr 1000G_Phase3_frq/1000G.EUR.QC.3 \ --w-ld-chr 1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.3

Beginning analysis at Mon Nov 18 19:47:34 2024 Reading summary statistics from hearta.sumstats.gz ... Read summary statistics for 1151077 SNPs. Reading reference panel LD Score from aCM/Add_all.chr3[1-22] ... (ldscore_fromlist) Traceback (most recent call last): File "./ldsc.py", line 644, in sumstats.estimate_h2(args, log) File "/home/data/t070533/hrm/New_SSC/ldsc/ldscore/sumstats.py", line 326, in estimate_h2 args, log, args.h2) File "/home/data/t070533/hrm/New_SSC/ldsc/ldscore/sumstats.py", line 243, in _read_ld_sumstats ref_ld = _read_ref_ld(args, log) File "/home/data/t070533/hrm/New_SSC/ldsc/ldscore/sumstats.py", line 82, in _read_ref_ld 'reference panel LD Score', ps.ldscore_fromlist) File "/home/data/t070533/hrm/New_SSC/ldsc/ldscore/sumstats.py", line 152, in _read_chr_split_files out = parsefunc(_splitp(chr_arg), _N_CHR, **kwargs) File "/home/data/t070533/hrm/New_SSC/ldsc/ldscore/parse.py", line 103, in ldscore_fromlist y = ldscore(fh, num) File "/home/data/t070533/hrm/New_SSC/ldsc/ldscore/parse.py", line 147, in ldscore first_fh = sub_chr(fh, chrs[0]) + suffix IndexError: list index out of range Thanks for all!!

ruimin-1212 commented 1 week ago

Most interestingly, chr1 and chr2 can run the script, but it failed from the thrid chromosome,

kylagelev commented 2 days ago

Hi, so I was running into the same issue, but I was able to resolve it by removing the ${chr} value. I was attempting to submit a job that would run in parallel per each chr, but it looks like the heritability estimate is one command that runs through each chromosome. e.g. in your call:

./ldsc.py --h2 hearta.sumstats.gz --ref-ld-chr aCM/Add_all.chr3 --out aCM--print-coefficients --overlap-annot --frqfile-chr 1000G_Phase3_frq/1000G.EUR.QC.3 --w-ld-chr 1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.3

Don't include the 3. So run it like so: ./ldsc.py --h2 hearta.sumstats.gz --ref-ld-chr aCM/Add_all.chr --out aCM--print-coefficients --overlap-annot --frqfile-chr 1000G_Phase3_frq/1000G.EUR.QC. --w-ld-chr 1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.

Not sure if that's what you were doing as well, but that's how I resolved the error on my end.

ruimin-1212 commented 2 days ago

I have run the script you provide successfully,thank you very much!!!

---- Replied Message ---- | From | @.> | | Date | 11/26/2024 09:06 | | To | @.> | | Cc | @.>@.> | | Subject | Re: [bulik/ldsc] Index error/ list index out of range (Issue #466) |

Hi, so I was running into the same issue, but I was able to resolve it by removing the ${chr} value. I was attempting to submit a job that would run in parallel per each chr, but it looks like the heritability estimate is one command that runs through each chromosome. e.g. in your call:

./ldsc.py --h2 hearta.sumstats.gz --ref-ld-chr aCM/Add_all.chr3 --out aCM--print-coefficients --overlap-annot --frqfile-chr 1000G_Phase3_frq/1000G.EUR.QC.3 --w-ld-chr 1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.3

Don't include the 3. So run it like so: ./ldsc.py --h2 hearta.sumstats.gz --ref-ld-chr aCM/Add_all.chr --out aCM--print-coefficients --overlap-annot --frqfile-chr 1000G_Phase3_frq/1000G.EUR.QC. --w-ld-chr 1000G_Phase3_weights_hm3_no_MHC/weights.hm3_noMHC.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>