merenlab / anvio

An analysis and visualization platform for 'omics data
http://merenlab.org/software/anvio
GNU General Public License v3.0
426 stars 145 forks source link

ValueError after anvi-display-pan (only after anvi-script-FASTA-to-contigs-db) #1007

Closed Arkadiy-Garber closed 5 years ago

Arkadiy-Garber commented 5 years ago

Operating system macOS Sierra. Painless installation with Conda completed successfully.

anvi-self-test --version Anvi'o version ...............................: margaret (vunknown) Profile DB version ...........................: 30 Contigs DB version ...........................: 12 Pan DB version ...............................: 12 Genome data storage version ..................: 6 Auxiliary data storage version ...............: 2 Structure DB version .........................: 1

anvi-self-test --suite pangenomics finished successfully.

Hello,

First, thanks for all that you do! I always feel bad starting issues since I am not sure whether the problem is something dumb on my end, or an actual bug. I tend to assume the former, but have not had any luck finding anything online about this

In an attempt to display a pan genome using the anvi-display-pan command, I am receiving this:

anvi-display-pan -g TREMBLAYA-GENOMES.db -p TREMBLAYA/Tremblaya_Pan-PAN.db

[13 Oct 18 00:44:18 Recovering additional data for layers] ... Traceback (most recent call last): File "/anaconda3/bin/anvi-display-pan", line 72, in d = interactive.Interactive(args) File "/anaconda3/lib/python3.6/site-packages/anvio/interactive.py", line 128, in init self.layers_additional_data_keys, self.layers_additional_data_dict = TableForLayerAdditionalData(self.args).get_all() if a_db_is_found else ([], {}) File "/anaconda3/lib/python3.6/site-packages/anvio/tables/miscdata.py", line 723, in get_all keys_dict[group_name], data_dict[group_name] = self.get() File "/anaconda3/lib/python3.6/site-packages/anvio/tables/miscdata.py", line 598, in get d[additional_data_item_name][key] = eval(entry['data_type'])(value or self.nulls_per_type[entry['data_type']]) ValueError: invalid literal for int() with base 10: '0.719424460431655'

All commands prior to this (anvi-script-FASTA-to-contigs-db, anvi-gen-genomes-storage, and anvi-pan-genome) seemed to have finished without throwing any issues. I went back and, overcoming my inherent laziness, ran anvi-gen-contigs-database on all my genomes, instead of anvi-script-FASTA-to-contigs-db. This fixed the issue, and I was able to get a really nice pan genome visualized :)

Anyway, I just wanted to bring this to light in case anyone else has an issue like this.

Thanks! Arkadiy

meren commented 5 years ago

Hi Arkadiy,

We know about this issue, and it is not your fault at all :) Thanks for the report, and sorry about the inconvenience. We will fix it in the next minor release. But meanwhile you can save yourself by running these two commands in your terminal (PAN.db should be the path for your pan database, clearly):

sqlite3 PAN.db "UPDATE layer_additional_data SET data_type='float' WHERE data_key LIKE 'percent_completion'"

sqlite3 PAN.db "UPDATE layer_additional_data SET data_type='float' WHERE data_key LIKE 'percent_redundancy'"

Please let us know if these commands solve your issue.

Arkadiy-Garber commented 5 years ago

Hey Meren,

Thanks a lot! Those commands resolved the issue for me. Cheers, Arkadiy

Caizhaohui commented 5 years ago

Hey Meren

I have a similar problem . (anvio) czh@ubuntu:~/Desktop/anvio_work$ anvi-self-test --version Anvi'o version ...............................: margaret (vunknown) Profile DB version ...........................: 30 Contigs DB version ...........................: 12 Pan DB version ...............................: 12 Genome data storage version ..................: 6 Auxiliary data storage version ...............: 2 Structure DB version .........................: 1

When I want to display a pan genome using the anvi-display-pan command, I am receiving this:

anvi-display-pan -p km_test_pan/km_test_pan-PAN.db -g km_test-GENOMES.db [06 Jan 19 02:51:16 Recovering additional data for layers] ... Traceback (most recent call last): File "/home/czh/miniconda3/envs/anvio/bin/anvi-display-pan", line 72, in d = interactive.Interactive(args) File "/home/czh/miniconda3/envs/anvio/lib/python3.6/site-packages/anvio/interactive.py", line 128, in init self.layers_additional_data_keys, self.layers_additional_data_dict = TableForLayerAdditionalData(self.args).get_all() if a_db_is_found else ([], {}) File "/home/czh/miniconda3/envs/anvio/lib/python3.6/site-packages/anvio/tables/miscdata.py", line 723, in get_all keys_dict[group_name], data_dict[group_name] = self.get() File "/home/czh/miniconda3/envs/anvio/lib/python3.6/site-packages/anvio/tables/miscdata.py", line 598, in get d[additional_data_item_name][key] = eval(entry['data_type'])(value or self.nulls_per_type[entry['data_type']]) ValueError: invalid literal for int() with base 10: '0.719424460431655'

I am a newcomer in bioinformatics. I am sorry I can not solve this issue by the way you provided.

Thanks! Zhaohui Cai

meren commented 5 years ago

Hi @Caizhaohui,

We apologize for this bug and thank you for reaching out to us.

If you put your genomes storage and pan database files (only those two) into a new directory, and send a Dropbox download link for the zipped directory to a.murat.eren and ozcanesen at gmail.com addresses we can try to take a look and tell you exactly how to fix this.

Best,

Caizhaohui commented 5 years ago

Hi @meren I'm sorry to reply you so late. I re-run these commands (anvi-script-FASTA-to-contigs-db, anvi-gen-genomes-storage, anvi-pan-genome, sqlite3..... you provided and anvi-display-pan) without any issues. I also run the anvio following the way of Arkadiy-Garber and I get an interactive pan genome picture. I found that anvi-script-FASTA-to-contigs-db contain three steps (anvi-script-reformat-fasta, anvi-gen-contigs-database and anvi-run-hmms) by browsing the code of anvi-script-FASTA-to-contigs-db. Your prompt reply push me to solve the issue and learn more. Thanks for your excellent work and patience.

Best regards Zhaohui Cai