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

KeyError: 'chrom' using your docker for 'hint tl' with cooler input #7

Open
cchlanger opened this issue Feb 7, 2020 · 2 comments
Open

Comments

@cchlanger
Copy link

Hi, I tried to use your docker on coolers files:

$ hint tl -m out/wtg2nolabelfc1_1000kb.cool,out/wtg2nolabelfc1_100kb.cool --chimeric out/wtg2nolabelfc1_chimeric.sorted.pairsam.gz --refdir data/hg19_SNPs --backdir backgroundMatrices/hg19 --ppath /miniconda3/bin/pairix -f cooler -g hg19 -n test -o out_tl_new

[15:48:22] Argument List: 
[15:48:22] Hi-C contact matrix = out/wtg2nolabelfc1_1000kb.cool, out/wtg2nolabelfc1_100kb.cool
[15:48:22] Hi-C contact matrix format = cooler
[15:48:22] Hi-C chimeric read pairs = out/wtg2nolabelfc1_chimeric.sorted.pairsam.gz
[15:48:22] Genome = hg19
[15:48:22] Name = test
[15:48:22] Output directory = out_tl_new
[15:48:22] Prepare Matrices!
Traceback (most recent call last):
  File "/miniconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2657, in get_loc
    return self._engine.get_loc(key)
  File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 129, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index_class_helper.pxi", line 91, in pandas._libs.index.Int64Engine._check_type
KeyError: 'chrom'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/miniconda3/bin/hint", line 201, in <module>
    main()
  File "/miniconda3/bin/hint", line 197, in main
    translrun(argparser)
  File "/miniconda3/lib/python3.6/site-packages/HiNT/runhint.py", line 108, in translrun
    matrix1MbInfo = coolToMatrix(matrixfile1Mb,1000,opts.outdir,opts.name)
  File "/miniconda3/lib/python3.6/site-packages/HiNT/coolToMatrix.py", line 30, in coolToMatrix
    binsInfo = getBins(coolfile)
  File "/miniconda3/lib/python3.6/site-packages/HiNT/coolToMatrix.py", line 9, in getBins
    idxarray = np.where(coolfile.bins()["chrom"][:] == chrom)
  File "/miniconda3/lib/python3.6/site-packages/cooler/core.py", line 532, in __getitem__
    return self._slice(self.fields, lo, hi)
  File "/miniconda3/lib/python3.6/site-packages/cooler/api.py", line 246, in _slice
    return bins(grp, lo, hi, fields, **kwargs)
  File "/miniconda3/lib/python3.6/site-packages/cooler/api.py", line 448, in bins
    is_integer_dtype(out['chrom'].dtype)
  File "/miniconda3/lib/python3.6/site-packages/pandas/core/series.py", line 868, in __getitem__
    result = self.index.get_value(self, key)
  File "/miniconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 4360, in get_value
    iloc = self.get_loc(key)
  File "/miniconda3/lib/python3.6/site-packages/pandas/core/indexes/base.py", line 2659, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/_libs/index.pyx", line 108, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index.pyx", line 129, in pandas._libs.index.IndexEngine.get_loc
  File "pandas/_libs/index_class_helper.pxi", line 91, in pandas._libs.index.Int64Engine._check_type
KeyError: 'chrom' 

This happens with existing coolers and with coolers generated by your 'hint pre' pipeline.

@KGZaker
Copy link

KGZaker commented Jan 2, 2022

Got the same issues, have any idea to solve this problem?

@dexon9109
Copy link

dexon9109 commented Jun 6, 2022

Got the same issues. The COOL file was compared by myself, and I deleted chrM before comparison. I think that's why ”KEY Error“ was reported.

How do I re-index?

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

3 participants