nextgenusfs / funannotate

Eukaryotic Genome Annotation Pipeline
http://funannotate.readthedocs.io
BSD 2-Clause "Simplified" License
300 stars 82 forks source link

funannotate sort line 37 minlen > 0 #958

Open ferninfm opened 9 months ago

ferninfm commented 9 months ago

Hi a simple issue to fix (funannotate sort does not work properly because minlen is read as string while 0 is an integer....) change https://github.com/nextgenusfs/funannotate/blob/b7793448eb4c147d54a39167ac4445b291a7124a/funannotate/sort.py#L37

to

if int(minlen) > 0: 
ferninfm commented 9 months ago

Actually this only restores the functionality when imposing a --minlen value; otherwise int() is a problem applied to the minlen=0 imposed in line 13(?) which has no type

  File "..../funannotate_1.8.9_2/lib/python3.9/site-packages/funannotate/sort.py", line 38, in SortRenameHeaders
    if int(minlen) > 0:
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
if int(minlen) > 0: 

This solves the issue ( I think)

if int(minlen or 0) > 0
nextgenusfs commented 9 months ago

It just needs type=int in the argparse object. I will fix.