deprekate / PHANOTATE

PHANOTATE: a tool to annotate phage genomes.
GNU General Public License v3.0
69 stars 9 forks source link

AttributeError: 'int' object has no attribute 'position' #9

Closed snayfach closed 5 years ago

snayfach commented 5 years ago

Occasionally, phanotate gives the error:

Traceback (most recent call last):
  File "PHANOTATE/phanotate.py", line 61, in <module>
    file_handling.write_output(id, args, my_path, my_graph, my_orfs)
  File "PHANOTATE/lib/file_handling.py", line 80, in write_output
    if(left.position == 0 and right.position == last_node.position):
AttributeError: 'int' object has no attribute 'position'

Here is the 1.9Kb sequence that generates the error: https://www.dropbox.com/s/bv56zgc0ohf0w1z/test2.fna?dl=0

Prodigal runs fine and identifies 5 genes on this sequence.

Any ideas what could be wrong?

deprekate commented 5 years ago

I tracked down the bug and it was a combination of two things: 1) there was a +1 offset error that caused an ORF to be connect to itself and 2) I had changed the error message that fastpathz outputs from a single line to multiple, which caused the Negative Cycle error to not be caught by PHANOTATE

I have fixed both, and pushed updates to the repo. Thanks for the help : )

snayfach commented 5 years ago

Thanks for looking into this. Do you think this bug affected the output of runs that completed without errors? Should I re-run the tool on my data now that the bug is fixed?

deprekate commented 5 years ago

Nope the bug should not have affected any runs that ran properly. To test I ran 4,373 phage genomes from PATRIC through PHANOTATE with the old version and the new version and the output from both were 100.00% identical : )