XiaoTaoWang/NeoLoopFinder

UnboundLocalError: local variable 'pool' referenced before assignment

DittmanC opened this issue · 2 comments

I am new to this software. I am trying to follow the procedures by first converting the .hic file to .cool format.

  1. hic2cool convert $work_dir/hic/sample.hic $work_dir/cooler/sample_${bin_size}.cool -r $bin_size -p 10

then I used calculate-cnv and segment-cnv in step 2 and 3. It cause no problem and no error message.

2.calculate-cnv -g hg19 -H $work_dir/cooler/sample_${bin_size}.cool --output $work_dir/cooler/sample_${bin_size}_calculate-cnv.txt -e MboI --cachefolder /disk3/users/dittman/Data/project1/OmniC/align/mapped/cooler/neoloopfinder/

3.segment-cnv --cnv-file $work_dir/cooler/sample_${bin_size}calculate-cnv.txt --binsize ${bin_size} --output $work_dir/cooler/NPC53P68_filter_hg19EBV${bin_size}_segmented_cnv.txt --nproc 12

However, when I tried to do correct-cnv, it showed "UnboundLocalError: local variable 'pool' referenced before assignment"
4.correct-cnv -H $work_dir/cooler/sample_${bin_size}.cool --cnv-file $work_dir/cooler/sample_${bin_size}_segmented_cnv.txt --nproc 12 --logFile $work_dir/cooler/cnv-norm.log

the error message as below,

root INFO @ 10/19/21 17:23:42: Match CNV segmentation to matrix bins
root INFO @ 10/19/21 17:23:46: Perform CNV-separate matrix balancing ...
Traceback (most recent call last):
File "/disk3/users/dittman/.conda/envs/neoloop/lib/python3.7/site-packages/neoloop/cnv/correctcnv.py", line 179, in matrix_balance
pool = balance.Pool(nproc)
AttributeError: module 'cooler.balance' has no attribute 'Pool'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/disk3/users/dittman/.conda/envs/neoloop/bin/correct-cnv", line 94, in run
matrix_balance(args.hic, nproc=args.nproc)
File "/disk3/users/dittman/.conda/envs/neoloop/lib/python3.7/site-packages/neoloop/cnv/correctcnv.py", line 198, in matrix_balance
pool.close()
UnboundLocalError: local variable 'pool' referenced before assignment

I have tried to run the "cooler balance" before step 4 as well and It doesn't work for me

it looks like a version compatibility issue of the cooler package ... which cooler version did you install?