marcelauliano / MitoHiFi

Find, circularise and annotate mitogenome from PacBio assemblies
MIT License
169 stars 29 forks source link

KeyError in getGenesList #49

Closed khoojj closed 1 year ago

khoojj commented 1 year ago

Hi, I am trying out the tool but run into the following error:

2023-04-05 00:36:55 [INFO] 7. Calculating final stats for final mitogenome and other potential contigs.
    Stats will be saved on contigs_stats.tsv file.
Traceback (most recent call last):
  File "/home/jingk/tools/MitoHiFi/mitohifi.py", line 551, in <module>
    main()
  File "/home/jingk/tools/MitoHiFi/mitohifi.py", line 410, in main
    related_mito_genes = get_genes_list(related_mito_annotation, "genbank")
  File "/pub59/jingk/tools/MitoHiFi/getGenesList.py", line 19, in get_genes_list
    genes.append(feat.qualifiers['gene'][0])
KeyError: 'gene'

I suppose it is trying to collect the genes from the final_mitogenome.gb file produced but I'm not sure why there is a key error. I've also checked the other *.gb files produced in the annotation folders for each contig - they also look fine.

Some help will be appreciated, cheers!

khoojj commented 1 year ago

I realised the NCBI .gb file I used for reference didn't have "gene" attributes. The error went away after I switched to another reference,