Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compute_ldscores.py: line 200 TypeError: can't multiply sequence by non-int of type 'float' #25

Closed
dwightman opened this issue Mar 2, 2020 · 2 comments

Comments

@dwightman
Copy link

Hello,

I am trying to run the compute_ldscores.py to calculate LDscores for my annotations. I am get an error at this step [INFO] Applying initial ldscores loop, this is the error:

Traceback (most recent call last):
File "compute_ldscores.py", line 190, in
df_ldscores = compute_ldscores(args)
File "compute_ldscores.py", line 149, in compute_ldscores
ldscores = geno_array.ldScoreVarBlocks(block_left, args.chunk_size, annot=annot_values)
File "/home/doug/Documents/Polyfun/polyfun/ldsc_polyfun/ldscore.py", line 127, in ldScoreVarBlocks
return self.corSumVarBlocks(block_left, c, func, snp_getter, annot)
File "/home/doug/Documents/Polyfun/polyfun/ldsc_polyfun/ldscore.py", line 200, in corSumVarBlocks
cor_sum[l_A:l_A+b, :] += np.dot(rfuncAB, annot[l_B:l_B+c, :])
File "<array_function internals>", line 6, in dot
TypeError: can't multiply sequence by non-int of type 'float'

I am not sure what is causing this error, do you have any ideas?

This is the command I am using:

python compute_ldscores.py
--bfile ../AD31chr1polyfun
--annot ../gFIUDWchr1anno.gz
--out ../chr1.parquet
--ld-wind-kb 2000

Where AD31chrpolyfun is the stem for plink formatted bed,bim,fam files. The snp name format in the plink files is chr:pos:A1:A2, where A1 and A2 are organised alphabetically.

The format of gFIUDWchr1anno.gz looks like this
SNP CHR BP A1 A2 rsID Z N ANNO1 ANNO2
1:100000012:G:T 1 100000012 T G rs10875231 -1.2578195807 652942.54 1 0

Both files have the exact same snps in them. Any ideas what I can do to resolve the problem?

Cheers,
Doug

@omerwe
Copy link
Owner

omerwe commented Mar 3, 2020 via email

@dwightman
Copy link
Author

Great, thanks. I removed the rsID column and it works well.

Doug

@omerwe omerwe closed this as completed Mar 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants