bulik / ldsc

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

make_annot.py_error "AttributeError: 'float' object has no attribute 'isdigit'" #361

Open HLQsmile opened 2 years ago

HLQsmile commented 2 years ago

Hi LDSC team,

I was using make_annot.py to create thin annotation files from sample files, for a partitioned heritability analysis. I kept running into an issue where the script was creating annotation files.

Any suggestions?

(base) stxuyuan@ubuntu:~/Documents/HLQ/GWAS/test$ python make_annot.py \ --gene-set-file GTEx_Cortex.GeneSet \ --gene-coord-file ENSG_coord.txt \ --windowsize 100000 \ --bimfile 1000G.EUR.QC.22.bim \ --annot-file GTEx_Cortex.annot.gz

making gene set bed file Traceback (most recent call last): File "make_annot.py", line 50, in bed_for_annot = gene_set_to_bed(args) File "make_annot.py", line 17, in gene_set_to_bed return BedTool(iter_df).sort().merge() File "/home/stxuyuan/miniconda3/lib/python3.8/site-packages/pybedtools/bedtool.py", line 589, in init fn = BedTool(iter(fn)).saveas().fn File "/home/stxuyuan/miniconda3/lib/python3.8/site-packages/pybedtools/bedtool.py", line 923, in decorated result = method(self, *args, **kwargs) File "/home/stxuyuan/miniconda3/lib/python3.8/site-packages/pybedtools/bedtool.py", line 3362, in saveas fn = self._collapse( File "/home/stxuyuan/miniconda3/lib/python3.8/site-packages/pybedtools/bedtool.py", line 1422, in _collapse for i in iterable: File "pybedtools/cbedtools.pyx", line 793, in pybedtools.cbedtools.IntervalIterator.next File "pybedtools/cbedtools.pyx", line 657, in pybedtools.cbedtools.create_interval_from_list File "pybedtools/cbedtools.pyx", line 579, in pybedtools.cbedtools.isdigit AttributeError: 'float' object has no attribute 'isdigit'

dinosaurur commented 11 months ago

Hi, I resolved this error by modifying the code in make_annot.py at lines 23-25, as explained in the following link: numpy.int64 has no attribute isdigit #362.

However, I am not sure if I got the correct output because I can't access the files in the tutorial.