YeoLab / clipper

A tool to identify CLIP-seq peaks
Other
64 stars 41 forks source link

clipper crashes without --bonferonni flag #28

Open dmaticzka opened 9 years ago

dmaticzka commented 9 years ago

Hi,

clipper v 1.0 with all defaults crashes with "KeyError: 'padj'"

clipper -b ~/src/clipper/clipper/test/data/indexed_test.bam -s hg19 -v --debug

It seems column 'padj' is only ever created in bh_correct. Running with bonferoni correction enabled

clipper -b ~/src/clipper/clipper/test/data/indexed_test.bam -s hg19 -v --debug --bonferroni

works fine.

Best, Daniel

Traceback (most recent call last):
  File "/home/maticzkd/virtualenv_default/bin/clipper", line 9, in <module>
    load_entry_point('clipper==0.2.0', 'console_scripts', 'clipper')()
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 675, in call_main
    main(options)
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 612, in main
    options.min_width)
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 492, in filter_results
    final_result = peaks[peaks['padj'] < poisson_cutoff]
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/pandas/core/frame.py", line 1797, in __getitem__
    return self._getitem_column(key)
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/pandas/core/frame.py", line 1804, in _getitem_column
    return self._get_item_cache(key)
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/pandas/core/generic.py", line 1084, in _get_item_cache
    values = self._data.get(item)
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/pandas/core/internals.py", line 2851, in get
    loc = self.items.get_loc(item)
  File "/home/maticzkd/virtualenv_default/local/lib/python2.7/site-packages/pandas/core/index.py", line 1572, in get_loc
    return self._engine.get_loc(_values_from_object(key))
  File "pandas/index.pyx", line 134, in pandas.index.IndexEngine.get_loc (pandas/index.c:3824)
  File "pandas/index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas/index.c:3704)
  File "pandas/hashtable.pyx", line 686, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12280)
  File "pandas/hashtable.pyx", line 694, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12231)
KeyError: 'padj'
ShanSabri commented 8 years ago

I am running into the same error using the command below. The --bonferroni flag also solved this for me.

[ssabri@n2239 fastq]$ clipper -b ATC.trimmed.uniq.sort.bam -s mm9 --premRNA 
Traceback (most recent call last):
  File "/u/local/apps/python/2.7.3/bin/clipper", line 9, in <module>
    load_entry_point('clipper==0.2.0', 'console_scripts', 'clipper')()
  File "/u/home/s/ssabri/.local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 674, in call_main
    main(options)
  File "/u/home/s/ssabri/.local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 611, in main
    options.min_width)
  File "/u/home/s/ssabri/.local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 491, in filter_results
    final_result = peaks[peaks['padj'] < poisson_cutoff]
  File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 1992, in __getitem__
    return self._getitem_column(key)
  File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 1999, in _getitem_column
    return self._get_item_cache(key)
  File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/generic.py", line 1345, in _get_item_cache
    values = self._data.get(item)
  File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/internals.py", line 3225, in get
    loc = self.items.get_loc(item)
  File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/indexes/base.py", line 1878, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/index.pyx", line 137, in pandas.index.IndexEngine.get_loc (pandas/index.c:4027)
  File "pandas/index.pyx", line 157, in pandas.index.IndexEngine.get_loc (pandas/index.c:3891)
  File "pandas/hashtable.pyx", line 675, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12408)
  File "pandas/hashtable.pyx", line 683, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12359)
KeyError: 'pads'
gpratt commented 8 years ago

I just just make this default and take out the flag. Is there a situation where you wouldn't want to bonferoni correct your p-values?

Gabriel Pratt Bioinformatics Graduate Student, Yeo Lab University of California San Diego

On Wed, Aug 17, 2016 at 9:21 AM, Shan Sabri notifications@github.com wrote:

Have you found a solution to this? I am running into the same error using the command:

[ssabri@n2239 fastq]$ clipper -b ATC.trimmed.uniq.sort.bam -s mm9 --premRNA Traceback (most recent call last): File "/u/local/apps/python/2.7.3/bin/clipper", line 9, in load_entry_point('clipper==0.2.0', 'console_scripts', 'clipper')() File "/u/home/s/ssabri/.local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 674, in call_main main(options) File "/u/home/s/ssabri/.local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 611, in main options.min_width) File "/u/home/s/ssabri/.local/lib/python2.7/site-packages/clipper-0.2.0-py2.7-linux-x86_64.egg/clipper/src/peakfinder.py", line 491, in filter_results final_result = peaks[peaks['padj'] < poisson_cutoff] File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 1992, in getitem return self._getitem_column(key) File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/frame.py", line 1999, in _getitem_column return self._get_item_cache(key) File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/generic.py", line 1345, in _get_item_cache values = self._data.get(item) File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/core/internals.py", line 3225, in get loc = self.items.get_loc(item) File "/u/local/apps/python/2.7.3/lib/python2.7/site-packages/pandas/indexes/base.py", line 1878, in get_loc return self._engine.get_loc(self._maybe_cast_indexer(key)) File "pandas/index.pyx", line 137, in pandas.index.IndexEngine.get_loc (pandas/index.c:4027) File "pandas/index.pyx", line 157, in pandas.index.IndexEngine.get_loc (pandas/index.c:3891) File "pandas/hashtable.pyx", line 675, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12408) File "pandas/hashtable.pyx", line 683, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:12359) KeyError: 'pads'

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/YeoLab/clipper/issues/28#issuecomment-240465855, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNUWy2PHcTzV3UrC5NHPnqqS_VMjs7Lks5qgzUTgaJpZM4GOi3U .