mpinese / nimpress

Polygenic score calculation from VCF in Nim.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Invalid float error

lf-araujo opened this issue · comments

Hi all,

I came across the error below:

strutils.nim(1127)       parseFloat
Error: unhandled exception: invalid float: 1	11012	C	G	0.00441914	0.085461 [ValueError]

While reading the scores:

└─λ head for-nimpress.txt                                                   
1	10177	A	AC	-0.000379243	0.399049
1	10352	T	TA	-0.00209665	0.388375
1	10511	G	A	0.0429333	0.001404
1	10616	CCGCCGTTGCAAAGGCGCGCCG	C	-0.00973048	0.995384
1	11012	C	G	0.00441914	0.085461
1	13110	G	A	-0.0018992	0.060383
1	13116	T	G	-0.0116562	0.190244
1	13118	A	G	-0.0116562	0.190244
1	13273	G	C	-0.00166655	0.1349
1	13453	T	C	-0.00604743	0.006604

The file above was created using the command:

bcftools query -f '%CHROM\t%POS\t%REF\t%ALT[\t%ES][\t%AF]\n' ebi-a-GCST006686.vcf.gz > for-nimpress.txt

Initially I thought line 5 was the culprit, but if I remove it the next line generates the same error.

  • What am I doing wrong?

Found the problem, the score file was not following the standard in the readme. The headers are obligatory.