XiaoTaoWang / EagleC

A deep-learning framework for predicting a full range of structural variations from bulk and single-cell contact maps
Other
51 stars 8 forks source link

Key Error: 'sweight' in the predictSV #3

Closed baozg closed 2 years ago

baozg commented 2 years ago

Hi,

I follow the runHiC pipeline with chromap to get mcool format of HiC contact map. In the higlass, it looks good. But when I run the EagleC, the script throw a error.

predictSV --hic-5k ./C001-MboI-R1-filtered.mcool::/resolutions/5000 --hic-10k ./C001-MboI-R1-filtered.mcool::/resolutions/10000 --hic-50k ./C001-MboI-R1-filtered.mcool::/resolutions/50000 -O C001 -g other --balance-type CNV --output-for
mat full --prob-cutoff-5k 0.8 --prob-cutoff-10k 0.8 --prob-cutoff-50k 0.99999
root                      INFO    @ 06/21/22 13:54:52:
# ARGUMENT LIST:
# Cool URI at 5kb = ./C001-MboI-R1-filtered.mcool::/resolutions/5000
# Cool URI at 10kb = ./C001-MboI-R1-filtered.mcool::/resolutions/10000
# Cool URI at 50kb = ./C001-MboI-R1-filtered.mcool::/resolutions/50000
# Balance Type = CNV
# Reference Genome = other
# Included Chromosomes = ['#', 'X']                                                                                                                                                                                                           # Probability Cutoff for 5kb SVs = 0.8
# Probability Cutoff for 10kb SVs = 0.8                                                                                                                                                                                                       # Probability Cutoff for 50kb SVs = 0.99999
# Output File Prefix = C001                                                                                                                                                                                                                   # Output Format = full
# Log file name = eaglec.log
root                      INFO    @ 06/21/22 13:54:52: Predict SVs at 5kb resolution ...
root                      INFO    @ 06/21/22 13:57:59: matched sequencing depth in human at 10Kb: 266781118.61029372                                                                                                                          root                      INFO    @ 06/21/22 13:57:59: Load CNN models from /home/baozhigui/software/miniconda3/envs/scaffold/lib/python3.8/site-packages/eaglec/data/bulk/200M-300M ...
2022-06-21 13:57:59.504833: I tensorflow/core/platform/cpu_feature_guard.cc:142] This TensorFlow binary is optimized with oneAPI Deep Neural Network Library (oneDNN)to use the following CPU instructions in performance-critical operations:  SSE4.1 SSE4.2 AVX AVX2 AVX512F FMA
To enable them in other operations, rebuild TensorFlow with the appropriate compiler flags.                                                                                                                                                   2022-06-21 13:57:59.962777: I tensorflow/core/platform/profile_utils/cpu_utils.cc:104] CPU Frequency: 2100000000 Hz
2022-06-21 13:58:00.066879: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x562f27043c80 initialized for platform Host (this does not guarantee that XLA will be used). Devices:
2022-06-21 13:58:00.073798: I tensorflow/compiler/xla/service/service.cc:176]   StreamExecutor device (0): Host, Default Version
root                      INFO    @ 06/21/22 13:58:09: Done
root                      INFO    @ 06/21/22 13:58:09: Interemediate results at the 5kb resolution will be cached to .C001-MboI-R1-filtered.mcool.78688160.CNV.None.100000.None
Traceback (most recent call last):
  File "/home/baozhigui/software/miniconda3/envs/scaffold/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3621, in get_loc
    return self._engine.get_loc(casted_key)
  File "pandas/_libs/index.pyx", line 136, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 163, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/hashtable_class_helper.pxi", line 5198, in pandas._libs.hashtable.PyObjectHashTable.get_item
  File "pandas/_libs/hashtable_class_helper.pxi", line 5206, in pandas._libs.hashtable.PyObjectHashTable.get_item
KeyError: 'sweight'

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

Traceback (most recent call last):
  File "/home/baozhigui/software/miniconda3/envs/scaffold/bin/predictSV-single-resolution", line 276, in <module>
    run()
  File "/home/baozhigui/software/miniconda3/envs/scaffold/bin/predictSV-single-resolution", line 227, in run
    intra_expected_count = intraPredict(clr, cnn_models, chroms, cache_folder, seq_depth,
  File "eaglec/scoreUtils.pyx", line 1263, in eaglec.scoreUtils.intraPredict
  File "eaglec/scoreUtils.pyx", line 861, in eaglec.scoreUtils._intra_global_core
  File "/home/baozhigui/software/miniconda3/envs/scaffold/lib/python3.8/site-packages/pandas/core/frame.py", line 3505, in __getitem__
    indexer = self.columns.get_loc(key)
  File "/home/baozhigui/software/miniconda3/envs/scaffold/lib/python3.8/site-packages/pandas/core/indexes/base.py", line 3623, in get_loc
    raise KeyError(key) from err
KeyError: 'sweight'
Traceback (most recent call last):
  File "/home/baozhigui/software/miniconda3/envs/scaffold/bin/predictSV", line 176, in <module>
    run()
  File "/home/baozhigui/software/miniconda3/envs/scaffold/bin/predictSV", line 112, in run
    subprocess.check_call(' '.join(command), shell=True)
  File "/home/baozhigui/software/miniconda3/envs/scaffold/lib/python3.8/subprocess.py", line 364, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'predictSV-single-resolution -H ./C001-MboI-R1-filtered.mcool::/resolutions/5000 --balance-type CNV -O C001.CNN_SVs.5K.txt --genome other --output-format full -C "#" "X" --prob-cutoff 0.8 --logFile e
aglec.log' returned non-zero exit status 1.
image
XiaoTaoWang commented 2 years ago

just change your command by replacing "--balance-type CNV" with "--balance-type ICE".

XiaoTaoWang commented 2 years ago

there is a paragraph in the documentation explaining how to set the "--balance-type" parameter in this section https://github.com/XiaoTaoWang/EagleC#quick-start

baozg commented 2 years ago

Sorry. I forget that and set it as human. It run well now.