perslab / CELLECT

CELLECT (CELL-type Expression-specific integration for Complex Traits)
GNU General Public License v3.0
71 stars 19 forks source link

KeyError: u"None of [Int64Index #85

Open wanghf0501 opened 2 years ago

wanghf0501 commented 2 years ago

I get error message "KeyError: u"None of [Int64Index([-2, -2, -2, -2, -2, -2, -2, -2, -2, -1,\n ...\n -1, -2, -2, -2, -2, -2, -2, -2, -2, -2],\n dtype='int64', length=1217311)] are in the [index]"", when I run mtag_munge.py on the example data ( python ldsc/mtag_munge.py --sumstats example/GWAS_EA_excl23andMe.txt --merge-alleles data/ldsc/w_hm3.snplist --n-value 766345 --keep-pval --p PVAL --out example/EA3_Lee2018). Does anyone know how to fix it?

dangxiao21 commented 5 months ago

I met the same problem, I changed the line:

dat.loc[~jj, [i for i in dat.columns if i != 'SNP']] = float('nan')

to the following in the mtag_munge.py script and run successfully:

dat.loc[~jj.astype('bool'), [i for i in dat.columns if i != 'SNP']] = float('nan')