gapless
gapless copied to clipboard
Gapless extend local variable error
Hello, I am using gapless with python version 3.9.6, and I get this error on the extend step:
Traceback (most recent call last):
File "/home/student.unimelb.edu.au/sbjornson/opt/gapless/gapless.py", line 13362, in
main(sys.argv[1:])
File "/home/student.unimelb.edu.au/sbjornson/opt/gapless/gapless.py", line 13228, in main
GaplessExtend(args[0], prefix, min_length_contig_break, large_reads)
UnboundLocalError: local variable 'large_reads' referenced before assignment
Any ideas on how to fix?
I actually figured it out, I needed to switch to the conda version, and then install python 3.9.6 and pandas version 1.5.3.
Tried the solution posted by SaelinB but did not work for me - I have all python packages set to the tested versions listed on the main page, tried pandas as 1.3.1 and 1.5.3 and get the error:
"UnboundLocalError: local variable 'large_reads' referenced before assignment"
I found a solution for anyone that runs into this issue - the bug seems to be caused by a missing baseline definition of the 'large_reads' variable in the GaplessExtend function. I borrowed a line of code from GaplessScaffold which seemed to be missing in the extend function.
Manually insert a new line after line 13199 (min_length_contig_break = 1200) which should read 'large_reads = False'. This gives the large_reads variable a baseline definition and will be flipped to true if the large reads flag is set in the function initially. Pipeline worked for me after making this adjustment.