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

thread 'main' panicked at src/graph.rs:83:42: #56

Open
melisphdassociation opened this issue Jul 24, 2024 · 3 comments
Open

thread 'main' panicked at src/graph.rs:83:42: #56

melisphdassociation opened this issue Jul 24, 2024 · 3 comments

Comments

@melisphdassociation
Copy link

melisphdassociation commented Jul 24, 2024

Hi, I am trying to run prune_graph but I keep getting this error:

thread 'main' panicked at src/graph.rs:83:42:
cannot convert weight to float32: ParseFloatError { kind: Invalid }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

the command I used was

./target/release/prune_graph --header --in /home/mar/Documents/BonoboData/Inbreeding/Kokolopori_1x_downsampled_LD_newhead_bis.tsv --weight-field "r2" --weight-filter "dist <= 50000 && r2 >= 0.5" --out /home/mar/Documents/BonoboData/Inbreeding/Kokolopori_1x_downsampled_LD_unlinked.pos` and the input file is as seen below (lines 1-24).
site1 site2 dist r2_ExpG D Dp r2
chr21:13785523 chr21:13799870 14347 0 0 0 0
chr21:13785523 chr21:13799915 14392 0 0 0 0
chr21:13785523 chr21:13799945 14422 0 0 0 0
chr21:13785523 chr21:13799988 14465 0 0 0 0
chr21:13785523 chr21:13799992 14469 0 0 0 0
chr21:13785523 chr21:13799996 14473 0 0 0 0
chr21:13785523 chr21:13800009 14486 0 0 0 0
chr21:13785523 chr21:13800144 14621 0 0 0 0
chr21:13785523 chr21:13802726 17203 0.03762 0.105886 0.776129 0.223409
chr21:13785523 chr21:13802786 17263 0.20032 -0.186449 0.999537 0.865239
chr21:13785523 chr21:13802812 17289 0.022677 0.111929 0.76928 0.231784
chr21:13785523 chr21:13802852 17329 0.151713 0.138231 0.998166 0.439489
chr21:13785523 chr21:13802857 17334 0.024137 0.090714 0.780818 0.176644
chr21:13785523 chr21:13802866 17343 0.027376 0.072083 0.788954 0.134132
chr21:13785523 chr21:13802930 17407 0.200779 0.072818 0.999981 0.208974
chr21:13785523 chr21:13802944 17421 0.163352 0.078977 0.999959 0.228885
chr21:13785523 chr21:13802956 17433 0.174431 0.091935 0.999857 0.271932
chr21:13785523 chr21:13802979 17456 0.089505 0.096086 0.99903 0.284794
chr21:13785523 chr21:13803035 17512 0.033045 -0.10633 0.626227 0.199608
chr21:13785523 chr21:13803279 17756 0 0 0 0
chr21:13785523 chr21:13803280 17757 0 0 0 0
chr21:13785523 chr21:13803320 17797 0.000878 0.03711 0.270725 0.027265
chr21:13785523 chr21:13803337 17814 0,0007 0.028775 0.299227 0.021042

Would you be able to help me with this issue? I thought it might be the header but it doesn't seem to be the problem.
Thank you in advance

@melisphdassociation melisphdassociation changed the title thread 'main' panicked at src/graph.rs:83:42: cannot convert weight to float32: ParseFloatError { kind: Invalid } note: run with RUST_BACKTRACE=1 environment variable to display a backtrace thread 'main' panicked at src/graph.rs:83:42: Jul 24, 2024
@fgvieira
Copy link
Owner

The error message means that there is a weight (r2) with a value that cannot be converted to a float32

Is that your full file? If not, are there any values on the column r2 that might be invalid?

@melisphdassociation
Copy link
Author

Hello, in the end we managed to run the python script from ngsLD to do the pruning and it worked! Thanks anyway :)

@fgvieira
Copy link
Owner

If you have time, it would still be nice to know what was that could not be converted to a float32.
It is just so I can fix it and avoid future issues with other users.

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