Giter Site home page Giter Site logo

aertslab / pyscenic Goto Github PK

View Code? Open in Web Editor NEW
400.0 18.0 176.0 35.53 MB

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.

Home Page: http://scenic.aertslab.org

License: GNU General Public License v3.0

Shell 1.90% Python 97.41% Dockerfile 0.69%
single-cell transcriptomics gene-regulatory-network transcription-factors

pyscenic's Introduction

pySCENIC

buildstatus pypipackage docstatus

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.

The pioneering work was done in R and results were published in Nature Methods [1]. A new and comprehensive description of this Python implementation of the SCENIC pipeline is available in Nature Protocols [4].

pySCENIC can be run on a single desktop machine but easily scales to multi-core clusters to analyze thousands of cells in no time. The latter is achieved via the dask framework for distributed computing [2].

Full documentation for pySCENIC is available on Read the Docs


pySCENIC is part of the SCENIC Suite of tools! See the main SCENIC website for additional information and a full list of tools available.


News and releases

0.12.1 | 2022-11-21

  • Add support for running arboreto_with_multiprocessing.py with spawn instead of fork as multiprocessing method.Pool
  • Use ravel instead of flatten to avoid unnecessary memory copy in aucell
  • Update Docker image file and add separated Docker file for pySCENIC with scanpy.

0.12.0 | 2022-08-16

  • Only databases in Feather v2 format are supported now (ctxcore >= 0.2), which allow uses recent versions of pyarrow (>=8.0.0) instead of very old ones (<0.17). Databases in the new format can be downloaded from https://resources.aertslab.org/cistarget/databases/ and end with *.genes_vs_motifs.rankings.feather or *.genes_vs_tracks.rankings.feather.
  • Support clustered motif databases.
  • Use custom multiprocessing instead of dask, by default.
  • Docker image uses python 3.10 and contains only needed pySCENIC dependencies for CLI usage.
  • Remove unneeded scripts and notebooks for unused/deprecated database formats.

0.11.2 | 2021-05-07

  • Split some core cisTarget functions out into a separate repository, ctxcore. This is now a required package for pySCENIC.

0.11.1 | 2021-02-11

  • Fix bug in motif url construction (#275)
  • Fix for export2loom with sparse dataframe (#278)
  • Fix sklearn t-SNE import (#285)
  • Updates to Docker image (expose port 8787 for Dask dashboard)

0.11.0 | 2021-02-10

Major features:

  • Updated arboreto release (GRN inference step) includes:
    • Support for sparse matrices (using the --sparse flag in pyscenic grn, or passing a sparse matrix to grnboost2/genie3).
    • Fixes to avoid dask metadata mismatch error
  • Updated cisTarget:
    • Fix for metadata mismatch in ctx prune2df step
    • Support for databases Apache Parquet format
    • Faster loading from feather databases
    • Bugfix: loading genes from a database (previously missing the last gene name in the database)
  • Support for Anndata input and output
  • Package updates:
    • Upgrade to newer pandas version
    • Upgrade to newer numba version
    • Upgrade to newer versions of dask, distributed
  • Input checks and more descriptive error messages.
    • Check that regulons loaded are not empty.
  • Bugfixes:
    • In the regulons output from the cisTarget step, the gene weights were incorrectly assigned to their respective target genes (PR #254).
    • Motif url construction fixed when running ctx without pruning
    • Compression of intermediate files in the CLI steps
    • Handle loom files with non-standard gene/cell attribute names
    • Reformat the genesig gmt input/output
    • Fix AUCell output to loom with non-standard loom attributes

0.10.4 | 2020-11-24

  • Included new CLI option to add correlation information to the GRN adjacencies file. This can be called with pyscenic add_cor.

See also the extended Release Notes.

Overview

The pipeline has three steps:

  1. First transcription factors (TFs) and their target genes, together defining a regulon, are derived using gene inference methods which solely rely on correlations between expression of genes across cells. The arboreto package is used for this step.
  2. These regulons are refined by pruning targets that do not have an enrichment for a corresponding motif of the TF effectively separating direct from indirect targets based on the presence of cis-regulatory footprints.
  3. Finally, the original cells are differentiated and clustered on the activity of these discovered regulons.

The most impactful speed improvement is introduced by the arboreto package in step 1. This package provides an alternative to GENIE3 [3] called GRNBoost2. This package can be controlled from within pySCENIC.

All the functionality of the original R implementation is available and in addition:

  1. You can leverage multi-core and multi-node clusters using dask and its distributed scheduler.
  2. We implemented a version of the recovery of input genes that takes into account weights associated with these genes.
  3. Regulons, i.e. the regulatory network that connects a TF with its target genes, with targets that are repressed are now also derived and used for cell enrichment analysis.

Additional resources

For more information, please visit LCB, the main SCENIC website, or SCENIC (R version). There is a tutorial to create new cisTarget databases. The CLI to pySCENIC has also been streamlined into a pipeline that can be run with a single command, using the Nextflow workflow manager. There are two Nextflow implementations available:

  • SCENICprotocol: A Nextflow DSL1 implementation of pySCENIC alongside a basic "best practices" expression analysis. Includes details on pySCENIC installation, usage, and downstream analysis, along with detailed tutorials.
  • VSNPipelines: A Nextflow DSL2 implementation of pySCENIC with a comprehensive and customizable pipeline for expression analysis. Includes additional pySCENIC features (multi-runs, integrated motif- and track-based regulon pruning, loom file generation).

Acknowledgments

We are grateful to all providers of TF-annotated position weight matrices, in particular Martha Bulyk (UNIPROBE), Wyeth Wasserman and Albin Sandelin (JASPAR), BioBase (TRANSFAC), Scot Wolfe and Michael Brodsky (FlyFactorSurvey) and Timothy Hughes (cisBP).

References

[1]Aibar, S. et al. SCENIC: single-cell regulatory network inference and clustering. Nat Meth 14, 1083–1086 (2017). doi:10.1038/nmeth.4463
[2]Rocklin, M. Dask: parallel computation with blocked algorithms and task scheduling. conference.scipy.org
[3]Huynh-Thu, V. A. et al. Inferring regulatory networks from expression data using tree-based methods. PLoS ONE 5, (2010). doi:10.1371/journal.pone.0012776
[4]Van de Sande B., Flerin C., et al. A scalable SCENIC workflow for single-cell gene regulatory network analysis. Nat Protoc. June 2020:1-30. doi:10.1038/s41596-020-0336-2

pyscenic's People

Contributors

bramvds avatar carlos-a-enriquez avatar cbravo93 avatar cflerin avatar dependabot[bot] avatar dweemx avatar ghuls avatar loremendez avatar pascal-git avatar s-aibar avatar simonvh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pyscenic's Issues

distributed.core - ERROR

/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/arboreto/algo.py:214: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
  expression_matrix = expression_data.as_matrix()
creating dask graph
48 partitions
computing dask graph
distributed.protocol.core - CRITICAL - Failed to deserialize
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/protocol/core.py", line 108, in loads
    msg = loads_msgpack(small_header, small_payload)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/protocol/core.py", line 197, in loads_msgpack
    return msgpack.loads(payload, use_list=False, **msgpack_raw_false)
  File "msgpack/_unpacker.pyx", line 187, in msgpack._cmsgpack.unpackb
ValueError: 102826 exceeds max_map_len(32768)
distributed.core - ERROR - 102826 exceeds max_map_len(32768)
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/core.py", line 386, in handle_stream
    msgs = yield comm.read()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/comm/tcp.py", line 206, in read
    deserializers=deserializers)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/comm/utils.py", line 79, in from_frames
    res = _from_frames()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/comm/utils.py", line 65, in _from_frames
    deserializers=deserializers)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/protocol/core.py", line 108, in loads
    msg = loads_msgpack(small_header, small_payload)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/protocol/core.py", line 197, in loads_msgpack
    return msgpack.loads(payload, use_list=False, **msgpack_raw_false)
  File "msgpack/_unpacker.pyx", line 187, in msgpack._cmsgpack.unpackb
ValueError: 102826 exceeds max_map_len(32768)
shutting down client and local cluster
distributed.core - ERROR - 102826 exceeds max_map_len(32768)
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/core.py", line 346, in handle_comm
    result = yield result
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1147, in run
    yielded = self.gen.send(value)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/scheduler.py", line 2018, in add_client
    yield self.handle_stream(comm=comm, extra={'client': client})
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/core.py", line 386, in handle_stream
    msgs = yield comm.read()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/comm/tcp.py", line 206, in read
    deserializers=deserializers)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
    yielded = next(result)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/comm/utils.py", line 79, in from_frames
    res = _from_frames()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/comm/utils.py", line 65, in _from_frames
    deserializers=deserializers)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/protocol/core.py", line 108, in loads
    msg = loads_msgpack(small_header, small_payload)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/protocol/core.py", line 197, in loads_msgpack
    return msgpack.loads(payload, use_list=False, **msgpack_raw_false)
  File "msgpack/_unpacker.pyx", line 187, in msgpack._cmsgpack.unpackb
ValueError: 102826 exceeds max_map_len(32768)
tornado.application - ERROR - Exception in Future <Future cancelled> after timeout
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 970, in error_callback
    future.result()
concurrent.futures._base.CancelledError
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33045 remote=tcp://127.0.0.1:58286>
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33435 remote=tcp://127.0.0.1:58286>
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33481 remote=tcp://127.0.0.1:58286>
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33482 remote=tcp://127.0.0.1:58286>
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33483 remote=tcp://127.0.0.1:58286>
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33484 remote=tcp://127.0.0.1:58286>
distributed.comm.tcp - WARNING - Closing dangling stream in <TCP local=tcp://127.0.0.1:33485 remote=tcp://127.0.0.1:58286>
finished
Traceback (most recent call last):
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/client.py", line 1487, in _gather
    st = self.futures[key]
KeyError: 'finalize-7b1845663f7c382673df6fc49437374f'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "script.py", line 44, in <module>
    adjacencies = grnboost2(ex_matrix, tf_names=tf_names, verbose=True)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/arboreto/algo.py", line 41, in grnboost2
    early_stop_window_length=early_stop_window_length, limit=limit, seed=seed, verbose=verbose)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/arboreto/algo.py", line 135, in diy
    .compute(graph, sync=True) \
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/client.py", line 2492, in compute
    result = self.gather(futures)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/client.py", line 1652, in gather
    asynchronous=asynchronous)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/client.py", line 670, in sync
    return sync(self.loop, func, *args, **kwargs)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/utils.py", line 277, in sync
    six.reraise(*error[0])
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/utils.py", line 262, in f
    result[0] = yield future
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/distributed/client.py", line 1493, in _gather
    None)
  File "/home/user/anaconda3/envs/pyscenic_env/lib/python3.6/site-packages/six.py", line 693, in reraise
    raise value
concurrent.futures._base.CancelledError: finalize-7b1845663f7c382673df6fc49437374f

How could I resolve this issue?
Any suggestion helps..
Thank you very much.
EL

error when running grnboost2(ex_matrix, tf_names=tf_names, verbose=True)

Hi

I used my own data, it crashed when running grnboost2(ex_matrix, tf_names=tf_names, verbose=True):
The expression matrix is TPM, not counts.

here are error message:
'infer_data failed for target DUX4' Retry (1/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (2/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (3/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (4/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (5/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (6/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (7/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (8/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (9/10). Failure caused by AssertionError().
'infer_data failed for target DUX4' Retry (10/10). Failure caused by AssertionError().
distributed.worker - WARNING - Compute Failed
Function: check_meta
args: (None, Empty DataFrame
Columns: [TF, target, importance]
Index: [], 'from_delayed')
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nExpected partition of type DataFrame but got NoneType',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: (None, Empty DataFrame
Columns: [TF, target, importance]
Index: [], 'from_delayed')
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nExpected partition of type DataFrame but got NoneType',)

/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
shutting down client and local cluster
finished
Traceback (most recent call last):
File "", line 1, in
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/arboreto/algo.py", line 41, in grnboost2
early_stop_window_length=early_stop_window_length, limit=limit, seed=seed, verbose=verbose)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/arboreto/algo.py", line 135, in diy
.compute(graph, sync=True)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/distributed/client.py", line 2504, in compute
result = self.gather(futures)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/distributed/client.py", line 1655, in gather
asynchronous=asynchronous)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/distributed/client.py", line 675, in sync
return sync(self.loop, func, *args, **kwargs)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/distributed/utils.py", line 277, in sync
six.reraise(*error[0])
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/distributed/utils.py", line 262, in f
result[0] = yield future
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/distributed/client.py", line 1496, in _gather
traceback)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/dask/dataframe/utils.py", line 498, in check_meta
errmsg))
ValueError: Metadata mismatch found in from_delayed.

Expected partition of type DataFrame but got NoneType

/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process still alive after 3 seconds, killing
distributed.nanny - WARNING - Worker process 130230 was killed by unknown signal
distributed.nanny - WARNING - Worker process 130194 was killed by unknown signal
distributed.nanny - WARNING - Worker process 130199 was killed by unknown signal
distributed.nanny - WARNING - Worker process 130207 was killed by unknown signal
distributed.nanny - WARNING - Worker process 130191 was killed by unknown signal
distributed.nanny - WARNING - Worker process 130219 was killed by unknown signal
distributed.nanny - WARNING - Worker process 130213 was killed by unknown signal

Error when running demo using LocalCluster

My package version list:

arboreto 0.1.5
dask 1.0.0
distributed 1.25.1
pyscenic 0.8.16

When I ran the code in the demo:

import os
import glob
import pickle
import pandas as pd
import numpy as np
from dask.diagnostics import ProgressBar
from arboreto.utils import load_tf_names
from arboreto.algo import grnboost2
from pyscenic.rnkdb import FeatherRankingDatabase as RankingDatabase
from pyscenic.utils import modules_from_adjacencies, load_motifs
from pyscenic.prune import prune2df, df2regulons
from pyscenic.aucell import aucell
import seaborn as sns
from distributed import LocalCluster, Client

DATA_FOLDER="tmp"
RESOURCES_FOLDER="resources"
DATABASE_FOLDER = "databases"
#SCHEDULER="202.205.131.15:8786"
DATABASES_GLOB = os.path.join(DATABASE_FOLDER, "mm9-*.feather")
MOTIF_ANNOTATIONS_FNAME = os.path.join(RESOURCES_FOLDER, "motifs-v9-nr.mgi-m0.001-o0.0.tbl")
MM_TFS_FNAME = os.path.join(RESOURCES_FOLDER, 'mm_tfs.txt')
#SC_EXP_FNAME = os.path.join(RESOURCES_FOLDER, "GSE60361_C1-3005-Expression.txt")
SC_EXP_FNAME = os.path.join(RESOURCES_FOLDER, "test.txt")
REGULONS_FNAME = os.path.join(DATA_FOLDER, "regulons.p")
MOTIFS_FNAME = os.path.join(DATA_FOLDER, "motifs.csv")

# create custom LocalCluster and Client instances
local_cluster = LocalCluster(n_workers=10, threads_per_worker=1, memory_limit=2e9)
print(local_cluster)
custom_client = Client(local_cluster)

# load data
ex_matrix = pd.read_csv(SC_EXP_FNAME, sep='\t', header=0, index_col=0).T
print(ex_matrix.shape)

tf_names = load_tf_names(MM_TFS_FNAME)

db_fnames = glob.glob(DATABASES_GLOB)
def name(fname):
    return os.path.basename(fname).split(".")[0]

dbs = [RankingDatabase(fname=fname, name=name(fname)) for fname in db_fnames]
print('dbs:\n', dbs)

adjacencies = grnboost2(ex_matrix, tf_names=tf_names, verbose=True, client_or_address=custom_client, seed = 666)

The error occurred:

distributed.nanny - WARNING - Worker process 95174 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker process 95172 was killed by unknown signal
distributed.nanny - WARNING - Worker process 95173 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker process 95180 was killed by unknown signal
distributed.nanny - WARNING - Worker process 95185 was killed by unknown signal
distributed.nanny - WARNING - Worker process 95181 was killed by unknown signal
distributed.nanny - WARNING - Worker process 95176 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker process 95183 was killed by unknown signal
distributed.nanny - WARNING - Worker process 95188 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker process 95189 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker process 96160 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker process 96197 was killed by unknown signal
distributed.nanny - WARNING - Restarting worker
tornado.application - ERROR - Multiple exceptions in yield list
Traceback (most recent call last):
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 883, in callback
    result_list.append(f.result())
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/distributed/deploy/local.py", line 208, in _start_worker
    yield w._start()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/distributed/nanny.py", line 157, in _start
    response = yield self.instantiate()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/distributed/nanny.py", line 226, in instantiate
    self.process.start()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/distributed/nanny.py", line 370, in start
    yield self.process.start()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/distributed/process.py", line 35, in _call_and_set_future
    res = func(*args, **kwargs)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/site-packages/distributed/process.py", line 184, in _start
    process.start()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/process.py", line 105, in start
    self._popen = self._Popen(self)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/context.py", line 291, in _Popen
    return Popen(process_obj)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/popen_forkserver.py", line 35, in __init__
    super().__init__(process_obj)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/popen_fork.py", line 26, in __init__
    self._launch(process_obj)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/popen_forkserver.py", line 42, in _launch
    prep_data = spawn.get_preparation_data(process_obj._name)
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/spawn.py", line 143, in get_preparation_data
    _check_not_importing_main()
  File "/home/XXX/lustre/Tools/Python-3.6.4/install/lib/python3.6/multiprocessing/spawn.py", line 136, in _check_not_importing_main
    is not going to be frozen to produce an executable.''')
RuntimeError:
        An attempt has been made to start a new process before the
        current process has finished its bootstrapping phase.

        This probably means that you are not using fork to start your
        child processes and you have forgotten to use the proper idiom
        in the main module:

            if __name__ == '__main__':
                freeze_support()
                ...

        The "freeze_support()" line can be omitted if the program
        is not going to be frozen to produce an executable.
tornado.application - ERROR - Multiple exceptions in yield list

How to solve this problem? Thanks.

pyscenic grn in singularity: workers continuously restarting after memory warnings

Hi,
I am trying to use pySCENIC in a singularity container (version 0.9.5) but I keep getting warnings that eventualy result in errors and workers continuously restarting (see below).
The system I get these errors on has 22gb ram and I used 4 workers.
When I run the exact same thing (same singularity image, same inputs, same command) on a machine with more ram (64gb), everything works perfectly.

During the warnings, I checked the memory usage and it never went over 14gb.
Is there something I can do to make this also work on the machine with 22gb ram? Or is this problem caused by the 'limited' amount of ram available?

distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.nanny - WARNING - Restarting worker
distributed.nanny - WARNING - Worker exceeded 95% memory budget. Restarting
distributed.nanny - WARNING - Worker process 25440 was killed by unknown signal
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.nanny - WARNING - Restarting worker
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Worker is at 95% memory usage. Pausing worker.  Process memory: 978.70 MB -- Worker memory limit: 1.03 GB
distributed.worker - WARNING - Memory use is high but worker has no data to store to disk.  Perhaps some other process is leaking memory?  Process memory: 732.21 MB -- Worker memory limit: 1.03 GB
distributed.nanny - WARNING - Worker exceeded 95% memory budget. Restarting
distributed.worker - ERROR - Worker stream died during communication: tcp://127.0.0.1:36289
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/distributed/comm/tcp.py", line 181, in read
    n_frames = yield stream.read_bytes(8)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/distributed/worker.py", line 1607, in gather_dep
    who=self.address)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/lib/python3.6/site-packages/distributed/worker.py", line 2671, in get_data_from_worker
    max_connections=max_connections)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/lib/python3.6/site-packages/distributed/core.py", line 457, in send_recv
    response = yield comm.read(deserializers=deserializers)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/lib/python3.6/site-packages/distributed/comm/tcp.py", line 201, in read
    convert_stream_closed_error(self, e)
  File "/opt/conda/lib/python3.6/site-packages/distributed/comm/tcp.py", line 130, in convert_stream_closed_error
    raise CommClosedError("in %s: %s" % (obj, exc))
distributed.comm.core.CommClosedError: in <closed TCP>: Stream is closeddistributed.worker - ERROR - Worker stream died during communication: tcp://127.0.0.1:36289
Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/distributed/comm/tcp.py", line 181, in read
    n_frames = yield stream.read_bytes(8)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
tornado.iostream.StreamClosedError: Stream is closed

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/opt/conda/lib/python3.6/site-packages/distributed/worker.py", line 1607, in gather_dep
    who=self.address)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/lib/python3.6/site-packages/distributed/worker.py", line 2671, in get_data_from_worker
    max_connections=max_connections)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/lib/python3.6/site-packages/distributed/core.py", line 457, in send_recv
    response = yield comm.read(deserializers=deserializers)
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
    value = future.result()
  File "/opt/conda/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
    yielded = self.gen.throw(*exc_info)
  File "/opt/conda/lib/python3.6/site-packages/distributed/comm/tcp.py", line 201, in read
    convert_stream_closed_error(self, e)
  File "/opt/conda/lib/python3.6/site-packages/distributed/comm/tcp.py", line 130, in convert_stream_closed_error
    raise CommClosedError("in %s: %s" % (obj, exc))
distributed.comm.core.CommClosedError: in <closed TCP>: Stream is closed

This keeps going until I manualy stop the process.

question about "grnboost"

Dear authors,
Recently, I used your powerful pySCENIC software and I met a question.

I have installed pyscenic successfully in our linux machine. But when I ran "pyscenic grnboost", I met error log as follows:

/public1/users/xxw/.local/lib/python3.5/site-packages/dask/dataframe/utils.py:480: FutureWarning: Sorting because non-concatenation axis is not aligned. A future version of pandas will change to not sort by default.
To accept the future behavior, pass 'sort=False'.
To retain the current behavior and silence the warning, pass 'sort=True'. dtypes = pd.concat([x.dtypes, meta.dtypes], axis=1)
/public1/users/xxw/.local/lib/python3.5/site-packages/arboreto/algo.py:214: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead. expression_matrix = expression_data.as_matrix()
2018-08-28 23:17:31,233 - pyscenic.cli.pyscenic - INFO - Writing results to file.

preparing dask client
parsing input
creating dask graph
32 partitions
computing dask graph
not shutting down client, client was created externally
finished

Future exception was never retrieved
future: <Future finished exception=StreamClosedError('Stream is closed',)>
Traceback (most recent call last):
File "/public1/users/xxw/.local/lib/python3.5/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/public1/users/xxw/.local/lib/python3.5/site-packages/tornado/tcpclient.py", line 232, in connect
af, addr, stream = yield connector.start(connect_timeout=timeout)
File "/public1/users/xxw/.local/lib/python3.5/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
File "/public1/users/xxw/.local/lib/python3.5/site-packages/tornado/tcpclient.py", line 112, in on_connect_done
stream = future.result()
File "/usr/lib/python3.5/asyncio/futures.py", line 274, in result
raise self._exception
tornado.iostream.StreamClosedError: Stream is closed

Question:
Because I could run "ctx" and "aucell" based on the output from "grnboost", I thougt that this error didn't matter.
However, when I repeated "grnboost", "ctx" and "aucell" again with the identical data/parameter, the output is different.
What's wrong with it and how can I solve this problem?

I need your help urgently and show my great appreciation to you!
xiaowei,

Problem running the tutorial

Hi,
I am trying to run the tutorial but run into this issue. Feel like one of the file I downloaded is not in the right format but can't figure out exactly what the problem is.

screen shot 2018-12-13 at 6 59 41

screen shot 2018-12-13 at 6 52 42
screen shot 2018-12-13 at 6 56 14
screen shot 2018-12-13 at 6 56 46

Differences between R and python versions

Hi,

I have a general question about the python version of the SCENIC workflow. I have been using the R version for several months now and recently started using pySCENIC. If i interpret the output of pySCENIC correctly, it generates several regulons for the same transcription factor. As far as i can tell, this is not the case in the R version (regulon-transcription factor pairs are unique). Would you guys mind explaining this difference please? I am just curious as to how to interpret pySCENIC output.

Additionally, related: what is the relationship between 'importance' generated by grnboost2 and 'weight' generated by GENIE3?

Thank you,

Joe

interpretation of heatmap of sns.clustermap(auc_mtx)

Hi,

Could you explain how to interpret the heatmap? The dark part (close to 0) means the regulon not active? If so vast majority of cells have nonactive regulons.
Also, how to use binarize(auc_mtx)? Could you give some example code for binarize and use the results for heatmap?
Some papers said scenic is sensitive to dropout, could you suggest how sensitive it is?

Thanks for such great tools and quick response, anyway!

recursion depth: sns.clustermap(auc_mtx, figsize=(8,8))

sorry to keep bombarding you!

>>> sns.clustermap(auc_mtx, figsize=(8,8))
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2651, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2651, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2651, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  [Previous line repeated 993 more times]
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2618, in _dendrogram_calculate_info
    above_threshold_color=above_threshold_color)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2530, in _dendrogram_calculate_info
    leaf_label_func, i, labels)
  File "/usr/local/lib/python3.6/site-packages/scipy/cluster/hierarchy.py", line 2403, in _append_singleton_leaf_node
    ivl.append(str(int(i)))
RecursionError: maximum recursion depth exceeded while getting the str of an object
>>> auc_mtx.shape
(11750, 253)

newer databases?

Will you be able to provide databases for mm10 & GRCh38?

thanks!
Mark

AUCell ratio calculation issue

if rnk.empty or float(len(rnk))/len(regulon) < 0.80:

hello,
When I used AUCell by itself, I am having a warning from this line of code. As I inspected the source code, I think len(rnk) should refer to the number of cells in expression matrix, not the number of genes that have expression data in expression matrix. So I think the right if condition here should be if rnk.empty or float(len(rnk.columns))/len(regulon) < 0.80
Let me know if I misunderstand this part of the code. Thank you!
Pyscenic is a great work!

Johnny

How to binarize the network activity (regulon on/off) in python ?

Dear,

Thanks for the powerful tool.

I have finished the pipeline of pySCENIC successfully. However, I wonder how could I binarize the AUC matrix result, like the pipeline in R ? Since my data have serious batch effect, the binary value might be more useful ?

Looking forward to your reply, thanks very much !

Best,

Zorro
20180916

Installation error

hi,
I used pip to install pySCENIC, but it is not installed. The following error is:

Could not find a version that satisfies the requirement pyarrow==0.8.0 (from pyscenic) (from versions: 0.9.0, 0.10.0, 0.11.0, 0.11.1)
No matching distribution found for pyarrow==0.8.0 (from pyscenic)

GRNBoost Warning

Greetings,

I have been successfully running this whole program and getting some nice results, but I am puzzled as to why I am getting this message when I run the GRNboost:

/anaconda3/envs/pyscenic/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()

I thought that it might be because I have some genes that have zero total counts in the whole count table, but I have removed all of those genes and am still getting this message. This error is not preventing the program from running, but I just want to make sure that I am not missing anything. Thanks so much!

Issues with using the loom file in ScopeloomR

Hi,
I have been trying to use the loom file generated by pySCENIC on ScopeLoomR to further manipulate it.
The loom file generated by pySCENIC from a windows platform has errors as the global attributes are not saved it seems.
The loom file generated on Ubuntu by pySCENIC has another issue when I try to use it in ScopeLoomR. The errors in detail along with the response from the contributor for ScopeLoomR are given in the thread below. Kindly refer to it.
aertslab/SCopeLoomR#7 (comment)

Any support is appreciated.
Thanks in advance!

expression matrix

Dear,
Is is necessary to make log transformation on the input expression matrix, as the GENIE3 does ?

pySCENIC cli not working with --no_prune

Hi!
I would like to run the CLI with the option --no_prune, but this does not work because of some error.

I use the following command:

pyscenic ctx \
           -o SCENIC_out/grnboost_out_no_pruning.csv \
           --annotations_fname database/motifs-v9-nr.mgi-m0.001-o0.0.tbl \
           --num_workers 40 \
           --min_genes 5 \
           --expression_mtx_fname data/exp_transposed.tsv \
           --no_pruning \
           SCENIC_out/grnboost_out.csv \
           database/mm9-tss-centered-10kb-7species.mc9nr.feather

When I run this, I get the following output:

2018-05-30 14:48:40,413 - pyscenic.cli.pyscenic - INFO - Creating modules.
Traceback (most recent call last):
  File "/home/hd/hd_hd/hd_lg367/.local/bin/pyscenic", line 11, in <module>
    sys.exit(main())
  File "/home/hd/hd_hd/hd_lg367/.local/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 334, in main
    args.func(args)
  File "/home/hd/hd_hd/hd_lg367/.local/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 129, in prune_targets_command
    modules = _df2modules(args)
  File "/home/hd/hd_hd/hd_lg367/.local/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 70, in _df2modules
    min_genes=args.min_genes)
  File "/home/hd/hd_hd/hd_lg367/.local/lib/python3.6/site-packages/pyscenic/utils.py", line 262, in modules_from_adjacencies
    rho_threshold=rho_threshold, mask_dropouts=rho_mask_dropouts)
  File "/home/hd/hd_hd/hd_lg367/.local/lib/python3.6/site-packages/pyscenic/utils.py", line 129, in add_correlation
    col_idx_pairs = _create_idx_pairs(adjacencies, ex_mtx)
  File "/home/hd/hd_hd/hd_lg367/.local/lib/python3.6/site-packages/pyscenic/utils.py", line 70, in _create_idx_pairs
    genes = set(adjacencies.TF).union(set(adjacencies.target))
  File "/opt/bwhpc/common/devel/python_intel/3.6_2018.0.022/intelpython3/lib/python3.6/site-packages/pandas/core/generic.py", line 3081, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'TF'

I also tried to rename the grnboost_out.csv to grnboost_out.tsv which still generates the aforementioned error.

The input looks as follows:

data/exp_transposed.tsv:

$ awk -F "\t" 'BEGIN{OFS=FS}{print $1,$2,$3,$4,$5}' data/exp_transposed.tsv | head
	4933401J01Rik	Gm26206	Xkr4	Gm18956
AAACCTGAGATCCTGT	0	0	1	0
AAACCTGAGCCAGGAT	0	0	0	0
AAACCTGCAAACGTGG	0	0	0	0
AAACGGGAGCGGCTTC	0	0	0	0
AAACGGGAGTCATCCA	0	0	0	0
AAACGGGAGTGCAAGC	0	0	0	0
AAACGGGAGTGGAGAA	0	0	0	0
AAACGGGCAATGTAAG	0	0	0	0
AAACGGGCAGTCAGCC	0	0	0	0
$ head SCENIC_out/grnboost_out.csv
TF	target	importance
Runx1t1	March3	90.00993732947946
Gadd45a	Tmcc2	88.48153749855663
Gadd45a	Specc1	88.28239385246135
Hdac10	Mettl7a3	83.80642644798267
Sub1	Gm2986	82.81329853390594
Sox6	Hbb-bt	78.98218688124797
Myef2	Slc24a5	77.44812698969015
Pbx3	C79798	75.75068014227527
Gadd45a	March3	74.6984648345887

It would be great, if you could elevate on the usage of the CLI with a step-by-step tutorial, just starting with the UMI count table, the TF file (each row one TF), the RcisTarget database and the TF annotation file, nothing else.
And also showing what to input if one does not want to prune the data.

All the best!
Kevin

sensitive to dropout

Hi,

Here is the paper testing GENIE3's performance.
Evaluating methods of inferring gene regulatory networks highlights their lack of performance for single cell gene expression data
BMC Bioinformatics. 2018 Jun 19;19(1):232.

screen shot 2019-03-08 at 7 08 18 am

AssertionError in _enrichment

have you ever seen this? i also noticed that when i try to run aucell with the num_workers argument, it complains:

>>> auc_mtx = aucell(ex_matrix, regulons, num_workers=4)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: aucell() got an unexpected keyword argument 'num_workers'

AssertionError:

Traceback (most recent call last):
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/local/Cellar/python/3.6.4_3/Frameworks/Python.framework/Versions/3.6/lib/python3.6/multiprocessing/process.py", line 93, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/local/lib/python3.6/site-packages/pyscenic/aucell.py", line 80, in _enrichment
    result_mtx[offset+(idx*inc):offset+((idx+1)*inc)] = enrichment4cells(df_rnk, module, auc_threshold).values.flatten(order="C")
  File "/usr/local/lib/python3.6/site-packages/pyscenic/recovery.py", line 116, in enrichment4cells
    return pd.DataFrame(index=index, data={"AUC": aucs(rnk, total_genes, weights, auc_threshold)})
  File "/usr/local/lib/python3.6/site-packages/pyscenic/recovery.py", line 284, in aucs
    assert maxauc > 0
AssertionError

here are all my imports

import os
import glob
import pickle
import pandas as pd
import numpy as np

from arboretum.utils import load_tf_names
from arboretum.algo import grnboost2

from pyscenic.rnkdb import FeatherRankingDatabase as RankingDatabase
from pyscenic.utils import modules_from_adjacencies
from pyscenic.prune import prune, prune2df, df2regulons
from pyscenic.aucell import aucell

and the cpu_count()

>>> import multiprocessing as mp
>>> mp.cpu_count()
4

thread problems

Dear,

when I ran adjacencies = grnboost2(ex_matrix, tf_names=tf_names, verbose=True)
the following error occured:

File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new threadtornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4cc0fe488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec09a158>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec13f488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new threadtornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec13d488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec13f488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new threadtornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4cc0fe488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread

tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec09a158>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec127048>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec09a158>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec128048>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec140488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec140488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec140488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec137378>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
Process ForkServerProcess-65:
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec13f488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
self.run()
File "/home/wangjw/bin/miniconda3/lib/python3.6/multiprocessing/process.py", line 93, in run
self._target(*self._args, **self._kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/process.py", line 173, in _run
target(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/nanny.py", line 505, in _run
worker = Worker(*worker_args, **worker_kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 1326, in init
WorkerBase.init(self, *args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 218, in init
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/node.py", line 47, in init
deserialize=deserialize, io_loop=self.io_loop)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 135, in init
stop=stop,
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/profile.py", line 268, in watch
thread.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
distributed.nanny - WARNING - Worker process 49359 exited with status 1
distributed.nanny - WARNING - Restarting worker
tornado.application - ERROR - Exception in callback functools.partial(<function wrap..null_wrapper at 0x7fd4ec13e488>, <Future finished exception=RuntimeError("can't start new thread",)>)
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 758, in _run_callback
ret = callback()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/stack_context.py", line 300, in null_wrapper
return fn(*args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 779, in _discard_future_result
future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/worker.py", line 266, in heartbeat
metrics=self.get_metrics()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 634, in send_recv_from_rpc
comm = yield self.pool.connect(self.addr)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/core.py", line 745, in connect
connection_args=self.connection_args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/core.py", line 186, in connect
quiet_exceptions=EnvironmentError)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/comm/tcp.py", line 330, in connect
**kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/tcpclient.py", line 226, in connect
addrinfo = yield self.resolver.resolve(host, port, af)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/gen.py", line 326, in wrapper
yielded = next(result)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/netutil.py", line 378, in resolve
None, _resolve_addr, host, port, family)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/tornado/platform/asyncio.py", line 166, in run_in_executor
return self.asyncio_loop.run_in_executor(executor, func, *args)
File "/home/wangjw/bin/miniconda3/lib/python3.6/asyncio/base_events.py", line 639, in run_in_executor
return futures.wrap_future(executor.submit(func, *args), loop=self)
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 123, in submit
self._adjust_thread_count()
File "/home/wangjw/bin/miniconda3/lib/python3.6/concurrent/futures/thread.py", line 142, in _adjust_thread_count
t.start()
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 846, in start
_start_new_thread(self._bootstrap, ())
RuntimeError: can't start new thread
^CException ignored in: <bound method ObjectRef.del of <llvmlite.binding.module.ModuleRef object at 0x7fd4f10ac470>>
Traceback (most recent call last):
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/llvmlite/binding/ffi.py", line 241, in del
def del(self):
KeyboardInterrupt
Traceback (most recent call last):
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 234, in 'calling callback function'
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/llvmlite/binding/executionengine.py", line 159, in _raw_object_cache_notify
def _raw_object_cache_notify(self, data):
KeyboardInterrupt
File "pipeline.py", line 21, in
adjacencies = grnboost2(ex_matrix, tf_names=tf_names, verbose=True)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/arboreto/algo.py", line 41, in grnboost2
early_stop_window_length=early_stop_window_length, limit=limit, seed=seed, verbose=verbose)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/arboreto/algo.py", line 109, in diy
client, shutdown_callback = _prepare_client(client_or_address)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/arboreto/algo.py", line 157, in _prepare_client
local_cluster = LocalCluster(diagnostics_port=None)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/deploy/local.py", line 141, in init
self.start(ip=ip, n_workers=n_workers)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/deploy/local.py", line 171, in start
Traceback (most recent call last):
File "_ctypes/callbacks.c", line 234, in 'calling callback function'
self.sync(self._start, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/deploy/local.py", line 164, in sync
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/llvmlite/binding/executionengine.py", line 159, in _raw_object_cache_notify
return sync(self.loop, func, *args, **kwargs)
File "/home/wangjw/bin/miniconda3/lib/python3.6/site-packages/distributed/utils.py", line 275, in sync
def _raw_object_cache_notify(self, data):
KeyboardInterrupt
e.wait(10)
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 551, in wait
signaled = self._cond.wait(timeout)
File "/home/wangjw/bin/miniconda3/lib/python3.6/threading.py", line 299, in wait
gotit = waiter.acquire(True, timeout)
KeyboardInterrupt
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-74, started daemon)>
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-71, started daemon)>
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-69, started daemon)>
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-75, started daemon)>
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-66, started daemon)>
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-68, started daemon)>
distributed.process - WARNING - reaping stray process <ForkServerProcess(ForkServerProcess-70, started daemon)>

I have never run grnboost successfully, could you help me?

Pandas error on aucell step when using loom input/output

This issue appears to be caused by a major update to pandas. Using pandas version 0.23.4, this step completes with no problems. Using the latest pandas (Jan 25, version 0.24.1), I get the following error:

$ pyscenic aucell expr_mat_converted.loom reg.csv -o auc.loom
2019-02-07 13:34:38,393 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.
2019-02-07 13:34:38,397 - pyscenic.cli.pyscenic - INFO - Loading gene signatures.
2019-02-07 13:34:38,413 - pyscenic.cli.pyscenic - INFO - Calculating cellular enrichment.
2019-02-07 13:34:40,077 - pyscenic.cli.pyscenic - INFO - Writing results to file.
Traceback (most recent call last):
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/bin/pyscenic", line 10, in <module>
    sys.exit(main())
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 402, in main
    args.func(args)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 196, in aucell_command
    append_auc_mtx(args.output.name, auc_mtx, signatures)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pyscenic/cli/utils.py", line 241, in append_auc_mtx
    _, auc_thresholds = binarize(auc_mtx)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pyscenic/binarization.py", line 45, in binarize
    return (auc_mtx > thresholds).astype(int), thresholds
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/ops.py", line 2103, in f
    level=None)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/ops.py", line 1930, in _combine_series_frame
    return self._combine_match_columns(other, func, level=level)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/frame.py", line 5116, in _combine_match_columns
    return ops.dispatch_to_series(left, right, func, axis="columns")
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/ops.py", line 1157, in dispatch_to_series
    new_data = expressions.evaluate(column_op, str_rep, left, right)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/computation/expressions.py", line 208, in evaluate
    return _evaluate(op, op_str, a, b, **eval_kwargs)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/computation/expressions.py", line 68, in _evaluate_standard
    return op(a, b)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/ops.py", line 1144, in column_op
    for i in range(len(a.columns))}
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/ops.py", line 1144, in <dictcomp>
    for i in range(len(a.columns))}
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenictest/lib/python3.6/site-packages/pandas/core/ops.py", line 1745, in wrapper
    raise ValueError('Lengths must match to compare')
ValueError: Lengths must match to compare

However, this step completes correctly when using an expression matrix text file as input (works on both pandas versions). There appears to be some differences in either the auc matrix or the binarization step when the input is a loom vs a text file that cause this.

Could I use pySCENIC for fly?

Hi there,
I have used SCENIC R package. Now, I want to use pySCENIC for Drosophila.
I find that pySCENIC is for Human and mouse only. Can I use pySCENIC for Drosophila?
If yes, where could I find the reference files?

Thank you very much!

FG

error about pyscenic grnboost

Hi,
When I ran "pyscenic -h", it showed that I have successfully installed this software.
But when I ran "pyscenic grnboost", I met the errors as belows:

2018-12-04 13:46:44,213 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.
2018-12-04 13:46:46,673 - pyscenic.cli.pyscenic - INFO - Inferring regulatory networks.
Traceback (most recent call last):
File "/public/home/xiexiaowei/.local/bin/pyscenic", line 11, in
sys.exit(main())
File "/public/home/xiexiaowei/.local/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 356, in main
args.func(args)
File "/public/home/xiexiaowei/.local/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 119, in find_adjacencies_command
client, shutdown_callback = _prepare_client(args.client_or_address, num_workers=args.num_workers)
File "/public/home/xiexiaowei/.local/lib/python3.6/site-packages/pyscenic/prune.py", line 64, in _prepare_client
client = Client(local_cluster)
File "/public/home/bioinfo/software/anaconda3/lib/python3.6/site-packages/distributed/client.py", line 556, in init
dask.set_options(get=self.get)
File "/public/home/xiexiaowei/.local/lib/python3.6/site-packages/dask/context.py", line 18, in set_options
raise TypeError("The dask.set_options function has been deprecated.\n"
TypeError: The dask.set_options function has been deprecated.
Please use dask.config.set instead

Before: with dask.set_options(foo='bar'):
...
After: with dask.config.set(foo='bar'):

So, what happened and how to solve this problem?
Thanks very much!
xiaowei,

pyscenic took a long time and crashed when running on a laptop machine

Hello,
I am implementing pyscenic on my laptop (MacPro 2.6 GHz Intel Core i7) using the command as followed:
pyscenic grnboost -o scenic_out/grn_output.tsv @grn_args.txt
in which grn_args.txt contains filenames for expression data file and known TFs file

The message that I got from stdout is:
computing dask graph /Users/ngurb2/anaconda3/lib/python3.6/site-packages/distributed/worker.py:742: UserWarning: Large object of size 1.17 MB detected in task graph: (["('from-delayed-88e08b64b679c247402263c72630abb5 ... b5', 19971)"],)
Consider scattering large objects ahead of time with client.scatter to reduce scheduler burden and keep data on workers

future = client.submit(func, big_data) # bad

big_future = client.scatter(big_data)     # good
future = client.submit(func, big_future)  # good

% (format_bytes(len(b)), s))

The process halted and crashed and I do not know what the issues are here. It might be something with the parallel computing? Thank you!

import module error

Dear,
I met an error "TypeError: attr() got an unexpected keyword argument 'converter'" when I type the following code as the tutorials do:

from pyscenic.rnkdb import FeatherRankingDatabase as RankingDatabase
from pyscenic.utils import modules_from_adjacencies, load_motifs
from pyscenic.prune import prune, prune2df, df2regulons
from pyscenic.aucell import aucell

here is the whole output:

from pyscenic.rnkdb import FeatherRankingDatabase as RankingDatabase
Traceback (most recent call last):
File "", line 1, in
File "/home/wangjw/data/bin/python3.6/lib/python3.6/site-packages/pyscenic/rnkdb.py", line 10, in
from .genesig import GeneSignature
File "/home/wangjw/data/bin/python3.6/lib/python3.6/site-packages/pyscenic/genesig.py", line 31, in
class GeneSignature(yaml.YAMLObject):
File "/home/wangjw/data/bin/python3.6/lib/python3.6/site-packages/pyscenic/genesig.py", line 120, in GeneSignature
gene2weight = attr.ib(converter=convert) # Mapping[str, float]
TypeError: attr() got an unexpected keyword argument 'converter'
What's the cause of this error?

Error in pyscenic CLI, ctx step

With pySCENIC 0.9.0, I'm running into an error while using the CLI at the ctx step:

pyscenic ctx \
    adjacencies.tsv \
    hg19-500bp-upstream-7species.mc9nr.feather \
    --annotations_fname motifs-v9-nr.hgnc-m0.001-o0.0.tbl \
    --expression_mtx_fname expr_mat.tsv \
    --mode "dask_multiprocessing" \
    --output regulons.csv \
    --num_workers 6

2018-12-20 10:39:32,048 - pyscenic.cli.pyscenic - INFO - Creating modules.
Traceback (most recent call last):
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/bin/pyscenic", line 11, in <module>
    sys.exit(main())
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 394, in main
    args.func(args)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 124, in prune_targets_command
    modules = adjacencies2modules(args.module_fname.name)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 75, in adjacencies2modules
    adjacencies = load_adjacencies(args.module_fname.name)
AttributeError: 'str' object has no attribute 'module_fname'

With @KrisDavie's help, we've tracked this down to line 124 of src/pyscenic/cli/pyscenic.py: the adjacencies2modules function should take args as input, instead of the full args.module_fname.name string.

Problems with export2loom

Hi,

I have followed the tutorial that you provided for export2loom (https://github.com/aertslab/pySCENIC/blob/master/notebooks/pySCENIC%20-%20Create%20loom%20file.ipynb) but I am still having some issues getting this to work. I have made sure all of my names (i.e. gene symbols, cell annotations, sample IDs, ...) are simple strings. Can you provide any insight into what is going wrong? It would be very helpful if you could make the resources available from the Zeisel et al dataset that you use in the notebook so I can test out my installation on directly compare to my input files. Thank you!

Best,
Michael

/nethome/mdurante/.local/lib/python3.6/site-packages/sklearn/externals/joblib/externals/cloudpickle/cloudpickle.py:47: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
Traceback (most recent call last):
  File "exportloom.py", line 31, in <module>
    export2loom(exp_mtx, regulons, annotations, LOOM_FILE)
  File "/nethome/mdurante/miniconda3/envs/py36/lib/python3.6/site-packages/pyscenic/export.py", line 75, in export2loom
    columns=['0']).replace(cell_annotations).replace(name2idx)
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 3798, in replace
    method=method)
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 5802, in replace
    limit=limit, regex=regex)
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/frame.py", line 3798, in replace
    method=method)
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/generic.py", line 5851, in replace
    regex=regex)
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/internals.py", line 3739, in replace_list
    masks = [comp(s) for i, s in enumerate(src_list)]
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/internals.py", line 3739, in <listcomp>
    masks = [comp(s) for i, s in enumerate(src_list)]
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/internals.py", line 3737, in comp
    return _maybe_compare(values, getattr(s, 'asm8', s), operator.eq)
  File "/nethome/mdurante/.local/lib/python3.6/site-packages/pandas/core/internals.py", line 5165, in _maybe_compare
    b=type_names[1]))
TypeError: Cannot compare types 'ndarray(dtype=float64)' and 'str'

saving of regulons as txt files

Hi,

What is the easiest way to save the modules/regulons generated by pyscenic as a txt file? Eventually, I would like to export them in some way so i can read them into R.

thank you!

Joe

regulons expression plots

Hello,

Thanks for the great work on pySCENIC! been using R version and pySCENIC is so much faster!

Though, I can't seem to find some feature (eg. TSNE, histogram plots) for regulons' expressions that are found in R version of SCENIC. Where can I find them? I may have over looked but may I know where to find the documentation of all the functions available?

Thanks!
Justine

pyscenic grn fails

Hi,

I'm trying to run the pyscenic grn command using pyscenic 0.9.3.

This is the command I'm using:

pyscenic grn input.loom --cell_id_attribute CellID --gene_attribute Gene tf_list.txt --num_workers 40 -o out.csv

and this is the output I'm getting (paths shortened):

2019-01-18 12:12:44,011 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.
2019-01-18 12:14:06,165 - pyscenic.cli.pyscenic - INFO - Inferring regulatory networks.
tornado.application - ERROR - Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x2aeb2b3d0ae8>, <tornado.concurrent.Future object at 0x2aeb0b75c780>)
Traceback (most recent call last):
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/ioloop.py", line 605, in _run_callback
    ret = callback()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/stack_context.py", line 277, in null_wrapper
    return fn(*args, **kwargs)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/ioloop.py", line 626, in _discard_future_result
    future.result()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/distributed/worker.py", line 640, in heartbeat
    metrics=self.get_metrics()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
    value = future.result()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/distributed/core.py", line 642, in send_recv_from_rpc
    result = yield send_recv(comm=comm, op=key, **kwargs)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
    value = future.result()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run
    yielded = self.gen.throw(*exc_info)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/distributed/core.py", line 455, in send_recv
    yield comm.write(msg, serializers=serializers, on_error='raise')
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run
    value = future.result()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result
    raise_exc_info(self._exc_info)
  File "<string>", line 4, in raise_exc_info
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/gen.py", line 1069, in run
    yielded = self.gen.send(value)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/distributed/comm/tcp.py", line 232, in write
    stream.write(b)
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/iostream.py", line 406, in write
    self._handle_write()
  File "/[...]/20190116_pyscenic/venv/lib/python3.6/site-packages/tornado/iostream.py", line 872, in _handle_write
    del self._write_buffer[:self._write_buffer_pos]
BufferError: Existing exports of data: object cannot be re-sized
tornado.application - ERROR - Exception in callback functools.partial(<function wrap.<locals>.null_wrapper at 0x2aeb2ab1e598>, <tornado.concurrent.Future object at 0x2aeb2adad080>)
[...]

This error shows up multiple times and then the job eventually stops after considerable time.

This is the output of my pip freeze (I'm inside a virtualenv):

arboreto==0.1.5
attrs==18.2.0
boltons==18.0.1
Click==7.0
cloudpickle==0.6.1
cytoolz==0.9.0.1
dask==0.18.1
decorator==4.3.0
dill==0.2.8.2
distributed==1.25.2
frozendict==1.2
h5py==2.9.0
HeapDict==1.0.0
interlap==0.2.6
llvmlite==0.27.0
loompy==2.0.2
msgpack==0.6.0
multiprocessing-on-dill==3.5.0a4
networkx==2.2
numba==0.42.0
numpy==1.16.0
pandas==0.23.4
psutil==5.4.8
pyarrow==0.11.1
pyscenic==0.9.3
python-dateutil==2.7.5
pytz==2018.9
PyYAML==3.13
scikit-learn==0.20.2
scipy==1.2.0
six==1.12.0
sortedcontainers==2.1.0
tblib==1.3.2
toolz==0.9.0
tornado==4.5
tqdm==4.29.1
typing==3.6.6
umap-learn==0.3.7
zict==0.1.3

As suggested in #30 I have downgraded tornado and dask, but it doesn't seem to be helping unfortunately. Should pyscenic also be downgraded?

Many thanks,
M

p.s. I downgraded tornado and dask in a different way:

virtualenv venv
source activate venv/bin/activate
pip install pyscenic
pip install tornado==4.5
pip install dask==0.18.1

error when running df = prune2df(dbs, modules, MOTIF_ANNOTATIONS_FNAME)

Here is error message:
Less than 80% of the genes in ZNF606 could be mapped to hg19-tss-centered-10kb-10species. Skipping this module.
Traceback (most recent call last):
File "run_scenic.py", line 68, in
df = prune2df(dbs, modules, MOTIF_ANNOTATIONS_FNAME)
File "/home/yu_liu/.local/lib/python3.6/site-packages/pyscenic/prune.py", line 351, in prune2df
num_workers, module_chunksize)
File "/home/yu_liu/.local/lib/python3.6/site-packages/pyscenic/prune.py", line 300, in _distributed_calc
return create_graph().compute(scheduler='processes', num_workers=num_workers if num_workers else cpu_count())
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/base.py", line 156, in compute
(result,) = compute(self, traverse=False, **kwargs)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/base.py", line 398, in compute
results = schedule(dsk, keys, **kwargs)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/multiprocessing.py", line 192, in get
raise_exception=reraise, **kwargs)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/local.py", line 459, in get_async
raise_exception(exc, tb)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/compatibility.py", line 111, in reraise
raise exc.with_traceback(tb)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/local.py", line 230, in execute_task
result = _execute_task(task, data)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/core.py", line 119, in _execute_task
return func(*args2)
File "/home/yu_liu/.local/lib/python3.6/site-packages/dask/dataframe/utils.py", line 587, in check_meta
errmsg))
ValueError: Metadata mismatch found in from_delayed.

The columns in the computed data do not match the columns in the provided metadata.
MultiIndex(levels=[['Enrichment'], ['AUC', 'Annotation', 'Context', 'MotifSimilarityQvalue', 'NES', 'OrthologousIdentity', 'RankAtMax', 'TargetGenes']],
codes=[[0, 0, 0, 0, 0, 0, 0, 0], [0, 4, 3, 5, 1, 2, 7, 6]])
:MultiIndex(levels=[['Enrichment'], ['AUC', 'Annotation', 'Context', 'MotifSimilarityQvalue', 'NES', 'OrthologousIdentity', 'RankAtMax', 'TargetGenes']],
codes=[[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6, 7]],
sortorder=0)

GRNboost worker memory usage

I might be somewhat out of place here, so I apologise for this. I am using GRNboost from the arboretum package (python). But since GRNboost github is rather centered around the scala version and GRNboost is also part of pyScenic , I give it a try here.

When running

from arboretum import algo
import pandas as pd

geneData = pd.read_csv("my-count-data.csv",index_col=[0],header=0)
network = algo.grnboost2(expression_data=geneData.T)```

among multiple warnings I get the following message:

Worker is at 89% memory usage. Pausing worker. Process memory: 5.04 GB -- Worker memory limit: 5.62 GB


as far as I understand it, this message comes from dask and can be alleviated by changing dask limit settings. But I am not sure how to do that... Shall I import dask prior to GRNboost and change the settings first? Are there any hidden options how to access dask options via GRNboost itself?
Thanks in advance!

P.S. I am running python 3.7, arboretum 0.1.3 on Ubuntu 16.04.

Error during installation

pip install .

Processing /test/software/pySCENIC-master
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-eaM7qn-build/setup.py", line 80, in
install_requires=read_requirements('requirements.txt'),
File "/tmp/pip-eaM7qn-build/setup.py", line 49, in read_requirements
with open(fname, 'r', encoding='utf-8') as file:
TypeError: 'encoding' is an invalid keyword argument for this function

----------------------------------------

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-eaM7qn-build/

error when runing adjacencies = grnboost2(ex_matrix, tf_names=tf_names, verbose=True)

Hi

I successfully run a handful datasets. But got error for the last dataset, here are the message:

adjacencies = grnboost2(ex_matrix, tf_names=tf_names, verbose=True)
preparing dask client
parsing input
/home/yu_liu/.local/lib/python3.6/site-packages/arboreto/algo.py:214: FutureWarning: Method .as_matrix will be removed in a future version. Use .values instead.
expression_matrix = expression_data.as_matrix()
creating dask graph
8 partitions
computing dask graph
distributed.comm.tcp - WARNING - Closing dangling stream in
distributed.comm.tcp - WARNING - Closing dangling stream in
distributed.comm.tcp - WARNING - Closing dangling stream in
distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
587 PDX1 NaN 4.557409
43 IKZF2 NaN 1.383575
541 EMX1 NaN 1.264551
650 ZNF300 NaN 1.249224
1023 STAT5B NaN 1.134848
1019 INSM1 NaN 1.116987
920 ZBTB43 NaN 1.111201
299 HES1 NaN 1.086385
285 ZBTB24 NaN 1.067774
1529 SP9 NaN 1.051621
298 TFDP2 NaN 1.042101
1294 MTF1 NaN 0.993883
853 MYRFL NaN 0.990080
1076 IRX5 NaN 0.980175
1322 ZNF836 NaN 0.951067
327 ETV3 NaN 0.924852
987 NHLH1 NaN 0.874245
1509 ZNF726 NaN 0.873340
170 ADNP NaN 0.849130
1438 ZXDB NaN 0.641062
1251 NKRF NaN 0.138088
59 PRDM1 NaN 0.125185
25 NME2 NaN 0.122399
711 TGIF2LX NaN 0.119234
4 SOX8 NaN 0.117549
551 TBR1 NaN 0.061086
1205 FOXD4L1 NaN 0.059487
616 ZNF787 NaN 0.041974
855 ZMAT1
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
182 KLF5 NaN 1.796901
1400 ZNF780A NaN 1.255619
113 SRCAP NaN 1.044298
1529 SP9 NaN 1.014616
1551 JRK NaN 0.969606
94 SREBF1 NaN 0.959533
497 ZNF141 NaN 0.903381
722 BATF NaN 0.891596
363 SOHLH2 NaN 0.848746
1432 ZNF813 NaN 0.833871
415 RUNX2 NaN 0.828340
966 HSFX2 NaN 0.792233
960 FOXN2 NaN 0.778318
106 NFKB2 NaN 0.763673
127 REST NaN 0.758959
534 DMTF1 NaN 0.735569
266 PRDM4 NaN 0.719243
170 ADNP NaN 0.696940
327 ETV3 NaN 0.677151
416 GCM2 NaN 0.620082
795 ANKZF1 NaN 0.582343
11 GTF2IRD1 NaN 0.567201
85 MEF2A NaN 0.508835
1071 KCMF1 NaN 0.501975
51 ZNF800 NaN 0.498035
338 PLAGL1 NaN 0.403004
256 FOXN1 NaN 0.276789
405 SNAI1
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
1315 ZNF250 NaN 1.250947
1228 SP1 NaN 1.181255
299 HES1 NaN 1.159840
1141 ZNF816 NaN 1.137491
1183 ZNF721 NaN 1.126200
694 POU4F1 NaN 1.118718
753 ZBTB8A NaN 1.084263
249 CAMTA2 NaN 1.061497
1122 ZNF664 NaN 1.051428
76 FOXJ2 NaN 0.943101
1495 ONECUT3 NaN 0.903678
316 NFE2L2 NaN 0.773948
455 PIN1 NaN 0.647856
1501 MXD3 NaN 0.642214
502 RHOXF2 NaN 0.621273
357 MXI1 NaN 0.596881
312 ATF2 NaN 0.563965
106 NFKB2 NaN 0.550881
1538 ZNF469 NaN 0.536368
1254 MYT1L NaN 0.535402
957 ATF7 NaN 0.534378
984 BPTF NaN 0.530043
600 IRF8 NaN 0.525196
415 RUNX2 NaN 0.518664
350 ZBTB45 NaN 0.505183
1600 ZNF850 NaN 0.495175
168 NFATC2 NaN 0.455970
1245 ZBTB6 NaN 0.447891
1401 ZNF461
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
662 HMBOX1 NaN 1.177350
442 IRF3 NaN 1.169355
1589 ZNF878 NaN 1.115477
283 SIM1 NaN 1.113157
407 HIF3A NaN 1.086393
1123 GATA2 NaN 1.055013
1396 ZNF595 NaN 1.046055
363 SOHLH2 NaN 1.022817
1292 SKOR1 NaN 1.020794
776 GMEB1 NaN 1.018376
169 SALL4 NaN 0.963850
837 PKNOX2 NaN 0.943171
1286 HES4 NaN 0.917107
1138 TSHZ1 NaN 0.906140
996 KLF11 NaN 0.887013
1408 ZNF823 NaN 0.870434
410 TRERF1 NaN 0.861682
29 ZBTB32 NaN 0.827065
1221 ZNF74 NaN 0.816359
243 LHX3 NaN 0.771538
1555 ZBED5 NaN 0.731618
90 MNT NaN 0.722224
1477 DPRX NaN 0.719250
287 TFEB NaN 0.624701
942 FOS NaN 0.588143
1576 HOXA10 NaN 0.326919
275 VDR NaN 0.320166
227 HOXA13 NaN 0.311231
1049 ISX
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
559 XPA NaN 1.430642
1335 ZNF124 NaN 0.973843
1047 ZNF519 NaN 0.922602
721 ZKSCAN2 NaN 0.779462
652 RBAK NaN 0.715117
1290 HMX3 NaN 0.712181
591 ESR2 NaN 0.653312
1512 MEF2B NaN 0.626067
242 CREB3 NaN 0.625131
473 SOX15 NaN 0.613608
288 TBP NaN 0.605124
1469 PBX2 NaN 0.596615
297 BCL6 NaN 0.559075
778 MYSM1 NaN 0.550524
135 ZNF343 NaN 0.546342
1360 ZNF705A NaN 0.528863
61 MXD1 NaN 0.491887
221 TFEC NaN 0.474558
137 KDM2B NaN 0.465349
1285 ZNF383 NaN 0.463501
1491 DPF3 NaN 0.450312
127 REST NaN 0.448734
1559 ZNF709 NaN 0.442962
763 ZBTB7B NaN 0.438281
363 SOHLH2 NaN 0.434157
348 NR4A3 NaN 0.433643
1246 ZNF749 NaN 0.431052
613 PRDM15 NaN 0.424422
1045 DDIT3
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
785 ATF3 NaN 4.439906e+00
41 TBPL1 NaN 2.159733e+00
589 MBNL2 NaN 9.670047e-01
764 ZNF394 NaN 9.517704e-01
145 ZFHX4 NaN 8.575002e-01
1607 ZBTB8B NaN 8.268765e-01
1435 ZNF69 NaN 8.237028e-01
209 KLF1 NaN 8.105438e-01
237 GLI3 NaN 7.734310e-01
984 BPTF NaN 7.378804e-01
963 ZNF415 NaN 7.123150e-01
895 BATF2 NaN 5.479090e-01
1305 ZNF33A NaN 5.248561e-01
686 THYN1 NaN 5.120804e-01
1132 TIGD5 NaN 5.018900e-01
801 KLF15 NaN 4.725726e-01
293 NR3C1 NaN 4.360651e-01
1048 PROP1 NaN 4.342129e-01
812 FAM170A NaN 4.338765e-01
646 CSRNP1 NaN 4.311894e-01
538 TFCP2 NaN 4.105137e-01
1379 ZNF165 NaN 3.725640e-01
967 ZNF672 NaN 3.703189e-01
82 ZFAT NaN 3.629495e-01
1486 ZNF783 NaN 3.089804e-01
251 HNF1B NaN 2.606121e-01
305 CENPA NaN 2.33
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

distributed.worker - WARNING - Compute Failed
Function: check_meta
args: ( TF target importance
662 HMBOX1 NaN 1.177350
442 IRF3 NaN 1.169355
1589 ZNF878 NaN 1.115477
283 SIM1 NaN 1.113157
407 HIF3A NaN 1.086393
1123 GATA2 NaN 1.055013
1396 ZNF595 NaN 1.046055
363 SOHLH2 NaN 1.022817
1292 SKOR1 NaN 1.020794
776 GMEB1 NaN 1.018376
169 SALL4 NaN 0.963850
837 PKNOX2 NaN 0.943171
1286 HES4 NaN 0.917107
1138 TSHZ1 NaN 0.906140
996 KLF11 NaN 0.887013
1408 ZNF823 NaN 0.870434
410 TRERF1 NaN 0.861682
29 ZBTB32 NaN 0.827065
1221 ZNF74 NaN 0.816359
243 LHX3 NaN 0.771538
1555 ZBED5 NaN 0.731618
90 MNT NaN 0.722224
1477 DPRX NaN 0.719250
287 TFEB NaN 0.624701
942 FOS NaN 0.588143
1576 HOXA10 NaN 0.326919
275 VDR NaN 0.320166
227 HOXA13 NaN 0.311231
1049 ISX
kwargs: {}
Exception: ValueError('Metadata mismatch found in from_delayed.\n\nPartition type: DataFrame\n+--------+---------+----------+\n| Column | Found | Expected |\n+--------+---------+----------+\n| target | float64 | object |\n+--------+---------+----------+',)

shutting down client and local cluster
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/sklearn/ensemble/gradient_boosting.py:1636: RuntimeWarning: invalid value encountered in true_divide
importances /= importances.sum()
finished
Traceback (most recent call last):
File "", line 1, in
File "/home/yu_liu/.local/lib/python3.6/site-packages/arboreto/algo.py", line 41, in grnboost2
early_stop_window_length=early_stop_window_length, limit=limit, seed=seed, verbose=verbose)
File "/home/yu_liu/.local/lib/python3.6/site-packages/arboreto/algo.py", line 135, in diy
.compute(graph, sync=True)
File "/home/yu_liu/.local/lib/python3.6/site-packages/distributed/client.py", line 2504, in compute
result = self.gather(futures)
File "/home/yu_liu/.local/lib/python3.6/site-packages/distributed/client.py", line 1655, in gather
asynchronous=asynchronous)
File "/home/yu_liu/.local/lib/python3.6/site-packages/distributed/client.py", line 675, in sync
return sync(self.loop, func, *args, **kwargs)
File "/home/yu_liu/.local/lib/python3.6/site-packages/distributed/utils.py", line 277, in sync
six.reraise(*error[0])
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/six.py", line 693, in reraise
raise value
File "/home/yu_liu/.local/lib/python3.6/site-packages/distributed/utils.py", line 262, in f
result[0] = yield future
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/tornado/gen.py", line 1133, in run
value = future.result()
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/tornado/gen.py", line 1141, in run
yielded = self.gen.throw(*exc_info)
File "/home/yu_liu/.local/lib/python3.6/site-packages/distributed/client.py", line 1496, in _gather
traceback)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/six.py", line 692, in reraise
raise value.with_traceback(tb)
File "/home/yu_liu/miniconda3/envs/pyscenic2/lib/python3.6/site-packages/dask/dataframe/utils.py", line 498, in check_meta
errmsg))
ValueError: Metadata mismatch found in from_delayed.

Partition type: DataFrame
+--------+---------+----------+
| Column | Found | Expected |
+--------+---------+----------+
| target | float64 | object |
+--------+---------+----------+

Extended vs. non-extended labels in pySCENIC

Hi there!

So excited to see all of this incredible work ported into Python! The performance in our hands has moved things from about a day-long computation to somewhere around half an hour—so thanks again!

One thing that I've noticed is that there are (+) and (−) labels for the regulons, but it's unclear which of these (if either?) is the extended version of the regulon. In the R version of SCENIC there are clear labels for _extended, but I'm not sure how to distinguish between these in the current iteration. Could you point me in the right direction?

Best wishes,
Wyatt

error when running : modules = list(modules_from_adjacencies(adjacencies, ex_matrix))

Hi
I am running the demo of pySCENIC, got a "Segmentation fault"

adjacencies.to_csv(ADJACENCIES_FNAME, index=False, sep='\t')

modules = list(modules_from_adjacencies(adjacencies, ex_matrix))
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.07s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.08s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.08s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.09s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.09s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.10s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.10s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
distributed.core - INFO - Event loop was unresponsive in Nanny for 3.11s. This is often caused by long-running GIL-holding functions or moving large chunks of data. This can cause timeouts and instability.
Segmentation fault
(pyscenic)

My OS is ubuntu 16.04
Here is list of packages:

packages in environment at /home/yu_liu/miniconda3/envs/pyscenic:

Name Version Build Channel

arboreto 0.1.5
attrs 18.2.0
boltons 18.0.1
ca-certificates 2018.11.29 ha4d7672_0 conda-forge
certifi 2018.11.29 py36_1000 conda-forge
Click 7.0
cloudpickle 0.7.0
cycler 0.10.0
cytoolz 0.9.0.1
dask 1.1.1
decorator 4.3.2
dill 0.2.9
distributed 1.25.3
frozendict 1.2
h5py 2.9.0
HeapDict 1.0.0
interlap 0.2.6
kiwisolver 1.0.1
libffi 3.2.1 hf484d3e_1005 conda-forge
libgcc-ng 7.3.0 hdf63c60_0 conda-forge
libstdcxx-ng 7.3.0 hdf63c60_0 conda-forge
llvmlite 0.27.0
loompy 2.0.2
matplotlib 3.0.2
msgpack 0.6.1
multiprocessing-on-dill 3.5.0a4
ncurses 6.1 hf484d3e_1002 conda-forge
networkx 2.2
numba 0.42.0
numpy 1.16.1
openssl 1.0.2p h14c3975_1002 conda-forge
pandas 0.24.1
pip 19.0.1 py36_0 conda-forge
psutil 5.5.0
pyarrow 0.12.0
pyparsing 2.3.1
pyscenic 0.9.4
python 3.6.7 hd21baee_1001 conda-forge
python-dateutil 2.7.5
pytz 2018.9
PyYAML 3.13
readline 7.0 hf8c457e_1001 conda-forge
scikit-learn 0.20.2
scipy 1.2.0
seaborn 0.9.0
setuptools 40.7.3 py36_0 conda-forge
six 1.12.0
sortedcontainers 2.1.0
sqlite 3.26.0 h67949de_1000 conda-forge
tblib 1.3.2
tk 8.6.9 h84994c4_1000 conda-forge
toolz 0.9.0
tornado 5.1.1
tqdm 4.30.0
typing 3.6.6
umap-learn 0.3.7
wheel 0.32.3 py36_0 conda-forge
xz 5.2.4 h14c3975_1001 conda-forge
zict 0.1.3
zlib 1.2.11 h14c3975_1004 conda-forge
(pyscenic)

Command line execution

pyscenic grnboost -o grnboost_output.csv --chunk_size 1 GSE60361_C1-3005-Expression.csv pySCENIC/RESOURCES_FOLDER/Mouse_TFs.txt

2018-03-26 12:39:38,247 - pyscenic.scenic - INFO - Loading expression matrix.
Traceback (most recent call last):
File "/home/hicham/.local/easybuild/software/2017/Core/miniconda3/4.3.27/bin/pyscenic", line 11, in
sys.exit(scenic())
File "/home/hicham/.local/easybuild/software/2017/Core/miniconda3/4.3.27/lib/python3.6/site-packages/pyscenic/scenic.py", line 341, in scenic
args.func(args)
File "/home/hicham/.local/easybuild/software/2017/Core/miniconda3/4.3.27/lib/python3.6/site-packages/pyscenic/scenic.py", line 104, in find_adjacencies_command
if float(n_matching_genes)/n_total_genes < 0.80:
ZeroDivisionError: float division by zero

df2regulons: KeyError: 'TF'

i have completed up through creation of the df object via:

with ProgressBar():
  df = prune2df(dbs, modules, MOTIF_ANNOTATIONS_FNAME,client_or_address="dask_multiprocessing")

then I get this KeyError:

>>> regulons = df2regulons(df, NOMENCLATURE)
Traceback (most recent call last):
  File "/usr/local/lib/python3.6/site-packages/pandas/indexes/base.py", line 2134, in get_loc
    return self._engine.get_loc(key)
  File "pandas/index.pyx", line 132, in pandas.index.IndexEngine.get_loc (pandas/index.c:4433)
  File "pandas/index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas/index.c:4279)
  File "pandas/src/hashtable_class_helper.pxi", line 732, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13742)
  File "pandas/src/hashtable_class_helper.pxi", line 740, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13696)
KeyError: 'TF'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.6/site-packages/pyscenic/transform.py", line 301, in df2regulons
    COLUMN_NAME_TYPE]))))
  File "/usr/local/lib/python3.6/site-packages/pandas/core/generic.py", line 3991, in groupby
    **kwargs)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby.py", line 1511, in groupby
    return klass(obj, by, **kwds)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby.py", line 370, in __init__
    mutated=self.mutated)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/groupby.py", line 2462, in _get_grouper
    in_axis, name, gpr = True, gpr, obj[gpr]
  File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 2059, in __getitem__
    return self._getitem_column(key)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/frame.py", line 2066, in _getitem_column
    return self._get_item_cache(key)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/generic.py", line 1386, in _get_item_cache
    values = self._data.get(item)
  File "/usr/local/lib/python3.6/site-packages/pandas/core/internals.py", line 3543, in get
    loc = self.items.get_loc(item)
  File "/usr/local/lib/python3.6/site-packages/pandas/indexes/base.py", line 2136, in get_loc
    return self._engine.get_loc(self._maybe_cast_indexer(key))
  File "pandas/index.pyx", line 132, in pandas.index.IndexEngine.get_loc (pandas/index.c:4433)
  File "pandas/index.pyx", line 154, in pandas.index.IndexEngine.get_loc (pandas/index.c:4279)
  File "pandas/src/hashtable_class_helper.pxi", line 732, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13742)
  File "pandas/src/hashtable_class_helper.pxi", line 740, in pandas.hashtable.PyObjectHashTable.get_item (pandas/hashtable.c:13696)
KeyError: 'TF'

Here's what the df object looks like:

>>> df.head()
                                                          AUC  \
TF   MotifID                                                    
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1              0.059173   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014  0.065220   
     cisbp__M5232                                    0.066279   
     cisbp__M5233                                    0.066347   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513   0.069241   

                                                                                            Annotation  \
TF   MotifID                                                                                             
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1              motif similar to transfac_public__M00139 ('V$A...   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014  motif is annotated for orthologous gene FBgn02...   
     cisbp__M5232                                    motif similar to flyfactorsurvey__tgo_sima_SAN...   
     cisbp__M5233                                    motif similar to flyfactorsurvey__tgo_sima_SAN...   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513   motif similar to flyfactorsurvey__ss_tgo_SANGE...   

                                                                                               Context  \
TF   MotifID                                                                                             
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1              (activating, mm9-500bp-upstream-10species, wei...   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014  (activating, mm9-500bp-upstream-10species, wei...   
     cisbp__M5232                                    (activating, mm9-500bp-upstream-10species, wei...   
     cisbp__M5233                                    (activating, mm9-500bp-upstream-10species, wei...   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513   (activating, mm9-500bp-upstream-10species, wei...   

                                                     MotifSimilarityQvalue  \
TF   MotifID                                                                 
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1                           0.000961   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014               0.000000   
     cisbp__M5232                                                 0.000001   
     cisbp__M5233                                                 0.000001   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513                0.000000   

                                                          NES  \
TF   MotifID                                                    
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1              3.290146   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014  3.021446   
     cisbp__M5232                                    3.109636   
     cisbp__M5233                                    3.115258   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513   3.356153   

                                                     OrthologousIdentity  \
TF   MotifID                                                               
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1                         1.000000   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014             0.479751   
     cisbp__M5232                                               0.479751   
     cisbp__M5233                                               0.479751   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513              0.479751   

                                                     RankAtMax  \
TF   MotifID                                                     
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1                   1293   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014        823   
     cisbp__M5232                                          876   
     cisbp__M5233                                          844   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513        1395   

                                                                                           TargetGenes  \
TF   MotifID                                                                                             
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1              [(March7, 0.390518704346), (Slc25a4, 0.8082596...   
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014  [(Atp6v0b, 0.346331738619), (Snx2, 0.520586224...   
     cisbp__M5232                                    [(Atp6v0b, 0.346331738619), (Tra2b, 0.52058622...   
     cisbp__M5233                                    [(Atp6v0b, 0.346331738619), (Tra2b, 0.52058622...   
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513   [(Picalm, 0.346331738619), (Snx2, 0.5205862244...   

                                                           Type  
TF   MotifID                                                     
Ahr  dbcorrdb__BRCA1__ENCSR000EBX_1__m1              activating  
Arnt flyfactorsurvey__tgo_sima_SANGER_5_FBgn0015014  activating  
     cisbp__M5232                                    activating  
     cisbp__M5233                                    activating  
     flyfactorsurvey__ss_tgo_SANGER_10_FBgn0003513   activating 

Any ideas? Thanks in advance!

error when running pySCENIC

hi, i meet the fallowing error when i run pySCENIC grnboost with command line and i have no ideal how to solve it . I need you help, thank you (expression_matrix, gene as rows and samples as columns)
code : pyscenic grnboost expression_matrix.txt human_TF.txt -o test --num_workers 40 -t

2018-03-20 15:36:45,094 - pyscenic.scenic - INFO - Loading datasets.
2018-03-20 15:37:23,391 - pyscenic.scenic - INFO - Calculating co-expression modules.
Traceback (most recent call last):
File "/datb1/wangrui/software/anaconda3/bin/pyscenic", line 11, in
sys.exit(scenic())
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/pyscenic/scenic.py", line 354, in scenic
args.func(args)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/pyscenic/scenic.py", line 138, in find_adjacencies_command
network = grnboost2(expression_data=ex_matrix, tf_names=tf_names, verbose=True, client_or_address=args.client_or_address)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/arboretum/algo.py", line 39, in grnboost2
limit=limit, seed=seed, verbose=verbose)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/arboretum/algo.py", line 105, in diy
client, shutdown_callback = _prepare_client(client_or_address)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/arboretum/algo.py", line 151, in _prepare_client
local_cluster = LocalCluster(diagnostics_port=None)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/distributed/deploy/local.py", line 97, in init
services=services)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/distributed/scheduler.py", line 392, in init
**kwargs)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/distributed/node.py", line 37, in init
deserialize=deserialize, io_loop=self.io_loop)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/distributed/core.py", line 122, in init
pc = PeriodicCallback(self._measure_tick, config.get('tick-time', 20))
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/distributed/utils.py", line 1185, in PeriodicCallback
return tornado.ioloop.PeriodicCallback(callback, callback_time, io_loop)
File "/datb1/wangrui/software/anaconda3/lib/python3.6/site-packages/tornado/ioloop.py", line 995, in init
if callback_time <= 0:
TypeError: '<=' not supported between instances of 'str' and 'int'

create() got an unexpected keyword argument 'matrix'

I was trying to export my scenic output to Scope using export2loom function. I am hitting an error here. Any help is appreciated!
Thanks in advance

input:
export2loom(ex_mtx = ex_matrix, auc_mtx = auc_mtx, regulons = regulons,cell_annotations = cell_anno, out_fname = "myloomfile.loom")

output

`Traceback (most recent call last):

File "", line 2, in
export2loom(ex_mtx = ex_matrix, auc_mtx = auc_mtx, regulons = regulons,cell_annotations = cell_anno, out_fname = "myloomfile.loom")

File "C:\Users\r0700093\AppData\Roaming\Python\Python36\site-packages\pyscenic\export.py", line 144, in export2loom
file_attrs=general_attrs)

TypeError: create() got an unexpected keyword argument 'matrix'`

Installation failure

Hello,
I tried install in by using pip install pyscenic==0.8.10, but it doesn't work. Then I got the following error:

Failed building wheel for llvmlite
Failed building wheel for numba
Command "D:\Anaconda3\python.exe -u -c "import setuptools, tokenize;file='C:\Users\Doraon\AppData\Local\Temp\pip-install-bio4th1b\llvmlite\setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record C:\Users\Doraon\AppData\Local\Temp\pip-record-126qydwj\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\Doraon\AppData\Local\Temp\pip-install-bio4th1b\llvmlite\

Hoping you can help me, thanks

negative regulons

Hello,
First, thank you for your great work!
I use pySCENIC with the command line interface and I noticed that you now keep only the modules in which the expression of the TFs is positively correlated with its target genes in the last version.
I read in the paper that it was finally decided to exclude inhibition of the workflow because it was relying on few modules of lower quality, however in my dataset "negative" regulons represent about a third of all the regulons I obtained with the precedent version and I would like to keep them.
I think it could be interesting to let the possibility for the user to keep them with an option in the pyscenic ctx command.

Best,
Léonard

Dask error on ctx step (CLI)

Using the pySCENIC 0.9.4 CLI, I get the following error on the ctx step. This seems to be related to the most recent version of dask (v1.1.0), since when I downgrade dask to version 1.0.0 this step works again with no error.

$ pyscenic ctx adj.tsv genome-ranking.feather --annotations_fname motifs.tbl --expression_mtx_fname expr_mat.tsv --mode "dask_multiprocessing" --output reg.csv

2019-01-30 16:00:32,877 - pyscenic.cli.pyscenic - INFO - Creating modules.
2019-01-30 16:00:32,887 - pyscenic.cli.pyscenic - INFO - Loading expression matrix.
/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/utils.py:138: RuntimeWarning: invalid value encountered in greater
  regulations = (rhos > rho_threshold).astype(int) - (rhos < -rho_threshold).astype(int)
/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/utils.py:138: RuntimeWarning: invalid value encountered in less
  regulations = (rhos > rho_threshold).astype(int) - (rhos < -rho_threshold).astype(int)
2019-01-30 16:00:34,026 - pyscenic.cli.pyscenic - INFO - Loading databases.
2019-01-30 16:00:34,026 - pyscenic.cli.pyscenic - INFO - Calculating regulons.
[                                        ] | 0% Completed | 12.7s
Traceback (most recent call last):
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/bin/pyscenic", line 11, in <module>
    sys.exit(main())
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 402, in main
    args.func(args)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/cli/pyscenic.py", line 155, in prune_targets_command
    num_workers=args.num_workers)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/prune.py", line 351, in prune2df
    num_workers, module_chunksize)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/pyscenic/prune.py", line 300, in _distributed_calc
    return create_graph().compute(scheduler='processes', num_workers=num_workers if num_workers else cpu_count())
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/base.py", line 156, in compute
    (result,) = compute(self, traverse=False, **kwargs)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/base.py", line 398, in compute
    results = schedule(dsk, keys, **kwargs)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/multiprocessing.py", line 192, in get
    raise_exception=reraise, **kwargs)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/local.py", line 459, in get_async
    raise_exception(exc, tb)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/compatibility.py", line 111, in reraise
    raise exc.with_traceback(tb)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/local.py", line 230, in execute_task
    result = _execute_task(task, data)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/core.py", line 119, in _execute_task
    return func(*args2)
  File "/home/luna.kuleuven.be/u0125489/chris/envs/pyscenic/lib/python3.6/site-packages/dask/dataframe/utils.py", line 587, in check_meta
    errmsg))
ValueError: Metadata mismatch found in `from_delayed`.

The columns in the computed data do not match the columns in the provided metadata.
 MultiIndex(levels=[['Enrichment'], ['AUC', 'Annotation', 'Context', 'MotifSimilarityQvalue', 'NES', 'OrthologousIdentity', 'RankAtMax', 'TargetGenes']],
           labels=[[0, 0, 0, 0, 0, 0, 0, 0], [0, 4, 3, 5, 1, 2, 7, 6]])
  :MultiIndex(levels=[['Enrichment'], ['AUC', 'Annotation', 'Context', 'MotifSimilarityQvalue', 'NES', 'OrthologousIdentity', 'RankAtMax', 'TargetGenes']],
           labels=[[0, 0, 0, 0, 0, 0, 0, 0], [0, 1, 2, 3, 4, 5, 6, 7]],
           sortorder=0)

error during export2loom

Dear,

I tried with the latest pyscenic version (0.8.13) to export the output from scenic and I am hitting an error. I am working on Windows machine with python 3.6.
input -
if __name__ == '__main__': export2loom(ex_mtx = ex_matrix, regulons = regulons,cell_annotations = cell_anno, out_fname = "myloomfile.loom")

output-
`Traceback (most recent call last):

File "", line 2, in
export2loom(ex_mtx = ex_matrix, regulons = regulons,cell_annotations = cell_anno, out_fname = "myloomfile.loom")

File "C:\ProgramData\Anaconda3\lib\site-packages\pyscenic\export.py", line 144, in export2loom
file_attrs=general_attrs)

File "C:\Users\r0700093\AppData\Roaming\Python\Python36\site-packages\loompy\loompy.py", line 838, in create
ds.ca[key] = vals

File "C:\Users\r0700093\AppData\Roaming\Python\Python36\site-packages\loompy\attribute_manager.py", line 111, in setitem
return self.setattr(name, val)

File "C:\Users\r0700093\AppData\Roaming\Python\Python36\site-packages\loompy\attribute_manager.py", line 135, in setattr
self.ds._file[a + name] = values # TODO: for 2D arrays, use block compression along columns/rows

File "C:\ProgramData\Anaconda3\lib\site-packages\h5py_hl\group.py", line 291, in setitem
ds = self.create_dataset(None, data=obj, dtype=base.guess_dtype(obj))

File "C:\ProgramData\Anaconda3\lib\site-packages\h5py_hl\group.py", line 106, in create_dataset
dsid = dataset.make_new_dset(self, shape, dtype, data, **kwds)

File "C:\ProgramData\Anaconda3\lib\site-packages\h5py_hl\dataset.py", line 100, in make_new_dset
tid = h5t.py_create(dtype, logical=1)

File "h5py\h5t.pyx", line 1519, in h5py.h5t.py_create

File "h5py\h5t.pyx", line 1541, in h5py.h5t.py_create

File "h5py\h5t.pyx", line 1563, in h5py.h5t.py_create

File "h5py\h5t.pyx", line 1476, in h5py.h5t._c_compound

File "h5py\h5t.pyx", line 1541, in h5py.h5t.py_create

File "h5py\h5t.pyx", line 1596, in h5py.h5t.py_create

TypeError: Object dtype dtype('O') has no native HDF5 equivalent`

Can someone help me here?
Thanks

NameError: free variable 'module_chunksize' referenced before assignment in enclosing scope

i realize this is getting ridiculous. prior to the upgrade i did not see this issue in prune2df. module_chunksize has a default defined in the function, so not surprisingly it doesn't matter if I provide it as an argument.

>>> with ProgressBar():
...   df = prune2df(dbs, modules, MOTIF_ANNOTATIONS_FNAME, module_chunksize=100)
... 
Traceback (most recent call last):
  File "<stdin>", line 2, in <module>
  File "/usr/local/lib/python3.6/site-packages/pyscenic/prune.py", line 387, in prune2df
    num_workers, module_chunksize)
  File "/usr/local/lib/python3.6/site-packages/pyscenic/prune.py", line 293, in _distributed_calc
    return create_graph().compute(get=get, num_workers=num_workers if num_workers else cpu_count())
  File "/usr/local/lib/python3.6/site-packages/pyscenic/prune.py", line 287, in create_graph
    for db in delayed_or_future_dbs
  File "/usr/local/lib/python3.6/site-packages/dask/dataframe/io/io.py", line 489, in from_delayed
    for df in dfs]
  File "/usr/local/lib/python3.6/site-packages/dask/dataframe/io/io.py", line 486, in <listcomp>
    dfs = [delayed(df)
  File "/usr/local/lib/python3.6/site-packages/pyscenic/prune.py", line 288, in <genexpr>
    for gs_chunk in chunked_iter(modules, module_chunksize)))
NameError: free variable 'module_chunksize' referenced before assignment in enclosing scope

Getting simplified regulons list

I used the pyscenic command line interface (CLI) and it is a bit limited in that it won't return a simple list of pruned regulons with their targets. I believe this is important for interpreting the AUC matrix of activity scores and knowing what the targets are of the transcription factors. I cobbled together some python code to get this list for downstream analysis (see below). If you could make this standard output from the `pyscenic ctx' output that would be helpful. The current 'CTX' pruned file has a non-standard means of parsing and appears to have a lot of information that is of secondary interest.

import pandas as pd
import os
from pyscenic.transform import df2regulons as df2regs
import json

# use function from pyscenic for parsing the 'pyscenic ctx' output
def _df2regulons(fname):
  ext = os.path.splitext(fname,)[1]
  df = pd.read_csv(fname, sep=',', index_col=[0,1], header=[0,1], skipinitialspace=True)
  df[('Enrichment', 'Context')] = df[('Enrichment', 'Context')].apply(lambda s: eval(s))
  df[('Enrichment', 'TargetGenes')] = df[('Enrichment', 'TargetGenes')].apply(lambda s: eval(s))
  return df2regs(df)

# Form dictionary of { TF : Target } pairs from 'pyscenic ctx' output.
rdict = {}
regulons = _df2regulons('joint_ctx.csv')
for reg in regulons:
  targets = [ target for target in reg.gene2weight ]
  rdict[reg.name] = targets

# Write to JSON for import to R
rjson = json.dumps(rdict)
f = open("regulons.json","w")
f.write(rjson)
f.close()

Then export into R with :

library(jsonlite)
regs <- read_json('regulons.json', simplify = T)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.