bvilhjal / ldpred

MIT License
96 stars 57 forks source link

coord -- TypeError: No conversion path for dtype: dtype('<U1') #43

Closed privefl closed 5 years ago

privefl commented 5 years ago

Data to reproduce the issue

python ../ldpred/LDpred.py coord --gf reprex --ssf SUM_STATS_FILE.txt --ssf-format BASIC --N 12000 --out OUT_COORD_FILE.hdf5
Preparing to parse summary statistics
Parsing bim file: reprex.bim
Parsing the file: SUM_STATS_FILE.txt
Ignored chromosomes: 9chrc
Please note that only data on chromosomes 1-23, and X is parsed.
SS file loaded, now sorting and storing in HDF5 file.
Parsed summary stats for 21540 SNPs on chromosome 1
Traceback (most recent call last):
  File "../ldpred/LDpred.py", line 245, in <module>
    main()
  File "../ldpred/LDpred.py", line 230, in main
    coord_genotypes.main(p_dict)
  File "/home/privef/Bureau/ldpred/ldpred/coord_genotypes.py", line 717, in main
    sum_stats_parsers.parse_sum_stats(h5f, p_dict, bimfile)
  File "/home/privef/Bureau/ldpred/ldpred/sum_stats_parsers.py", line 28, in parse_sum_stats
    filename=p_dict['ssf'], bimfile=bimfile, hdf5_file=h5f, n=p_dict['N'], debug=p_dict['debug'])
  File "/home/privef/Bureau/ldpred/ldpred/sum_stats_parsers.py", line 903, in parse_sum_stats_basic
    g.create_dataset('nts', data=nts)
  File "/home/privef/anaconda3/lib/python3.7/site-packages/h5py/_hl/group.py", line 116, in create_dataset
    dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)
  File "/home/privef/anaconda3/lib/python3.7/site-packages/h5py/_hl/dataset.py", line 100, in make_new_dset
    tid = h5t.py_create(dtype, logical=1)
  File "h5py/h5t.pyx", line 1611, in h5py.h5t.py_create
  File "h5py/h5t.pyx", line 1633, in h5py.h5t.py_create
  File "h5py/h5t.pyx", line 1694, in h5py.h5t.py_create
TypeError: No conversion path for dtype: dtype('<U1')

What am I doing wrong? What does "Ignored chromosomes: 9chrc" mean?

python --version
Python 3.7.0
daniel-hui commented 5 years ago

Hi, I also got the exact same error. Installed LDpred today (Feb 1 2019) about 2PM EST using git clone https://github.com/bvilhjal/ldpred.git, used Python 3.6

bvilhjal commented 5 years ago

Thanks for reporting this. I just switched to python 3, which is causing some problems with h5py and unicode. My testing hadn't caught this one. Should be fixed now..