aertslab / pySCENIC

pySCENIC is a lightning-fast python implementation of the SCENIC pipeline (Single-Cell rEgulatory Network Inference and Clustering) which enables biologists to infer transcription factors, gene regulatory networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
440 stars 182 forks source link

[BUG]pyscenic version conflict when using feather v2 vs v1 #590

Open Chun-Hao025 opened 1 week ago

Chun-Hao025 commented 1 week ago

Describe the bug

If I following the install procedure through conda create -n scenic_protocol python=3.6, I can only install pyscenic=0.11.2. Under python 3.6, I could not upgrade ctxcore to 2.0.0 and pyarrow >= 8.0.0. Then, I could not use the feather file v2. It would lead to the following error when try the following error.

pyscenic ctx adj.csv mm10_10kbp_up_10kbp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather mm10_500bp_up_100bp_down_full_tx_v10_clust.genes_vs_motifs.rankings.feather --annotations_fname motifs-v10nr_
clust-nr.mgi-m0.001-o0.0.tbl --output reg.csv --mask_dropouts --num_workers 10 --mode dask_multiprocessing --chunk_size 100
/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/numba/np/ufunc/parallel.py:365: NumbaWarning: The TBB threading layer requires TBB version 2019.5 or later i.e., TBB_INTERFACE_VERSION >= 11005. Found TBB_INTERFACE_VERSION = 10002. The TBB threading layer is disabled.
  warnings.warn(problem)
Traceback (most recent call last):
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/bin/pyscenic", line 8, in <module>
    sys.exit(main())
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 675, in main
    args.func(args)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 230, in prune_targets_command
    num_workers=args.num_workers,
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/prune.py", line 410, in prune2df
    module_chunksize,
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/prune.py", line 334, in _distributed_calc
    scheduler='processes', num_workers=num_workers if num_workers else cpu_count()
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/base.py", line 283, in compute
    (result,) = compute(self, traverse=False, **kwargs)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/base.py", line 565, in compute
    results = schedule(dsk, keys, **kwargs)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/multiprocessing.py", line 230, in get
    **kwargs
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/local.py", line 487, in get_async
    raise_exception(exc, tb)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/local.py", line 316, in reraise
    raise exc.with_traceback(tb)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/local.py", line 222, in execute_task
    result = _execute_task(task, data)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/core.py", line 121, in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/core.py", line 121, in <genexpr>
    return func(*(_execute_task(a, cache) for a in args))
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/dask/core.py", line 121, in _execute_task
    return func(*(_execute_task(a, cache) for a in args))
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/transform.py", line 301, in modules2df
    [module2df(db, module, motif_annotations, weighted_recovery, False, module2features_func) for module in modules]
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/transform.py", line 301, in <listcomp>
    [module2df(db, module, motif_annotations, weighted_recovery, False, module2features_func) for module in modules]
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/transform.py", line 231, in module2df
    db, module, motif_annotations, weighted_recovery=weighted_recovery
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyscenic/transform.py", line 152, in module2features_auc1st_impl
    df = db.load(module)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/ctxcore/rnkdb.py", line 318, in load
    gene_set = self.geneset.intersection(set(gs.genes))
  File "cytoolz/functoolz.pyx", line 476, in cytoolz.functoolz._memoize.__call__
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/ctxcore/rnkdb.py", line 98, in geneset
    return set(self.genes)
  File "cytoolz/functoolz.pyx", line 476, in cytoolz.functoolz._memoize.__call__
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/ctxcore/rnkdb.py", line 296, in genes
    reader = FeatherReader(self._fname)
  File "/home/chun-hao.chao-umw/.conda/envs/scenic_protocol/lib/python3.6/site-packages/pyarrow/feather.py", line 40, in __init__
    self.open(source)
  File "pyarrow/feather.pxi", line 83, in pyarrow.lib.FeatherReader.open
  File "pyarrow/error.pxi", line 84, in pyarrow.lib.check_status
pyarrow.lib.ArrowInvalid: Not a feather file

Please complete the following information:


However, I realize the feather file contain version 1 and version 2. Only if I tried to create conda environment python >=3.7. I can install newer version of pyscenic =0.12.1 and also ctxcore=2.0.0 and pyarrow= 17.0.0. I expected to be work on feather v2.

I just tried pyscenic -h. I repeatedly encounter the same error in following.

Traceback (most recent call last):
  File "/home/chun-hao.chao-umw/.conda/envs/py39/bin/pyscenic", line 5, in <module>
    from pyscenic.cli.pyscenic import main
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/pyscenic/cli/pyscenic.py", line 19, in <module>
    from arboreto.algo import genie3, grnboost2
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/arboreto/algo.py", line 7, in <module>
    from arboreto.core import create_graph, SGBM_KWARGS, RF_KWARGS, EARLY_STOP_WINDOW_LENGTH
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/arboreto/core.py", line 10, in <module>
    from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor, ExtraTreesRegressor
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/__init__.py", line 87, in <module>
    from .base import clone
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/base.py", line 19, in <module>
    from .utils import _IS_32BIT
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/utils/__init__.py", line 22, in <module>
    from ._estimator_html_repr import estimator_html_repr
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/utils/_estimator_html_repr.py", line 10, in <module>
    from .fixes import parse_version
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/utils/fixes.py", line 17, in <module>
    import scipy.stats
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/stats/__init__.py", line 608, in <module>
    from ._stats_py import *
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/stats/_stats_py.py", line 39, in <module>
    from scipy.spatial.distance import cdist
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/spatial/__init__.py", line 110, in <module>
    from ._kdtree import *
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/spatial/_kdtree.py", line 4, in <module>
    from ._ckdtree import cKDTree, cKDTreeNode
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/spatial/_ckdtree.cpython-39-x86_64-linux-gnu.so)
Traceback (most recent call last):
  File "/home/chun-hao.chao-umw/.conda/envs/py39/bin/pyscenic", line 5, in <module>
    from pyscenic.cli.pyscenic import main
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/pyscenic/cli/pyscenic.py", line 19, in <module>
    from arboreto.algo import genie3, grnboost2
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/arboreto/algo.py", line 7, in <module>
    from arboreto.core import create_graph, SGBM_KWARGS, RF_KWARGS, EARLY_STOP_WINDOW_LENGTH
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/arboreto/core.py", line 10, in <module>
    from sklearn.ensemble import GradientBoostingRegressor, RandomForestRegressor, ExtraTreesRegressor
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/__init__.py", line 87, in <module>
    from .base import clone
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/base.py", line 19, in <module>
    from .utils import _IS_32BIT
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/utils/__init__.py", line 22, in <module>
    from ._estimator_html_repr import estimator_html_repr
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/utils/_estimator_html_repr.py", line 10, in <module>
    from .fixes import parse_version
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/sklearn/utils/fixes.py", line 17, in <module>
    import scipy.stats
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/stats/__init__.py", line 608, in <module>
    from ._stats_py import *
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/stats/_stats_py.py", line 39, in <module>
    from scipy.spatial.distance import cdist
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/spatial/__init__.py", line 110, in <module>
    from ._kdtree import *
  File "/home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/spatial/_kdtree.py", line 4, in <module>
    from ._ckdtree import cKDTree, cKDTreeNode
ImportError: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.29' not found (required by /home/chun-hao.chao-umw/.conda/envs/py39/lib/python3.9/site-packages/scipy/spatial/_ckdtree.cpython-39-x86_64-linux-gnu.so)

I guess it still the version conflict issue. I tried to reinstall through conda install -c conda-forge libstdcxx-ng. It is still the same.

Please complete the following information:

What would be the ideal version to install on pyscenic? Or I just use feather file version1 to fix the problem.

ghuls commented 5 days ago

Use a non-deprecated version of python: https://devguide.python.org/versions/