yiminghu / AnnoPred

Genetic risk prediction integrating LD and functional annotations
MIT License
14 stars 10 forks source link

Error for Example (when heritability estimation not provided) #5

Open maltose1117 opened 2 years ago

maltose1117 commented 2 years ago

Hi,

I am trying to run the AnnoPred example code (when heritability estimation not provided) but got the following error. May I ask what the problem is and how can I fix it?


(ldsc) $ bash ori.example.sh
{'local_ld_prefix': 'tmp_test/local_ld', 'coord_out': 'test_output/coord_out', 'need_LDSC': True, 'P': 0.1, 'sumstats': 'test_data/GWAS_sumstats.txt', 'need_ld_radius': True, 'N': 69033, 'ld_radius': None, 'ref_gt': 'test_data/test', 'temp_dir': 'tmp_test', 'val_gt': 'test_data/test', 'out': 'test_output/test', 'num_iter': 60, 'user_h2': None, 'annotation_flag': 'tier3'}
Filtering Summary Stats...
Filtered sumstats found, start coordinating genotypes...
Coordinate summary stats and validation/reference genotype data...
Coord file already exists! Continue calculating priors...
User-provided heritability file not found. Generating priors...
LDSC results found! Continue calculating priors ...
Traceback (most recent call last):
  File "AnnoPred.py", line 222, in <module>
    main(process_args(args))
  File "AnnoPred.py", line 204, in main
    pdict['h2file'], pdict['P'], pdict['pTfile'], pdict['annotation_flag'])
  File "/path/to/annopred/prior_generating.py", line 34, in generate_h2_pT
    h5f1 = h5py.File('ref/AnnotMatrix/tier3.h5','r')
  File "/path/to/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 408, in __init__
    swmr=swmr)
  File "/path/to/.local/lib/python2.7/site-packages/h5py/_hl/files.py", line 173, in make_fid
    fid = h5f.open(name, flags, fapl=fapl)
  File "h5py/_objects.pyx", line 54, in h5py._objects.with_phil.wrapper
  File "h5py/_objects.pyx", line 55, in h5py._objects.with_phil.wrapper
  File "h5py/h5f.pyx", line 88, in h5py.h5f.open
IOError: Unable to open file (truncated file: eof = 3875536896, sblock->base_addr = 0, stored_eof = 4960432904)```

Besides, I ran S-LDSC by myself. Could you provide an example of how to use the S-LDSC result to generate the user provide per-SNP heritability file?

Thank you very much!
maltose1117 commented 2 years ago

The details of ori.example.sh is shown as below.

python2 AnnoPred.py\
  --sumstats=test_data/GWAS_sumstats.txt\
  --ref_gt=test_data/test\
  --val_gt=test_data/test\
  --coord_out=test_output/coord_out\
  --N_sample=69033\
  --annotation_flag="tier3"\
  --P=0.1\
  --local_ld_prefix=tmp_test/local_ld\
  --out=test_output/test\
  --temp_dir=tmp_test\
eldronzhou commented 2 years ago

Hi Talia,

The error is likely due to the annotation file not properly downloaded? Could you download the annotation file again to see if it solves your issue?

maltose1117 commented 2 years ago

Hi Talia,

The error is likely due to the annotation file not properly downloaded? Could you download the annotation file again to see if it solves your issue?

Thanks for your prompt reply. I will try to download the annotation file and try to run AnnoPred again. Will get back to you soon.