ythuang0522 / homopolish

High-quality Nanopore-only genome polisher
GNU General Public License v3.0
65 stars 12 forks source link

UnboundLocalError: local variable 'record' referenced before assignment #50

Closed chen1i6c04 closed 2 years ago

chen1i6c04 commented 2 years ago

Hi

I run the modpolish and got below error

Traceback (most recent call last):
  File "/media/GenomicResearch/Tools/homopolish/homopolish.py", line 102, in <module>
    main()
  File "/media/GenomicResearch/Tools/homopolish/homopolish.py", line 77, in main
    mp.starModpolsh(fixData,FLAGS.debug)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 46, in starModpolsh
    filePath,mod_fix_flag = getPos(fixData,debug_mod)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 143, in getPos
    modpolish_filePath= fixProcess(fixary,H_AllAry,fixData,fileName)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 430, in fixProcess
    contig_output_filePath=write_for_new_fasta(record,fixData.output_dir+"debug",fixData.contig_id+"_modpolish")
UnboundLocalError: local variable 'record' referenced before assignment

It is seem the variable 'record' did't be assigned if not any fix.

Ted-Guo commented 2 years ago

Hi sir We fixed this problem. Please download the last version. Thank you.

chen1i6c04 commented 2 years ago

Hi I used the last version, it fixed the problem indeed but I got the new error in part data.

  File "/media/GenomicResearch/Tools/homopolish/homopolish.py", line 102, in <module>
    main()
  File "/media/GenomicResearch/Tools/homopolish/homopolish.py", line 77, in main
    mp.starModpolsh(fixData,FLAGS.debug)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 76, in starModpolsh
    filePath,mod_fix_flag = getPos(fixData,debug_mod)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 183, in getPos
    modpolish_filePath= fixProcess(fixary,H_AllAry,fixData,fileName)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 475, in fixProcess
    record = getSeq(fixAry,fixData)
  File "/media/GenomicResearch/Tools/homopolish/modules/mod_polish.py", line 466, in getSeq
    fixSeq.Seq,
UnboundLocalError: local variable 'fixSeq' referenced before assignment
SeaneryChang commented 2 years ago

We have solved this bug. The latest version can work now and we are sorry about it.

chen1i6c04 commented 2 years ago

It works, thanks