Closed chasemc closed 3 years ago
Additional context: I currently have a local branch that pulls isolate genome scaffolds and inputs them for clustering so they should cluster very easily. I'm assuming that these produce no unclustered contigs after the first binning
Proposed fix (I can do this if it looks ok @WiscEvan @Sidduppal @jason-c-kwan ): Change
if not prev_num_unclustered:
raise BinningError("No unclustered contigs are available to recruit!")
to
if not prev_num_unclustered:
print("No unclustered contigs are available to recruit!")
return
And change the Nextflow outputs to
output.... optional: true
The return does not necessarily exit the program. We have logging enabled throughout the library so this should be used instead of print.
import sys
if not prev_num_unclustered:
logger.warning("No unclustered contigs are available to recruit!")
sys.exit(status=0)
Otherwise, I'm fine with changing this.
Yeah but sys.exit()
also raises an exception so I think that also won't work. The return
should just exit main()
and be sufficient.
Oh, status=0, my bad
Just putting here for posterity:
sys.exit(status=0)
gives TypeError: exit() takes no keyword arguments
Changed to:
sys.exit(0)
Tested and
import sys
if not prev_num_unclustered:
logger.warning("No unclustered contigs are available to recruit!")
sys.exit(status=0)
works. Adding to next commit
If there are no unclustered bins to start then the Nextflow pipeline fails because of a
raise
error in the Python script:https://github.com/KwanLab/Autometa/blob/9b8f00e952094e98cd83027371938730a2933ca4/autometa/binning/unclustered_recruitment.py#L573-L575