pySCENIC icon indicating copy to clipboard operation
pySCENIC copied to clipboard

TypeError("Must supply at least one delayed object")

Open lpalvin opened this issue 1 year ago • 4 comments

I used pmbc to test pyscenic, but I had this problem while running the grn step, however I followed the given steps exactly and I am sure my file is fine.

pyscenic grn --num_worker 4 --sparse --method grnboost2 -o sce.adj.csv sample.loom hs_hgnc_tfs.txt

2024-06-16 15:15:59,718 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.

2024-06-16 15:16:00,293 - pyscenic.cli.pyscenic - INFO - Inferring regulatory networks.
/home/E/user/lib/python3.9/site-packages/distributed/node.py:182: UserWarning: Port 8787 is already in use.
Perhaps you already have a cluster running?
Hosting the HTTP server on port 46677 instead
  warnings.warn(
Numba: Attempted to fork from a non-main thread, the TBB library may be in an invalid state in the child process.
Numba: Attempted to fork from a non-main thread, the TBB library may be in an invalid state in the child process.
Numba: Attempted to fork from a non-main thread, the TBB library may be in an invalid state in the child process.
Numba: Attempted to fork from a non-main thread, the TBB library may be in an invalid state in the child process.
Numba: Attempted to fork from a non-main thread, the TBB library may be in an invalid state in the child process.
Numba: Attempted to fork from a non-main thread, the TBB library may be in an invalid state in the child process.
preparing dask client
parsing input
creating dask graph
not shutting down client, client was created externally
finished
Traceback (most recent call last):
  File "/home/E/user/bin/pyscenic", line 8, in <module>
    sys.exit(main())
  File "/home/E/user/lib/python3.9/site-packages/pyscenic/cli/pyscenic.py", line 713, in main
    args.func(args)
  File "/home/E/user/lib/python3.9/site-packages/pyscenic/cli/pyscenic.py", line 97, in find_adjacencies_command
    network = method(
  File "/home/E/user/lib/python3.9/site-packages/arboreto/algo.py", line 39, in grnboost2
    return diy(expression_data=expression_data, regressor_type='GBM', regressor_kwargs=SGBM_KWARGS,
  File "/home/E/user/lib/python3.9/site-packages/arboreto/algo.py", line 120, in diy
    graph = create_graph(expression_matrix,
  File "/home/E/user/lib/python3.9/site-packages/arboreto/core.py", line 450, in create_graph
    all_meta_df = from_delayed(delayed_meta_dfs, meta=_META_SCHEMA)
  File "/home/E/user/lib/python3.9/site-packages/dask_expr/io/_delayed.py", line 101, in from_delayed
    raise TypeError("Must supply at least one delayed object")
TypeError: Must supply at least one delayed object

lpalvin avatar Jun 16 '24 07:06 lpalvin

Can you try?

arboreto_with_multiprocessing.py --num_worker 4 --sparse --method grnboost2 -o sce.adj.csv sample.loom hs_hgnc_tfs.txt

ghuls avatar Jun 28 '24 12:06 ghuls

Can you try?

arboreto_with_multiprocessing.py --num_worker 4 --sparse --method grnboost2 -o sce.adj.csv sample.loom hs_hgnc_tfs.txt

I tried this command and it seems ok.

affinis avatar Aug 03 '24 10:08 affinis

I met same bug.

affinis avatar Aug 03 '24 10:08 affinis

I had the same error as well

junyitao5462 avatar Sep 04 '24 15:09 junyitao5462

The problem with [TypeError: Must supply at least one delayed object should be fixed if you install via bioconda, as I just pinned the respective dask-expr<1.0.0 version in the arboreto package. So this should now install a working version of pyscenic:

conda create -n pyscenic -c conda-forge -b bioconda pyscenic

The original suggestion for this pinning comes from a comment in one of the issues here.

dlaehnemann avatar Nov 18 '25 13:11 dlaehnemann