gapless icon indicating copy to clipboard operation
gapless copied to clipboard

Gapless extend local variable error

Open SaelinB opened this issue 1 year ago • 3 comments

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?

SaelinB avatar Jan 13 '24 06:01 SaelinB

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.

SaelinB avatar Jan 17 '24 00:01 SaelinB

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"

Dogrinev avatar Jan 24 '24 21:01 Dogrinev

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.

Dogrinev avatar Jan 25 '24 15:01 Dogrinev