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

"ValueError: could not convert string to float" in convert_eggnog_to_homologs() #125

Open
Zaffe24 opened this issue Sep 29, 2023 · 1 comment

Comments

@Zaffe24
Copy link

Zaffe24 commented Sep 29, 2023

Dear @atarashansky,

I encountered an error when running the convert_eggnog_to_homologs() function.
I would be very glad if you could help me solve this issue.
Best regards,
Pietro

`EGGs={'mm':mm_ort, 'hg': hg_ort}
ortholog_pairs = convert_eggnog_to_homologs(sm,EGGs,og_key='eggNOG_OGs',taxon=4067)
paralog_pairs = convert_eggnog_to_homologs(sm,EGGs,og_key='eggNOG_OGs',taxon=9989)

ValueError Traceback (most recent call last)
/tmp/ipykernel_22788/151535015.py in
1 EGGs={'mm':mm_ort, 'hg': hg_ort}
----> 2 ortholog_pairs = convert_eggnog_to_homologs(sm,EGGs,og_key='eggNOG_OGs',taxon=4067)
3 paralog_pairs = convert_eggnog_to_homologs(sm,EGGs,og_key='eggNOG_OGs',taxon=9989)

~/.conda/envs/SAMap/lib/python3.7/site-packages/samap/analysis.py in convert_eggnog_to_homologs(sm, EGGs, og_key, taxon)
1107
1108 og = q(A[og_key].reindex(gn))
-> 1109 og[og == "nan"] = ""
1110
1111 X = []

ValueError: could not convert string to float: `

I am using numpy 1.21.6 on Python3.7, I believe it entered in conflict with line 1109.

Here is a snapshot of one of the EGGNOG tables I am using:

Schermata del 2023-09-29 14-52-29

@coulterr24
Copy link

Hey there @Zaffe24,

I was just playing around with eggNOG outputs and the 'convert_eggnog_to_homologs' function, and I ran into the same issue. It turns out that I had duplicate values in my 'query' column from the eggNOG table.

I'd first make sure that the data in the 'query' column are identical to the genes in your SAMap object (prior to the species annotation , e.g. 'mm_'), and then I would check for duplicates in that column!

I hope that helps, and good luck!

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