Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail on correct-cnv #8

Closed
wzhang42 opened this issue Jul 23, 2021 · 2 comments
Closed

Fail on correct-cnv #8

wzhang42 opened this issue Jul 23, 2021 · 2 comments

Comments

@wzhang42
Copy link

Hi, XiaoTao,
I continuously use the following command lines for calculate-cnv, segment-cnv and correct-cnv.
1.) calculate-cnv -g hg19 -H hic_SH-SY5Y.inter_5000.cool --output ./calculate-cnv.txt -e MboI --cachefolder ./neoloopfinder
2.) segment-cnv --cnv-file ./calculate-cnv.txt --binsize 5000 --output ./segmented_cnv.txt --nproc 12
3.) correct-cnv -H hic_SH-SY5Y.inter_5000.cool --cnv-file ./segmented_cnv.txt --nproc 12 --logFile cnv-norm.log

The first two, calculate-cnv, and segment-cnv are ok. But correct-cnv throw the following Error message. Could you give me any clues or suggestions to fix it. Thank you in advance.
....
root INFO @ 07/22/21 20:42:28:

ARGUMENT LIST:

Cooler URI = hic_SH-SY5Y.inter_5000.cool

CNV Profile = ./segmented_cnv.txt

Number of Processes = 12

Log file name = cnv-norm.log

root INFO @ 07/22/21 20:42:38: Match CNV segmentation to matrix bins
Traceback (most recent call last):
File "/home/wzhang42/.conda/envs/neoloop/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3080, in get_loc
return self._engine.get_loc(casted_key)
File "pandas/_libs/index.pyx", line 70, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/index.pyx", line 101, in pandas._libs.index.IndexEngine.get_loc
File "pandas/_libs/hashtable_class_helper.pxi", line 4554, in pandas._libs.hashtable.PyObjectHashTable.get_item
File "pandas/_libs/hashtable_class_helper.pxi", line 4562, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'weight'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/home/wzhang42/.conda/envs/neoloop/bin/correct-cnv", line 92, in run
bincnv.assign_cnv(args.hic)
File "/home/wzhang42/.conda/envs/neoloop/lib/python3.7/site-packages/neoloop/cnv/loadcnv.py", line 87, in assign_cnv
bias = cooler_lib.bins().fetch(ref_k)['weight'].values
File "/home/wzhang42/.conda/envs/neoloop/lib/python3.7/site-packages/pandas/core/frame.py", line 3024, in getitem
indexer = self.columns.get_loc(key)
File "/home/wzhang42/.conda/envs/neoloop/lib/python3.7/site-packages/pandas/core/indexes/base.py", line 3082, in get_loc
raise KeyError(key) from err
KeyError: 'weight'

@XiaoTaoWang
Copy link
Owner

Ah, the error occurred because the current version assumes there is a column "weight" in the bin table of the input cool file, which stores the bias vector from the standard ICE normalization. To avoid the error, just run "cooler balance" on your cool file.

@wzhang42
Copy link
Author

This works. Thank you so much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants