filip-husnik / pseudofinder

Detection of pseudogene candidates in bacterial and archaeal genomes.
GNU General Public License v3.0
44 stars 16 forks source link

TypeError: can only concatenate str (not "NoneType") to str #15

Closed dustin-dial closed 4 years ago

dustin-dial commented 4 years ago

Hello,

First, I wanted to thank you for creating such a great tool, it has already proven to be very useful! However, when I run the annotate command, I get an error after the blastp/blastx search and extraction stages when the program is trying to write the summary file. Here's the command I used on the Tremblaya .gbf file for a test run with the sprot db:

python3 /home/dtdial/pseudo-finder/pseudofinder.py annotate --genome /home/dtdial/pseudo-finder/test/candidatus_tremblaya_princeps_PCIT.gbf --outprefix test --database /home/dtdial/Bacteria/sprot --threads 16

And this is the error message:

2020-08-16 18:11:50     CDS extracted from:                     /home/dtdial/pseudo-finder/test/candidatus_tremblaya_princeps_PCIT.gbf
                        Written to file:                        test_cds.fasta.
2020-08-16 18:11:50     Proteome extracted from:                /home/dtdial/pseudo-finder/test/candidatus_tremblaya_princeps_PCIT.gbf
                        Written to file:                        test_proteome.faa.
2020-08-16 18:11:50     Intergenic regions extracted from:      /home/dtdial/pseudo-finder/test/candidatus_tremblaya_princeps_PCIT.gbf
                        Written to file:                        test_intergenic.fasta.
2020-08-16 18:11:50     blastp executed with 16 threads.
2020-08-16 18:11:51     blastx executed with 16 threads.
2020-08-16 18:11:53     Extracting information from blastp file.
2020-08-16 18:11:53     Extracting information from blastx file.
2020-08-16 18:11:53     Checking contig 1 / 1 for pseudogenes.
                        Number of ORFs on this contig: 186
                        Number of pseudogenes flagged: 18
2020-08-16 18:11:53     Writing summary of run: test_log.txt
Traceback (most recent call last):
  File "/home/dtdial/pseudo-finder/pseudofinder.py", line 30, in <module>
    annotate.main()
  File "/home/dtdial/pseudo-finder/modules/annotate.py", line 1339, in main
    write_summary_file(args=args, file_dict=file_dict)
  File "/home/dtdial/pseudo-finder/modules/annotate.py", line 948, in write_summary_file
    "Functional genes:\t" + str(StatisticsDict['ProteomeOrfs'] - StatisticsDict['FragmentedOrfs'] - StatisticsDict['PseudogenesShort'] - StatisticsDict["dnds"]) + "\n\n"
TypeError: can only concatenate str (not "NoneType") to str

I have the same issue when I run the command on other .gbk/.gbf files generated by prokka with the recommended settings and when I use the NR database. I do get all of the expected outputs, but the log file is empty, and I'd like to use the reannotate command.

Thank you!

mitchso commented 4 years ago

Hi Dustin,

Sorry for the delay, I've been overhauling some of the inner workings and this bug should be solved. Can you pull the updates and try again?

Cheers, Mitch

dustin-dial commented 4 years ago

Mitch,

It works like a charm! Thanks again!

Best,

Dustin

mitchso commented 4 years ago

Glad to hear it! No problem, closing this issue