merenlab / anvio

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

[BUG] KeyError: None in anvi-script-gen-distribution-of-genes-in-a-bin #2273

Closed Mayurk619 closed 1 month ago

Mayurk619 commented 1 month ago

Dear Meren,

I am facing this bug.

Short description of the problem

Keep the header of this section, but replace the content with a single-sentence description of the problem.

anvi'o version

anvi-self-test --version

Anvi'o .......................................: marie (v8) Python .......................................: 3.10.14

Profile database .............................: 38 Contigs database .............................: 21 Pan database .................................: 16 Genome data storage ..........................: 7 Auxiliary data storage .......................: 2 Structure database ...........................: 2 Metabolic modules database ...................: 4 tRNA-seq database ............................: 2

System info

OS Name: Microsoft Windows 11 Home Single Language 10.0.22631 I installed anvio using wsl for linux through conda, and wsl2 distribution is Ubuntu 22.04.4 LTS

Detailed description of the issue

When I tried to run anvi-script-gen-distribution-of-genes-in-a-bin -c megahit_contigs.db -p megahit_profile/PROFILE.db -C COMPOST_MAG_Bins_mh2 I got this error: Traceback (most recent call last):

File "/home/tgangar/miniconda3/envs/anvio-8/bin/anvi-script-gen-distribution-of-genes-in-a-bin", line 134, in

main(args)

File "/home/tgangar/miniconda3/envs/anvio-8/bin/anvi-script-gen-distribution-of-genes-in-a-bin", line 52, in main

detection_across_metagenomes = summary.collection_profile[genome_name]['detection']

KeyError: None

anvi-script-gen-.txt

Files / commands to reproduce the issue

I have uploaded the files in dropbox for reproduction of error link, if you require any other files message me.

Thank you,

Mayur

metehaansever commented 1 month ago

Hello @Mayurk619, This is actually not a bug, you need to specificy your bin with --bin . We added parameter check. Thanks for lettings us know :+1: You can check here for more detail: https://anvio.org/help/main/programs/anvi-script-gen-distribution-of-genes-in-a-bin/

meren commented 1 month ago

This is actually not a bug

Well, it is a bug since anvi'o yields a cryptic error message rather than helping the user to figure out what was wrong with their command line :)

meren commented 1 month ago

(but luckily there is an easy solution to fix the problem)