Skip to content

ValueError: X needs to be 2-dimensional, not 1-dimensional. #113

@Jinloong-dream

Description

@Jinloong-dream

I used scTE to analyze raw data from public database. here is my code:

scTE \
        -i /home/zhaoyang/hjl/project/LiuGH/cellranger/Lung_scRNA_Young/outs/CB_clean.bam \
        -o Young \
        -x /home/zhaoyang/hjl/database/mm10.exclusive.idx \
        --hdf5 True \
        -CB CB \
        -UMI UB \
        -p 13

here is the log:

/home/zhaoyang/miniforge3/envs/scte/bin/scTE:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  __import__('pkg_resources').run_script('scTE==1.0', 'scTE')
DEBUG   : Creating converter from 7 to 5
DEBUG   : Creating converter from 5 to 7
DEBUG   : Creating converter from 7 to 5
DEBUG   : Creating converter from 5 to 7
DEBUG   : Registering codec 'zlib'
DEBUG   : Registering codec 'gzip'
DEBUG   : Registering codec 'bz2'
DEBUG   : Registering codec 'lzma'
DEBUG   : Registering codec 'blosc'
DEBUG   : Registering codec 'zstd'
DEBUG   : Registering codec 'lz4'
DEBUG   : Registering codec 'astype'
DEBUG   : Registering codec 'delta'
DEBUG   : Registering codec 'quantize'
DEBUG   : Registering codec 'fixedscaleoffset'
DEBUG   : Registering codec 'packbits'
DEBUG   : Registering codec 'categorize'
DEBUG   : Registering codec 'pickle'
DEBUG   : Registering codec 'base64'
DEBUG   : Registering codec 'shuffle'
DEBUG   : Registering codec 'bitround'
DEBUG   : Registering codec 'crc32'
DEBUG   : Registering codec 'adler32'
DEBUG   : Registering codec 'jenkins_lookup3'
DEBUG   : Registering codec 'json2'
DEBUG   : Registering codec 'vlen-utf8'
DEBUG   : Registering codec 'vlen-bytes'
DEBUG   : Registering codec 'vlen-array'
DEBUG   : Registering codec 'fletcher32'
DEBUG   : Registering codec 'crc32c'
INFO    : Parameter list:
Sample = Young
Reference annotation index = /home/zhaoyang/hjl/database/mm10.exclusive.idx
Minimum number of genes required = 200
Minimum number of counts required = None
Number of threads = 13

INFO    : Loading the genome annotation index... 2025-04-21 16:15:10
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Finished loading the genome annotation index... 2025-04-21 16:15:31

INFO    : Processing BAM/SAM files ...2025-04-21 16:15:31
INFO    : Input SAM/BAM file appears to be valid
INFO    : Done BAM/SAM files processing ...2025-04-21 16:52:22

INFO    : Splitting ...2025-04-21 16:52:22
INFO    : Executing multiple thread path with 13 threads
['1', '10', '11', '12', '13', '14', '15', '16', '17', '18', '19', '2', '3', '4', '5', '6', '7', '8', '9', 'M', 'X', 'Y']
CB UB good

INFO    : Reading Young.chr1.count.gz
INFO    : Reading Young.chr10.count.gz
INFO    : Reading Young.chr11.count.gz
INFO    : Reading Young.chr12.count.gz
INFO    : Reading Young.chr13.count.gz
INFO    : Reading Young.chr14.count.gz
INFO    : Reading Young.chr15.count.gz
INFO    : Reading Young.chr16.count.gz
INFO    : Reading Young.chr17.count.gz
INFO    : Reading Young.chr18.count.gz
INFO    : Reading Young.chr19.count.gz
INFO    : Reading Young.chr2.count.gz
INFO    : Reading Young.chr3.count.gz
INFO    : Reading Young.chr4.count.gz
INFO    : Reading Young.chr5.count.gz
INFO    : Reading Young.chr6.count.gz
INFO    : Reading Young.chr7.count.gz
INFO    : Reading Young.chr8.count.gz
INFO    : Reading Young.chr9.count.gz
INFO    : Reading Young.chrM.count.gz
INFO    : Reading Young.chrX.count.gz
INFO    : Reading Young.chrY.count.gz
INFO    : Before filter 0
INFO    : Aefore filter 0
INFO    : Finished processing sample files 2025-04-21 16:53:29

INFO    : Fetching from the annotation index... 2025-04-21 16:53:29
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Loaded '/home/zhaoyang/hjl/database/mm10.exclusive.idx' binary file with 3900779 items
INFO    : Done fetching... 2025-04-21 16:55:04

INFO    : Calculating expression... 2025-04-21 16:55:04
Traceback (most recent call last):
  File "/home/zhaoyang/miniforge3/envs/scte/bin/scTE", line 4, in <module>
    __import__('pkg_resources').run_script('scTE==1.0', 'scTE')
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/pkg_resources/__init__.py", line 752, in run_script
    self.require(requires)[0].run_script(script_name, ns)
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/pkg_resources/__init__.py", line 1739, in run_script
    exec(code, namespace, namespace)
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/scTE-1.0-py3.11.egg/EGG-INFO/scripts/scTE", line 173, in <module>
    main()
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/scTE-1.0-py3.11.egg/EGG-INFO/scripts/scTE", line 155, in main
    len_res, genenumber, filename = Countexpression(filename=args.out, allelement=allelement, genenumber=args.genenumber, cellnumber=args.cellnumber, hdf5=args.hdf5)
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/scTE-1.0-py3.11.egg/scTE/base.py", line 493, in Countexpression
    adata = ad.AnnData(np.asarray(data).astype(int),var = var,obs = obs)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/legacy_api_wrap-1.4.1-py3.11.egg/legacy_api_wrap/__init__.py", line 82, in fn_compatible
    return fn(*args_all, **kw)
           ^^^^^^^^^^^^^^^^^^^
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/anndata-0.12.0rc1-py3.11.egg/anndata/_core/anndata.py", line 241, in __init__
    self._init_as_actual(
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/anndata-0.12.0rc1-py3.11.egg/anndata/_core/anndata.py", line 390, in _init_as_actual
    _check_2d_shape(X)
  File "/home/zhaoyang/miniforge3/envs/scte/lib/python3.11/site-packages/anndata-0.12.0rc1-py3.11.egg/anndata/_core/anndata.py", line 2102, in _check_2d_shape
    raise ValueError(msg)
ValueError: X needs to be 2-dimensional, not 1-dimensional.

And I tried set --hdf5 to False, but the output .csv is 0 object of 56422 variables, in other words, it is empty.
Could you please give me some suggestion?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions