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

Key error for emapper2gbk #8

Closed boaty closed 2 years ago

boaty commented 2 years ago

Description

hello,

We encountered this KeyError while running emapper2gbk. It seems like due to unmatched column for input annotation file from emapper. We used emapper version 2.1.6 with a default outformat 6 (--outfmt 6)

And we also noticed that online file of go-basic.obo has a missing ":" .

thanks a lot

What I Did

emapper2gbk genes -fn nucleotide_sequence/ -fp protein_sequence/  -a annotation/ -o gbk/  -go /data/eggnog-mapper_database/eggnog-mapper/data/go-basic.obo 
The default organism name 'metagenome' is used.
Assembling Genbank informations for MAG001
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/anaconda3/envs/m2m/lib/python3.9/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/anaconda3/envs/m2m/lib/python3.9/multiprocessing/pool.py", line 51, in starmapstar
    return list(itertools.starmap(args[0], args[1]))
  File "/home/anaconda3/envs/m2m/lib/python3.9/site-packages/emapper2gbk/genes_to_gbk.py", line 103, in faa_to_gbk
    create_genbank(gene_nucleic_seqs, gene_protein_seqs, annot, go_namespaces, go_alternatives, output_path, species_informations)
  File "/home/anaconda3/envs/m2m/lib/python3.9/site-packages/emapper2gbk/genes_to_gbk.py", line 127, in create_genbank
    record = record_info(gene_nucleic_id, gene_nucleic_seqs[gene_nucleic_id], species_informations)
  File "/home/anaconda3/envs/m2m/lib/python3.9/site-packages/emapper2gbk/utils.py", line 298, in record_info
    description=species_informations['description'],
KeyError: 'description'
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/anaconda3/envs/m2m/bin/emapper2gbk", line 8, in <module>
    sys.exit(cli())
  File "/home/anaconda3/envs/m2m/lib/python3.9/site-packages/emapper2gbk/__main__.py", line 309, in cli
    gbk_creation(nucleic_fasta=args.fastanucleic, protein_fasta=args.fastaprot, annot=args.annotation, org=orgnames,
  File "/home/anaconda3/envs/m2m/lib/python3.9/site-packages/emapper2gbk/emapper2gbk.py", line 196, in gbk_creation
    gbk_results = gbk_pool.starmap(genes_to_gbk.faa_to_gbk, multiprocess_data)
  File "/home/anaconda3/envs/m2m/lib/python3.9/multiprocessing/pool.py", line 372, in starmap
    return self._map_async(func, iterable, starmapstar, chunksize).get()
  File "/home/anaconda3/envs/m2m/lib/python3.9/multiprocessing/pool.py", line 771, in get
    raise self._value
KeyError: 'description'