GithubHelp home page GithubHelp logo

barahona-research-group / pygenstability Goto Github PK

View Code? Open in Web Editor NEW
28.0 28.0 12.0 19.54 MB

PyGenStability: Multiscale community detection with generalized Markov Stability

Home Page: https://barahona-research-group.github.io/PyGenStability/

License: GNU General Public License v3.0

Python 2.90% C++ 97.08% C 0.02%
clustering community-detection leiden-algorithm louvain-algorithm multiscale python3

pygenstability's People

Contributors

agosztolai avatar arnaudon avatar cellassembly avatar d-schindler avatar mauriciobarahona avatar michaelschaub avatar peach-lucien avatar zj-liu 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

Watchers

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

pygenstability's Issues

ttprime

update the ttprime computation with tqdm + desactivating flag, etc...

AttributeError: no attribute 'run_louvain' upon installation

How to reproduce:

  1. Create and activate a new conda (v4.8.3) environment with Python (v3.8.3) installation.
  2. Run $ conda install pybind11 pyparsing six
  3. Clone the PyGenStability repository
  4. Run $ pip install . while in the cloned repository
  5. Copy the contents of the subfolder examples to the top level directory
  6. Run $ python simple_example.py
Traceback (most recent call last):
  File "simple_example.py", line 25, in <module>
    simple_test()
  File "simple_example.py", line 14, in simple_test
    all_results = run(graph)
  File "/home/benedikt/pygenstability/PyGenStability/pygenstability/pygenstability.py", line 119, in run
    louvain_results = run_several_louvains(
  File "/home/benedikt/pygenstability/PyGenStability/pygenstability/pygenstability.py", line 251, in run_several_louvains
    list(pool.imap_unordered(worker, range(n_runs), chunksize=chunksize))
  File "/home/benedikt/anaconda3/envs/pygen_env/lib/python3.8/multiprocessing/pool.py", line 448, in <genexpr>
    return (item for chunk in result for item in chunk)
  File "/home/benedikt/anaconda3/envs/pygen_env/lib/python3.8/multiprocessing/pool.py", line 868, in next
    raise value
AttributeError: module 'pygenstability.generalized_louvain' has no attribute 'run_louvain'

add tests

the code is not tested, some tests would be nice

possible speed ups

Precompute the Laplacian and null model once at the start, not every time call of exponential

Allow to bypass louvain install

On windows, it may be hard to install do to pthread.h issue, so maybe we can allow to not instal louvain, and rather use leiden.

scale selection at margins of domain

The current scale selection criterion is not reliable at the margins of the domain of Markov scale t due to:

  1. Cut-off through windowing
  2. The diagonal count of low values in the NVI(t,t') necessarily leads to smaller values at the margins because the diagonal is smaller. Hence, 1-NVI(t,.) tends to produce anomalous local minima at the margins.

While 1) is perhaps acceptable, Mauricio and me discussed that we should come up with a solution for 2). I will think about this and try a couple of things.

installing bug

in the process of install pygenstability, i have the following problems:
can you help me to solve it?
building 'pygenstability.generalized_louvain' extension
C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -Iextra -ID:\Install_software\Anaconda\envs\tensorflow\lib\site-packages\pybind11\include -ID:\Install_software\Anaconda\envs\tensorflow\include -ID:\Install_software\Anaconda\envs\tensorflow\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\include" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\ucrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\shared" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\um" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\winrt" "-IC:\Program Files (x86)\Windows Kits\10\include\10.0.19041.0\cppwinrt" /EHsc /Tppygenstability/generalized_louvain/generalized_louvain.cpp /Fobuild\temp.win-amd64-3.7\Release\pygenstability/generalized_louvain/generalized_louvain.obj /EHsc /bigobj -std=c++11
cl: 命令行 warning D9002 :忽略未知选项“-std=c++11”
generalized_louvain.cpp
extra\lemon/bits/lock.h(24): fatal error C1083: 无法打开包括文件: “pthread.h”: No such file or directory
error: command 'C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Tools\MSVC\14.29.30133\bin\HostX86\x64\cl.exe' failed with exit status 2

Memory issue for large directed graphs

Hello,
I'am trying to use the package on a big network (around 170000 nodes).
However, when I call the contractor:

defining the constructor externally

directed_constructor = constructors.load_constructor('directed', adjacency, alpha=0.85)

I get the following error:
Unable to allocate 241. GiB for an array with shape (179783, 179783) and data type float6

Is there a way to avoid it?

Moreover, could i give as input a weighted adj matrix?

Thanks a lot

pyyaml install

We are currently forcing pyyaml as a dependency, however, some people are experiencing a bug that PyYAML cannot be uninstalled (to then update) because its a distutils installed project.

plotting with plotly.py

Seems ok to use, and provides interactive plots so that we can click on the community structure for example.

doc

Make a nice documentation with an associated website (using sphinx)

backend issue

In the line 208 of plotting.py:matplotlib.use("TkAgg")
Not everyone uses the tkagg.

Maybe before matplotlib.use("Agg"),
let b = matplotlib.get_backend()
then matplotlib.use(b), instead of matplotlib.use("TkAgg")

update cli

Make sure cli is up to date, and does not use pickle, but better format for large graphs

modularity

The value for modularity/stability is behaving strangely, need to investigate that.

improve sankey diagram

the sankey diagram ploting function works but is rudimentary. Some work to improve it is needed

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.