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
425 stars 179 forks source link

[BUG]not shutting down client, client was created externally #522

Open asmlgkj opened 9 months ago

asmlgkj commented 9 months ago

Thanks a lot urget help needed

Describe the bug A clear and concise description of what the bug is.

Mote that most errors are due to the input from the user, and therefore should be treated as questions in the Discussions. Please, only report them as bugs if you are quite certain that they are not behaving as expected.

Steps to reproduce the behavior

  1. Command run when the error occurred:
    
    # R command
    library(Seurat)
    library(SeuratData) 
    getOption('timeout')
    options(timeout=10000)
    #InstallData("pbmc3k")  
    data("pbmc3k")  
    sce <- pbmc3k.final   
    library(Seurat)
    table(Idents(sce))
    p1=DimPlot(sce,label = T) 

write.csv(t(as.matrix(sce@assays$RNA@counts)), file = "pbmc_3k.all.csv")

python command

import os import loompy as lp import numpy as np import scanpy as sc

x=sc.read_csv("pbmc_3k.all.csv") row_attrs = {"Gene": np.array(x.var_names),} col_attrs = {"CellID": np.array(x.obs_names)} lp.create("pbmc_3k.loom", x.X.transpose(), row_attrs, col_attrs)

shell command

dir = '/home/lebrown/ tfs=$dir/hs_hgnc_tfs.txt feather=$dir/hg38refseq-r8010kb_up_and_down_tss.mc9nr.genes_vs_motifs.rankings.feather tbl=$dir/motifs-v9-nr.hgnc-m0.001-o0.0.tbl

一定要保证上面的数据库文件完整无误哦

input_loom='pbmc_3k.loom' ls $tfs $feather $tbl $input_loom

2.1 grn

pyscenic grn \ --num_workers 4 \ --output adj.sample.tsv \ --method grnboost2 \ $input_loom \ $tfs


2. Error encountered:
<!-- Please specify the **complete** error message (if applicable, otherwise delete this block): -->

2023-12-17 17:33:27,732 - pyscenic.cli.pyscenic - INFO - Inferring regulatory networks. /home/lebrown/software/miniconda38/envs/py311/lib/python3.11/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 36777 instead warnings.warn(

site-packages/loompy/bus_file.py:101: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details. @jit preparing dask client parsing input not shutting down client, client was created externally finished Traceback (most recent call last): File "/home/lebrown/software/miniconda38/envs/py311/bin/pyscenic", line 8, in sys.exit(main()) ^^^^^^ File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 713, in main args.func(args) File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 106, in find_adjacencies_command network = method( ^^^^^^^ File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 39, in grnboost2 return diy(expression_data=expression_data, regressor_type='GBM', regressor_kwargs=SGBM_KWARGS, ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 115, in diy expression_matrix, gene_names, tf_names = _prepare_input(expression_data, gene_names, tf_names) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 229, in _prepare_input raise ValueError('Intersection of gene_names and tf_names is empty.') ValueError: Intersection of gene_names and tf_names is empty.

amingson commented 5 months ago

Thanks a lot urget help needed

Describe the bug A clear and concise description of what the bug is.

Mote that most errors are due to the input from the user, and therefore should be treated as questions in the Discussions. Please, only report them as bugs if you are quite certain that they are not behaving as expected.

Steps to reproduce the behavior

  1. Command run when the error occurred:
# R command
library(Seurat)
library(SeuratData) 
getOption('timeout')
options(timeout=10000)
#InstallData("pbmc3k")  
data("pbmc3k")  
sce <- pbmc3k.final   
library(Seurat)
table(Idents(sce))
p1=DimPlot(sce,label = T) 

write.csv(t(as.matrix(sce@assays$RNA@counts)), file = "pbmc_3k.all.csv")
# python command
import os
import loompy as lp
import numpy as np
import scanpy as sc

x=sc.read_csv("pbmc_3k.all.csv")
row_attrs = {"Gene": np.array(x.var_names),}
col_attrs = {"CellID": np.array(x.obs_names)}
lp.create("pbmc_3k.loom", x.X.transpose(), row_attrs, col_attrs)

# shell command
dir = '/home/lebrown/
tfs=$dir/hs_hgnc_tfs.txt
feather=$dir/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.genes_vs_motifs.rankings.feather
tbl=$dir/motifs-v9-nr.hgnc-m0.001-o0.0.tbl 
# 一定要保证上面的数据库文件完整无误哦 
input_loom='pbmc_3k.loom'
ls $tfs  $feather  $tbl  $input_loom

#2.1 grn
pyscenic grn \
--num_workers 4 \
--output adj.sample.tsv \
--method grnboost2 \
$input_loom \
$tfs 
  1. Error encountered:
2023-12-17 17:33:27,732 - pyscenic.cli.pyscenic - INFO - Inferring regulatory networks.
/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/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 36777 instead
  warnings.warn(

site-packages/loompy/bus_file.py:101: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @jit
preparing dask client
parsing input
not shutting down client, client was created externally
finished
Traceback (most recent call last):
  File "/home/lebrown/software/miniconda38/envs/py311/bin/pyscenic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 713, in main
    args.func(args)
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 106, in find_adjacencies_command
    network = method(
              ^^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 39, in grnboost2
    return diy(expression_data=expression_data, regressor_type='GBM', regressor_kwargs=SGBM_KWARGS,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 115, in diy
    expression_matrix, gene_names, tf_names = _prepare_input(expression_data, gene_names, tf_names)
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 229, in _prepare_input
    raise ValueError('Intersection of gene_names and tf_names is empty.')
ValueError: Intersection of gene_names and tf_names is empty.

You could do this : conda list |grep distributed pip uninstall distributed pip install distributed==2023.12.1

Best,

Anler

jesusch10 commented 3 months ago

Thanks a lot urget help needed Describe the bug A clear and concise description of what the bug is.

Mote that most errors are due to the input from the user, and therefore should be treated as questions in the Discussions. Please, only report them as bugs if you are quite certain that they are not behaving as expected.

Steps to reproduce the behavior

  1. Command run when the error occurred:
# R command
library(Seurat)
library(SeuratData) 
getOption('timeout')
options(timeout=10000)
#InstallData("pbmc3k")  
data("pbmc3k")  
sce <- pbmc3k.final   
library(Seurat)
table(Idents(sce))
p1=DimPlot(sce,label = T) 

write.csv(t(as.matrix(sce@assays$RNA@counts)), file = "pbmc_3k.all.csv")
# python command
import os
import loompy as lp
import numpy as np
import scanpy as sc

x=sc.read_csv("pbmc_3k.all.csv")
row_attrs = {"Gene": np.array(x.var_names),}
col_attrs = {"CellID": np.array(x.obs_names)}
lp.create("pbmc_3k.loom", x.X.transpose(), row_attrs, col_attrs)

# shell command
dir = '/home/lebrown/
tfs=$dir/hs_hgnc_tfs.txt
feather=$dir/hg38__refseq-r80__10kb_up_and_down_tss.mc9nr.genes_vs_motifs.rankings.feather
tbl=$dir/motifs-v9-nr.hgnc-m0.001-o0.0.tbl 
# 一定要保证上面的数据库文件完整无误哦 
input_loom='pbmc_3k.loom'
ls $tfs  $feather  $tbl  $input_loom

#2.1 grn
pyscenic grn \
--num_workers 4 \
--output adj.sample.tsv \
--method grnboost2 \
$input_loom \
$tfs 
  1. Error encountered:
2023-12-17 17:33:27,732 - pyscenic.cli.pyscenic - INFO - Inferring regulatory networks.
/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/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 36777 instead
  warnings.warn(

site-packages/loompy/bus_file.py:101: NumbaDeprecationWarning: The 'nopython' keyword argument was not supplied to the 'numba.jit' decorator. The implicit default value for this argument is currently False, but it will be changed to True in Numba 0.59.0. See https://numba.readthedocs.io/en/stable/reference/deprecation.html#deprecation-of-object-mode-fall-back-behaviour-when-using-jit for details.
  @jit
preparing dask client
parsing input
not shutting down client, client was created externally
finished
Traceback (most recent call last):
  File "/home/lebrown/software/miniconda38/envs/py311/bin/pyscenic", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 713, in main
    args.func(args)
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/pyscenic/cli/pyscenic.py", line 106, in find_adjacencies_command
    network = method(
              ^^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 39, in grnboost2
    return diy(expression_data=expression_data, regressor_type='GBM', regressor_kwargs=SGBM_KWARGS,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 115, in diy
    expression_matrix, gene_names, tf_names = _prepare_input(expression_data, gene_names, tf_names)
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/lebrown/software/miniconda38/envs/py311/lib/python3.11/site-packages/arboreto/algo.py", line 229, in _prepare_input
    raise ValueError('Intersection of gene_names and tf_names is empty.')
ValueError: Intersection of gene_names and tf_names is empty.

You could do this : conda list |grep distributed pip uninstall distributed pip install distributed==2023.12.1

Best,

Anler

Same error about port in use; Anler's idea fixed it. Thanks