brentp / combined-pvalues

combining p-values using modified stouffer-liptak for spatially correlated results (probes)
MIT License
43 stars 22 forks source link

IndexError: list index out of range #28

Closed paujedynak closed 4 years ago

paujedynak commented 4 years ago

Traceback (most recent call last): File "/home/user/.local/bin/comb-p", line 4, in import('pkg_resources').run_script('cpv==0.50.3', 'comb-p') File "/home/user/miniconda3/envs/DMR/lib/python3.8/site-packages/pkg_resources/init.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/user/miniconda3/envs/DMR/lib/python3.8/site-packages/pkg_resources/init.py", line 1464, in run_script exec(code, namespace, namespace) File "/home/user/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/EGG-INFO/scripts/comb-p", line 39, in main() File "/home/user/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/EGG-INFO/scripts/comb-p", line 36, in main module.main() File "/home/user/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/pipeline.py", line 69, in main return pipeline(col_num, args.step, File "/home/user/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/pipeline.py", line 167, in pipeline for region_line, slk_p, slk_sidak_p, sim_p in region_p.region_p( File "/home/user/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/region_p.py", line 175, in region_p acfs = _gen_acf(region_info, (fpvals,), col_num, step) File "/home/user/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/region_p.py", line 76, in _gen_acf if lags[-1] < max_len: lags.append(lags[-1] + step) IndexError: list index out of range

This happens only with some BED files but not with all. Thank you for any help to solve it!

brentp commented 4 years ago

i will need the full output to stderr along with the command that you ran in order to help you.

paujedynak commented 4 years ago

Sure, here it goes: Command: comb-p pipeline -c 4 --seed 0.001 --dist 500 -p test --region-filter-p 0.05 --region-filter-n 2 test.bed

Output: setting --acf-dist to 0.33 * --dist == 170 calculated stepsize as: 170 ACF: lag_min lag_max correlation N p 1 171 0.1043 284258 0 wrote: test.acf.txt

original lambda: 0.96 wrote: test.slk.bed.gz with lambda: 0.87 wrote: test.fdr.bed.gz wrote: test.regions.bed.gz (1 regions) read 1 regions from test.regions.bed.gz calculating ACF out to: 1

Error: Traceback (most recent call last): File "/home/.local/bin/comb-p", line 4, in import('pkg_resources').run_script('cpv==0.50.3', 'comb-p') File "/home/miniconda3/envs/DMR/lib/python3.8/site-packages/pkg_resources/init.py", line 667, in run_script self.require(requires)[0].run_script(script_name, ns) File "/home/miniconda3/envs/DMR/lib/python3.8/site-packages/pkg_resources/init.py", line 1464, in run_script exec(code, namespace, namespace) File "/home/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/EGG-INFO/scripts/comb-p", line 39, in main() File "/home/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/EGG-INFO/scripts/comb-p", line 36, in main module.main() File "/home/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/pipeline.py", line 69, in main return pipeline(col_num, args.step, File "/home/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/pipeline.py", line 167, in pipeline for region_line, slk_p, slk_sidak_p, sim_p in region_p.region_p( File "/home/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/region_p.py", line 175, in region_p acfs = _gen_acf(region_info, (fpvals,), col_num, step) File "/home/.local/lib/python3.8/site-packages/cpv-0.50.3-py3.8.egg/cpv/region_p.py", line 76, in _gen_acf if lags[-1] < max_len: lags.append(lags[-1] + step) IndexError: list index out of range

test.bed file can be found here: https://tinyurl.com/yc642qa4

brentp commented 4 years ago

Hi, I pushed a fix for this. Thanks for providing the command and the data.