Closed sroener closed 2 years ago
Hi, @sroener The error (IndexError: cannot do a non-empty take from an empty axes) may caused by the empty line in some file. Can you provide me with the output files of bamCounter and runCounter, therefore I can reproduce your problem.
Thanks for using cfDNApipe!
Wei
My e-mail: w-zhang16@mails.tsinghua.edu.cn
Hi, @sroener @Honchkrow
This problem may cause by the gcCounter
and readCounter
bin file in hmmcopy_utils
package.
Recently, I conducted the experiment and the first time i ran cfDNApipe it caused an error at gcCounter
in runCounter()
function.
Now, running command: gcCounter -w 5000000 /home/cyyan/Projects/cfDNA/cfDNApipe/experiments/refs/hg19.fa > /home/cyyan/Projects/cfDNA/cfDNApipe/experiments/outs/intermediate_result/step_FP02_runCounter/hg19.gc.wig
/bin/sh: 1: gcCounter: not found
Traceback (most recent call last):
File "/home/cyyan/Projects/cfDNA/cfDNApipe/experiments/exp1_WGS_PE.py", line 32, in <module>
report=True,
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/Pipeline.py", line 221, in cfDNAWGS
fp_gcCounter = runCounter(filetype=0, binlen=5000000, upstream=True, verbose=verbose, stepNum="FP02")
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/Fun_counter.py", line 158, in __init__
self.run(all_cmd)
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/StepBase.py", line 474, in run
raise commonError("**********CMD running error**********")
cfDNApipe.cfDNA_utils.commonError: **********CMD running error**********
But the error disappeared when i restarted the program. It showed as :
************************************************************
fpCounter has been completed!
************************************************************
Now, processing case1_short ...
Traceback (most recent call last):
File "/home/cyyan/Projects/cfDNA/cfDNApipe/experiments/exp1_WGS_PE.py", line 32, in <module>
report=True,
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/Pipeline.py", line 228, in cfDNAWGS
stepNum="FP03",
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/Fun_GCcorrect.py", line 161, in __init__
self.getParam("readtype"),
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/cfDNA_utils.py", line 888, in correctReadCount
correct_reads, correct_reads2, valid = GC_correct(reads, gc, plotOutput, corrkey, sampleMaxSize)
File "/home/cyyan/Projects/cfDNA/cfDNApipe/cfDNApipe/cfDNA_utils.py", line 914, in GC_correct
lrange = np.percentile(np.array([readInput[i] for i in range(readl) if valid[i]]), 0)
File "<__array_function__ internals>", line 6, in percentile
File "/home/cyyan/anaconda3/envs/cfdnapipe/lib/python3.6/site-packages/numpy/lib/function_base.py", line 3733, in percentile
a, q, axis, out, overwrite_input, interpolation, keepdims)
File "/home/cyyan/anaconda3/envs/cfdnapipe/lib/python3.6/site-packages/numpy/lib/function_base.py", line 3853, in _quantile_unchecked
interpolation=interpolation)
File "/home/cyyan/anaconda3/envs/cfdnapipe/lib/python3.6/site-packages/numpy/lib/function_base.py", line 3429, in _ureduce
r = func(a, **kwargs)
File "/home/cyyan/anaconda3/envs/cfdnapipe/lib/python3.6/site-packages/numpy/lib/function_base.py", line 3967, in _quantile_ureduce_func
x1 = take(ap, indices_below, axis=axis) * weights_below
File "<__array_function__ internals>", line 6, in take
File "/home/cyyan/anaconda3/envs/cfdnapipe/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 191, in take
return _wrapfunc(a, 'take', indices, axis=axis, out=out, mode=mode)
File "/home/cyyan/anaconda3/envs/cfdnapipe/lib/python3.6/site-packages/numpy/core/fromnumeric.py", line 58, in _wrapfunc
return bound(*args, **kwds)
IndexError: cannot do a non-empty take from an empty axes.
And then another error appeared, showed as yours:
IndexError: cannot do a non-empty take from an empty axes.
But I knew, the error at gcCounter
in runCounter()
function remained unsolved.
So I checked the generated intermediate files in outs/intermediate_result/step_FP02_runCounter
, actually, hg19.gc.wig
is empty (only had the value 1). I remembered that there is a breakpoint detection mechanism and it may caused false passing.
And i deleted that folder step_FP02_runCounter
, rm -r step_FP0*.
The error at gcCounter
appeared again.
So, the problem is on the runCounter()
function where there was no gcCounter
and readCounter
executable file for cmd running.
I solved it by building the hmmcopy_utils
from https://github.com/shahcompbio/hmmcopy_utils and adding the built bin/
folder location to ~/.bashrc
on OS ubuntu20.04.
Good luck!
Hi, @gatsby2016
thanks for your help.
I reproduced the problem. It semms that hmmcopy_utils installed by conda is broken sometimes. I reinstalled hmmcopy_utils and the problem disappear. I have tried another version of hmmcopy_utils and will release a new environment file recently.
thank you again!
Hi,
I'm trying to use your implementation of GC correction. Unfortunately, the pipeline throws an error. The example from documentation was used as reference.
Code
Error
additional information
case_bamCounter
andcase_gcCounter
are created and look reasonable.Reference file ./data/hg19/./data/hg19/hg19.fa.fai do not exist!
-> wrong path was printed, but .fai file was created in the expected place