AuReMe / emapper2gbk

Convert GFF, fastas, annotation table and species name into Genbank.
GNU Lesser General Public License v3.0
11 stars 5 forks source link

UnboundLocalError: local variable 'annotation_dict' referenced before assignment #17

Open sandipmkale opened 1 year ago

sandipmkale commented 1 year ago

Description

I am trying to convert gff fasta to GenBank. but got following error: The default organism name 'cellular organisms' is used. Creating GFF database (gffutils) for chr01.1 Traceback (most recent call last): File "/HOPS/hqkalsan/python3.9_new/bin/emapper2gbk", line 33, in sys.exit(load_entry_point('emapper2gbk==0.3.0', 'console_scripts', 'emapper2gbk')()) File "/HOPS/hqkalsan/python3.9_new/lib64/python3.9/site-packages/emapper2gbk-0.3.0-py3.9.egg/emapper2gbk/main.py", line 306, in cli gbk_creation(nucleic_fasta=args.fastanucleic, protein_fasta=args.fastaprot, annot=args.annotation, gff=args.gff, gff_type=gff_type, File "/HOPS/hqkalsan/python3.9_new/lib64/python3.9/site-packages/emapper2gbk-0.3.0-py3.9.egg/emapper2gbk/emapper2gbk.py", line 84, in gbk_creation gbk_result = genomes_to_gbk.gff_to_gbk(nucleic_fasta=nucleic_fasta, protein_fasta=protein_fasta, annot=annot, File "/HOPS/hqkalsan/python3.9_new/lib64/python3.9/site-packages/emapper2gbk-0.3.0-py3.9.egg/emapper2gbk/genomes_to_gbk.py", line 164, in gff_to_gbk annot = dict(read_annotation(annot)) File "/HOPS/hqkalsan/python3.9_new/lib64/python3.9/site-packages/emapper2gbk-0.3.0-py3.9.egg/emapper2gbk/utils.py", line 427, in read_annotation for key in annotation_dict: UnboundLocalError: local variable 'annotation_dict' referenced before assignment

What I Did

emapper2gbk genomes -fn genome_dir/chr01.1.fna -fp protein_sequence/chr01.1.faa -o hop_pseudomolecules_v1.1_p1_p2.gbk -g gff/chr01.1.gff -a annotation/chr01.1.tsv the gff file looks like : chr01.1 PGSBv3.1.1 gene 29309 31323 0.000 + . ID=id1 chr01.1 PGSBv3.1.1 CDS 29309 31323 . + . ID=id1.1;Parent=id1;primary=T

ArnaudBelcour commented 1 year ago

Hi @sandipmkale,

This error seems to come from the annotation file of eggnog-mapper, as emapper2gbk is not able to find the header (by searching the fields query_name or query) and extract the annotation.

Could you indicate the version of eggnog-mapper you used?

Also, is it possible for you to show the header of the annotation file annotation/chr01.1.tsv?