icbi-lab / infercnvpy

Infer copy number variation (CNV) from scRNA-seq data. Plays nicely with Scanpy.

Home Page:https://infercnvpy.readthedocs.io/en/latest/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ValueError: need at least one array to concatenate

Bio-MingChen opened this issue · comments

I encountered an error show below when running cnv.tl.infercnv(), the h5ad file I used is also uploaded ,do you have any suggestions?

ecc7_add_gtf.zip

 0%|                                                                                                     | 0/1 [00:06<?, ?it/s]
---------------------------------------------------------------------------
_RemoteTraceback                          Traceback (most recent call last)
_RemoteTraceback: 
"""
Traceback (most recent call last):
  File "c:\users\lenovo\appdata\local\programs\python\python38\lib\concurrent\futures\process.py", line 239, in _process_worker
    r = call_item.fn(*call_item.args, **call_item.kwargs)
  File "c:\users\lenovo\appdata\local\programs\python\python38\lib\concurrent\futures\process.py", line 198, in _process_chunk
    return [fn(*args) for args in chunk]
  File "c:\users\lenovo\appdata\local\programs\python\python38\lib\concurrent\futures\process.py", line 198, in <listcomp>
    return [fn(*args) for args in chunk]
  File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\infercnvpy\tl\_infercnv.py", line 353, in _infercnv_chunk
    chr_pos, x_smoothed = _running_mean_by_chromosome(
  File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\infercnvpy\tl\_infercnv.py", line 273, in _running_mean_by_chromosome
    return chr_start_pos, np.hstack(running_means)
  File "<__array_function__ internals>", line 5, in hstack
  File "c:\users\lenovo\appdata\local\programs\python\python38\lib\site-packages\numpy\core\shape_base.py", line 346, in hstack
    return _nx.concatenate(arrs, 1)
  File "<__array_function__ internals>", line 5, in concatenate
ValueError: need at least one array to concatenate

The code I used is

ecc7 = sc.read('data/ecc7_add_gtf.h5ad')
sc.tl.pca(ecc7)
sc.pp.neighbors(ecc7)
sc.tl.louvain(ecc7)
cnv.tl.infercnv(ecc7,reference_key='louvain')

In fact,infercnv requires chromosome startswith 'chr' and range from chr1 to chr22 other sequences will be ignored, so, that's the point, what I need is to add chr to chromosome.
image