aertslab / scenicplus

SCENIC+ is a python package to build gene regulatory networks (GRNs) using combined or separate single-cell gene expression (scRNA-seq) and single-cell chromatin accessibility (scATAC-seq) data.
Other
186 stars 29 forks source link

TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object #446

Closed kangjiajinlong closed 2 months ago

kangjiajinlong commented 3 months ago

Dear SCENIC+ team,

I am using SCENIC+ and running the tutorial in this link (https://scenicplus.readthedocs.io/en/latest/tutorials.html). I used the example data provided in the tutorial. However, the SCENIC+ snakemake pipeline crashed in region_to_gene step. Below is the error code:

[Thu Aug  8 15:00:42 2024]
localrule region_to_gene:
    input: /home/jkang5/scenicplus_example/outs/ACC_GEX.h5mu, /home/jkang5/scenicplus_example/outs/search_space.tsv
    output: /home/jkang5/scenicplus_example/outs/region_to_gene_adj.tsv
    jobid: 10
    reason: Missing output files: /home/jkang5/scenicplus_example/outs/region_to_gene_adj.tsv; Input files updated by another job: /home/jkang5/scenicplus_example/outs/search_space.tsv
    resources: tmpdir=/tmp

2024-08-08 15:00:48,679 SCENIC+      INFO     Reading multiome MuData.
/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/anndata/_core/anndata.py:522: FutureWarning: The dtype argument is deprecated and will be removed in late 2024.
  warnings.warn(
/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/anndata/_core/anndata.py:522: FutureWarning: The dtype argument is deprecated and will be removed in late 2024.
  warnings.warn(
2024-08-08 15:00:53,564 SCENIC+      INFO     Reading search space
2024-08-08 15:00:54,398 R2G          INFO     Calculating region to gene importances, using GBM method
Running using 1 cores:   0%|                                                                                                                         | 0/18565 [00:00<?, ?it/s]Traceback (most recent call last):
  File "/home/jkang5/venvs/scenicplus/bin/scenicplus", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/scenicplus.py", line 1137, in main
    args.func(args)
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/scenicplus.py", line 330, in TF_to_gene
    infer_region_to_gene(
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/scenicplus/cli/commands.py", line 739, in infer_region_to_gene
    adj = calculate_regions_to_genes_relationships(
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/scenicplus/enhancer_to_gene.py", line 261, in calculate_regions_to_genes_relationships
    region_to_gene_importances = _score_regions_to_genes(
                                 ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/scenicplus/enhancer_to_gene.py", line 219, in _score_regions_to_genes
    joblib.Parallel(
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/joblib/parallel.py", line 1863, in __call__
    return output if self.return_generator else list(output)
                                                ^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/joblib/parallel.py", line 1792, in _get_sequential_output
    res = func(*args, **kwargs)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/scenicplus/enhancer_to_gene.py", line 140, in _score_regions_to_single_gene
    from arboreto import core as arboreto_core
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/arboreto/core.py", line 12, in <module>
    from dask.dataframe import from_delayed
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/__init__.py", line 100, in <module>
    from dask.dataframe import backends, dispatch, rolling
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/backends.py", line 15, in <module>
    from dask.dataframe.core import DataFrame, Index, Scalar, Series, _Frame
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/core.py", line 36, in <module>
    from dask.dataframe import methods
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/methods.py", line 34, in <module>
    from dask.dataframe.utils import is_dataframe_like, is_index_like, is_series_like
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/utils.py", line 20, in <module>
    from dask.dataframe import (  # noqa: F401 register pandas extension types
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/_dtypes.py", line 9, in <module>
    from dask.dataframe.extensions import make_array_nonempty, make_scalar
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/extensions.py", line 8, in <module>
    from dask.dataframe.accessor import (
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 126, in <module>
    class DatetimeAccessor(Accessor):
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 81, in __init_subclass__
    _bind_property(cls, pd_cls, attr, min_version)
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/dataframe/accessor.py", line 35, in _bind_property
    setattr(cls, attr, property(derived_from(pd_cls, version=min_version)(func)))
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/utils.py", line 987, in wrapper
    method.__doc__ = _derived_from(
                     ^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/utils.py", line 940, in _derived_from
    method_args = get_named_args(method)
                  ^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/site-packages/dask/utils.py", line 701, in get_named_args
    s = inspect.signature(func)
        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/inspect.py", line 3263, in signature
    return Signature.from_callable(obj, follow_wrapped=follow_wrapped,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/inspect.py", line 3011, in from_callable
    return _signature_from_callable(obj, sigcls=cls,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/inspect.py", line 2599, in _signature_from_callable
    call = _descriptor_get(call, obj)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/rsrch5/home/sct-rsch/jkang5/venvs/scenicplus/lib/python3.11/inspect.py", line 2432, in _descriptor_get
    return get(descriptor, obj, type(obj))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: descriptor '__call__' for 'type' objects doesn't apply to a 'property' object
Running using 1 cores:   0%|                                                                                                                         | 0/18565 [00:00<?, ?it/s]
[Thu Aug  8 15:01:01 2024]
Error in rule region_to_gene:
    jobid: 10
    input: /home/jkang5/scenicplus_example/outs/ACC_GEX.h5mu, /home/jkang5/scenicplus_example/outs/search_space.tsv
    output: /home/jkang5/scenicplus_example/outs/region_to_gene_adj.tsv
    shell:

        scenicplus grn_inference region_to_gene             --multiome_mudata_fname /home/jkang5/scenicplus_example/outs/ACC_GEX.h5mu             --search_space_fname /home/jkang5/scenicplus_example/outs/search_space.tsv             --temp_dir /home/jkang5/scenicplus_example/temp             --out_region_to_gene_adjacencies /home/jkang5/scenicplus_example/outs/region_to_gene_adj.tsv             --importance_scoring_method GBM             --correlation_scoring_method SR             --n_cpu 1

        (one of the commands exited with non-zero exit code; note that snakemake uses bash strict mode!)

Shutting down, this might take some time.
Exiting because a job execution failed. Look above for error message
Complete log: .snakemake/log/2024-08-08T142448.128866.snakemake.log
WorkflowError:
At least one job did not complete successfully.

I believe I correctly installed scenicplus in a condo environment. The output of scenicplus.version is "1.0a1". I am new to SCENIC+ and unable to resolve this issue myself. Could you kindly assist? Thank you.

Jack

SeppeDeWinter commented 3 months ago

Hi @kangjiajinlong

What version of python are you using?

Might be similar to this issue: https://github.com/pycaret/pycaret/issues/3960

In case you are using python v3.11.9, could you try downgrading to v3.11.8?

All the best,

Seppe

kangjiajinlong commented 2 months ago

Thanks. Downgrading the python version to v3.11.8 resolved the issue.

SeppeDeWinter commented 2 months ago

Great!

Good to know.

All the best,

Seppe