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
439 stars 181 forks source link

TypeError: '<=' not supported between instances of 'str' and 'float' #389

Closed MubasherMohammed closed 2 years ago

MubasherMohammed commented 2 years ago

hoping if someone have an answer for this error when using pyscenic ctx cli

pyscenic ctx grn_adj.csv $FEATHER --annotations_fname $ANNOS --expression_mtx_fname $LOOM_FILE --mode "dask_multiprocessing" --output $OUT --num_workers 20 -t

the process outcome `2022-04-28 14:33:45,563 - pyscenic.cli.pyscenic - INFO - Creating modules.

2022-04-28 14:33:45,572 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.

2022-04-28 14:33:46,101 - pyscenic.utils - INFO - Calculating Pearson correlations. Traceback (most recent call last): File "/home/mubasher/.conda/envs/pyscenic/bin/pyscenic", line 8, in sys.exit(main()) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 675, in main args.func(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 201, in prune_targets_command modules = adjacencies2modules(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 139, in adjacencies2modules keep_only_activating=(args.all_modules != "yes"), File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/utils.py", line 298, in modules_from_adjacencies ), f"Found {len(unique_adj_genes)} genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix?" AssertionError: Found 1313 genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix? (pyscenic) [mubasher@r21 scenic_data]$ pyscenic ctx grn_adj.csv $FEATHER --annotations_fname $ANNOS --expression_mtx_fname my_matrix.tsv --mode "dask_multiprocessing" --output $OUT --num_workers 20

2022-04-28 14:37:21,304 - pyscenic.cli.pyscenic - INFO - Creating modules.

2022-04-28 14:37:21,314 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.

2022-04-28 14:37:21,972 - pyscenic.utils - INFO - Calculating Pearson correlations. Traceback (most recent call last): File "/home/mubasher/.conda/envs/pyscenic/bin/pyscenic", line 8, in sys.exit(main()) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 675, in main args.func(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 201, in prune_targets_command modules = adjacencies2modules(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 139, in adjacencies2modules keep_only_activating=(args.all_modules != "yes"), File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/utils.py", line 298, in modules_from_adjacencies ), f"Found {len(unique_adj_genes)} genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix?" AssertionError: Found 1313 genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix? (pyscenic) [mubasher@r21 scenic_data]$ pyscenic ctx grn_adj.csv $FEATHER --annotations_fname $ANNOS --expression_mtx_fname my_matrix.tsv --mode "dask_multiprocessing" --output $OUT --num_workers 20 -t

2022-04-28 14:37:40,637 - pyscenic.cli.pyscenic - INFO - Creating modules.

2022-04-28 14:37:40,646 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.

2022-04-28 14:37:41,174 - pyscenic.utils - INFO - Calculating Pearson correlations. Traceback (most recent call last): File "/home/mubasher/.conda/envs/pyscenic/bin/pyscenic", line 8, in sys.exit(main()) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 675, in main args.func(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 201, in prune_targets_command modules = adjacencies2modules(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 139, in adjacencies2modules keep_only_activating=(args.all_modules != "yes"), File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/utils.py", line 298, in modules_from_adjacencies ), f"Found {len(unique_adj_genes)} genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix?" AssertionError: Found 1313 genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix? (pyscenic) [mubasher@r21 scenic_data]$ pyscenic ctx grn_adj.csv $FEATHER --annotations_fname $ANNOS --expression_mtx_fname $LOOM_FILE --mode "dask_multiprocessing" --output $OUT --num_workers 20 -t

2022-04-28 14:38:17,799 - pyscenic.cli.pyscenic - INFO - Creating modules.

2022-04-28 14:38:17,807 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.

2022-04-28 14:38:18,721 - pyscenic.utils - INFO - Calculating Pearson correlations.

2022-04-28 14:38:18,723 - pyscenic.utils - WARNING - Note on correlation calculation: the default behaviour for calculating the correlations has changed after pySCENIC verion 0.9.16. Previously, the default was to calculate the correlation between a TF and target gene using only cells with non-zero expression values (mask_dropouts=True). The current default is now to use all cells to match the behavior of the R verision of SCENIC. The original settings can be retained by setting 'rho_mask_dropouts=True' in the modules_from_adjacencies function, or '--mask_dropouts' from the CLI. Dropout masking is currently set to [False].

2022-04-28 14:38:19,136 - pyscenic.utils - INFO - Creating modules.

2022-04-28 14:38:21,964 - pyscenic.cli.pyscenic - INFO - Loading databases.

2022-04-28 14:38:21,964 - pyscenic.cli.pyscenic - INFO - Calculating regulons. /home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/prune.py:250: DtypeWarning: Columns (6,9) have mixed types.Specify dtype option on import or set low_memory=False. orthologous_identity_threshold=orthologuous_identity_threshold, Traceback (most recent call last): File "/home/mubasher/.conda/envs/pyscenic/bin/pyscenic", line 8, in sys.exit(main()) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 675, in main args.func(args) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/cli/pyscenic.py", line 230, in prune_targets_command num_workers=args.num_workers, File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/prune.py", line 410, in prune2df module_chunksize, File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/prune.py", line 250, in _distributed_calc orthologous_identity_threshold=orthologuous_identity_threshold, File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pyscenic/utils.py", line 59, in load_motif_annotations (df[COLUMN_NAME_MOTIF_SIMILARITY_QVALUE] <= motif_similarity_fdr) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pandas/core/ops/common.py", line 69, in new_method return method(self, other) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pandas/core/arraylike.py", line 44, in le return self._cmp_method(other, operator.le) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pandas/core/series.py", line 5502, in _cmp_method res_values = ops.comparison_op(lvalues, rvalues, op) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pandas/core/ops/array_ops.py", line 284, in comparison_op res_values = comp_method_OBJECT_ARRAY(op, lvalues, rvalues) File "/home/mubasher/.conda/envs/pyscenic/lib/python3.7/site-packages/pandas/core/ops/array_ops.py", line 73, in comp_method_OBJECT_ARRAY result = libops.scalar_compare(x.ravel(), y, op) File "pandas/_libs/ops.pyx", line 107, in pandas._libs.ops.scalar_compare TypeError: '<=' not supported between instances of 'str' and 'float'`

pyscenic env

Name Version Build Channel

_libgcc_mutex 0.1 conda_forge file:///sw/apps/conda/latest/rackham/local_repo/conda-forge _openmp_mutex 4.5 2_gnu file:///sw/apps/conda/latest/rackham/local_repo/conda-forge aiohttp 3.8.1 pypi_0 pypi aiosignal 1.2.0 pypi_0 pypi arboreto 0.1.6 pypi_0 pypi async-timeout 4.0.2 pypi_0 pypi asynctest 0.13.0 pypi_0 pypi attrs 21.4.0 pypi_0 pypi bokeh 2.4.2 pypi_0 pypi boltons 21.0.0 pypi_0 pypi ca-certificates 2022.3.29 h06a4308_1 anaconda cached-property 1.5.2 pypi_0 pypi certifi 2021.10.8 pypi_0 pypi charset-normalizer 2.0.12 pypi_0 pypi click 8.1.2 pypi_0 pypi cloudpickle 2.0.0 pypi_0 pypi ctxcore 0.1.1 pypi_0 pypi cytoolz 0.11.0 py37h7b6447c_0 anaconda dask 2022.2.0 pypi_0 pypi dill 0.3.4 pypi_0 pypi distributed 2022.2.0 pypi_0 pypi frozendict 2.3.2 pypi_0 pypi frozenlist 1.3.0 pypi_0 pypi fsspec 2022.3.0 pypi_0 pypi h5py 3.6.0 pypi_0 pypi heapdict 1.0.1 pypi_0 pypi idna 3.3 pypi_0 pypi importlib-metadata 4.11.3 pypi_0 pypi interlap 0.2.7 pypi_0 pypi jinja2 3.1.1 pypi_0 pypi joblib 1.1.0 pypi_0 pypi ld_impl_linux-64 2.36.1 hea4e1c9_2 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libblas 3.9.0 14_linux64_openblas file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libcblas 3.9.0 14_linux64_openblas file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libffi 3.4.2 h7f98852_5 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libgcc-ng 11.2.0 h1d223b6_16 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libgfortran-ng 11.2.0 h69a702a_16 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libgfortran5 11.2.0 h5c6108e_16 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libgomp 11.2.0 h1d223b6_16 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge liblapack 3.9.0 14_linux64_openblas file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libnsl 2.0.0 h7f98852_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libopenblas 0.3.20 pthreads_h78a6416_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libstdcxx-ng 11.2.0 he4da1e4_16 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge libzlib 1.2.11 h166bdaf_1014 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge llvmlite 0.38.0 pypi_0 pypi locket 1.0.0 pypi_0 pypi loompy 3.0.7 pypi_0 pypi markupsafe 2.1.1 pypi_0 pypi msgpack 1.0.3 pypi_0 pypi multidict 6.0.2 pypi_0 pypi multiprocessing-on-dill 3.5.0a4 pypi_0 pypi ncurses 6.3 h27087fc_1 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge networkx 2.6.3 pypi_0 pypi numba 0.55.1 pypi_0 pypi numpy 1.21.6 py37h976b520_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge numpy-groupies 0.9.14 pypi_0 pypi openssl 3.0.2 h166bdaf_1 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge packaging 21.3 pypi_0 pypi pandas 1.3.5 pypi_0 pypi partd 1.2.0 pypi_0 pypi pillow 9.1.0 pypi_0 pypi pip 22.0.4 pyhd8ed1ab_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge psutil 5.9.0 pypi_0 pypi pyarrow 0.16.0 pypi_0 pypi pynndescent 0.5.6 pypi_0 pypi pyparsing 3.0.8 pypi_0 pypi pyscenic 0.11.2 pypi_0 pypi python 3.7.12 hf930737_100_cpython conda-forge python-dateutil 2.8.2 pypi_0 pypi python_abi 3.7 2_cp37m file:///sw/apps/conda/latest/rackham/local_repo/conda-forge pytz 2022.1 pypi_0 pypi pyyaml 6.0 pypi_0 pypi readline 8.1 h46c0cb4_0 conda-forge requests 2.27.1 pypi_0 pypi scikit-learn 1.0.2 pypi_0 pypi scipy 1.7.3 pypi_0 pypi setuptools 62.1.0 py37h89c1867_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge six 1.16.0 pypi_0 pypi sortedcontainers 2.4.0 pypi_0 pypi sqlite 3.38.2 h4ff8645_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge tblib 1.7.0 pypi_0 pypi threadpoolctl 3.1.0 pypi_0 pypi tk 8.6.12 h27826a3_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge toolz 0.11.2 pyhd3eb1b0_0 anaconda tornado 6.1 pypi_0 pypi tqdm 4.64.0 pypi_0 pypi typing-extensions 4.2.0 pypi_0 pypi umap-learn 0.5.3 pypi_0 pypi urllib3 1.26.9 pypi_0 pypi wheel 0.37.1 pyhd8ed1ab_0 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge xz 5.2.5 h516909a_1 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge yarl 1.7.2 pypi_0 pypi zict 2.1.0 pypi_0 pypi zipp 3.8.0 pypi_0 pypi zlib 1.2.11 h166bdaf_1014 file:///sw/apps/conda/latest/rackham/local_repo/conda-forge

I haven't really able to get around this error thanks for help

cflerin commented 2 years ago

The primary problem is this:

AssertionError: Found 1313 genes present in the network (adjacencies) output, but missing from the expression matrix. Is this a different gene expression matrix?

You must use the same expression matrix for all steps here, and it seems that they were different between GRN and cisTarget steps.