aertslab / pySCENIC

pySCENIC is a lightning-fast python implementation of the SCENIC pipeline (Single-Cell rEgulatory Network Inference and Clustering) which enables biologists to infer transcription factors, gene regulatory networks and cell types from single-cell RNA-seq data.
http://scenic.aertslab.org
GNU General Public License v3.0
420 stars 179 forks source link

AssertionError in _enrichment #9

Closed dschrein closed 6 years ago

dschrein commented 6 years ago

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
bramvds commented 6 years ago

Hi,

I just fixed the AssertionError in the latest release of pySCENIC 0.8.2 .

Kr, Bram