brianhie / trajectorama

Multi-study integration of cellular trajectories
http://trajectorama.csail.mit.edu
MIT License
18 stars 3 forks source link

Can't use custom louvain module #9

Closed emdann closed 4 years ago

emdann commented 4 years ago

Hi, just wanted to report that I am having problems with using the custom louvain module. I am trying to use the PanDAG function for panresolution clustering, but I encounter this error:

Traceback (most recent call last):
  File "/home/jovyan/my-conda-envs/emma_env/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/home/jovyan/.local/lib/python3.7/site-packages/joblib/_parallel_backends.py", line 600, in __call__
    return self.func(*args, **kwargs)
  File "/home/jovyan/.local/lib/python3.7/site-packages/joblib/parallel.py", line 256, in __call__
    for func, args, kwargs in self.items]
  File "/home/jovyan/.local/lib/python3.7/site-packages/joblib/parallel.py", line 256, in <listcomp>
    for func, args, kwargs in self.items]
  File "/nfs/team205/ed6/trajectorama/trajectorama/pan_dag.py", line 22, in louvain_worker
    log_fname=tmp_log_fname)
  File "/nfs/team205/ed6/trajectorama/trajectorama/_louvain.py", line 135, in louvain
    **partition_kwargs,
  File "/home/jovyan/my-conda-envs/emma_env/lib/python3.7/site-packages/louvain/functions.py", line 76, in find_partition
    **kwargs)
TypeError: __init__() got an unexpected keyword argument 'log_fname'

I followed the installation instructions in the README, but I suspect this might have something to do with my code importing the wrong louvain package.

I had to create a fresh conda environment installing scanpy v1.4.6 without the python-igraph and louvain modules and now I get no errors.

Maybe improving installation instructions or flagging this as a potential issue could be helpful for quick debugging.

brianhie commented 4 years ago

Thanks @emdann! Making sure I understand properly, but you were able to get the custom Louvain working within a fresh conda env where python-igraph and louvain weren't installed from the main versions? Why would also excluding python-igraph be necessary? If so I can definitely add to that to the README!

emdann commented 4 years ago

Hi @brianhie

Making sure I understand properly, but you were able to get the custom Louvain working within a fresh conda env where python-igraph and louvain weren't installed from the main versions?

Yes, that's right.

Why would also excluding python-igraph be necessary?

Maybe it's not. I just removed it as suggested on the Troubleshooting section of the louvain README

brianhie commented 4 years ago

Great, can you take a look at https://github.com/brianhie/trajectorama/pull/11/files?