Giter VIP home page Giter VIP logo

champ's Introduction

CHAMP (Convex Hull of Admissible Modularity Partitions

A modularity based tool for screening a set of partitions.

docs/sub_docs/images/graphs_all_three.png

The CHAMP python package provides two levels of functionality:

  • Identifying the subset of partitions from a group of partitions (regardless of how they were discovered) with optimal modularity. See Running.
  • Parallelized implementation of modularity based community detection method, louvain with efficient filtering (ala CHAMP), management, and storage of the generated partitions. See Louvain Parallel Extension .
For complete documentation, please visit our ReadTheDocs page:
http://champ.readthedocs.io/en/latest/

Download and Installation:

The CHAMP module is hosted on PyPi. The easiest way to install is via the pip command:

pip install champ

For installation from source, the latest version of champ can be downloaded from GitHub:

https://github.com/wweir827/CHAMP

For basic installation:

python setup.py install

Dependencies

Most of the dependencies for CHAMP are fairly standard tools for data analysis in Python, with the exception of louvain_igraph. They include :

  • NumPy : Python numerical analysis library.
  • sklearn :Machine learning tools for python.
  • python-igraph :igraph python version for manipulation of networks.
  • matplotlib :Python data visualization library.
  • louvain :Vincent Traag's implementation of louvain algorithm.
  • h5py : HDF5 file format library for python.

These should all be handled automatically if using pip to install.

Citation

Please cite:

1. William H. Weir, Scott Emmons, Ryan Gibson, Dane Taylor, and Peter J. Mucha. Post-processing partitions to identify domains of modularity optimization. Algorithms, 2017. URL: http://www.mdpi.com/1999-4893/10/3/93, doi:10.3390/a10030093.

2. William H. Weir, Ryan Gibson, and Peter J Mucha. Champ package: Convex Hull of Admissible Modularity Partitions in python and matlab. 2017. https://github.com/wweir827/CHAMP.

bibtex

For more details and results see our preprint

Acknowledgements

This project was supported by the James S. McDonnell Foundation 21st Century Science Initiative -Complex Systems Scholar Award grant #220020315, by the National Institutes of Health through Award Numbers R01HD075712, R56DK111930 and T32GM067553, and by the CDC Prevention Epicenter Program. The content is solely the responsibility of the authors and does not necessarily represent the official views of the funding agencies.

champ's People

Contributors

jessime avatar kevinstubbs avatar ragibson avatar wweir827 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

Watchers

 avatar  avatar  avatar

champ's Issues

Dependency causing TypeError

Running champ.parallel_louvain crashes with:

TypeError: find_partition() missing 1 required positional argument: 'partition_type'

This is because louvain-igraph has had some API changes. The fix should be easy though. I think you need to update louvain_ext.py (line 1281) to be:

rp = louvain.find_partition(gr, louvain.RBConfigurationVertexPartition, weight=weight,  resolution_parameter=gamma)

parallel_louvain progress

I'd like to be able to select how often I print progress while running parallel_louvain. Because my networks are so large, printing every 100 runs doesn't make sense, since I'm usually doing about 100 runs total. I'll submit a pull request for this feature.

Getting TypeError function takes at most 2 arguments (3 given)

Interesting work by the author. I am not sure whether support is still provided for this package.

When running the script test_champ.py, the compiler return an error
Getting TypeError function takes at most 2 arguments (3 given)

The full traceback is as below

  0%|          | 0/10 [00:00<?, ?it/s]
0it [00:00, ?it/s]
  0%|          | 0/10 [00:00<?, ?it/s]
multiprocessing.pool.RemoteTraceback: 
"""
Traceback (most recent call last):
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/multiprocessing/pool.py", line 119, in worker
    result = (True, func(*args, **kwds))
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/site-packages/champ/leiden_ext.py", line 128, in _run_leiden_parallel
    attribute=attribute,output_dictionary=True,niterations=niterations)
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/site-packages/champ/leiden_ext.py", line 58, in run_leiden
    g = ig.Graph.Read_GraphMLz(gfile)
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/site-packages/igraph/__init__.py", line 2315, in Read_GraphMLz
    return cls.Read_GraphML(tmpfile, directed=directed, index=index)
TypeError: function takes at most 2 arguments (3 given)
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/rpb/PycharmProjects/champ_test/test_champ.py", line 325, in <module>
    main()
  File "/home/rpb/PycharmProjects/champ_test/test_champ.py", line 321, in main
    test_parallel_run()
  File "/home/rpb/PycharmProjects/champ_test/test_champ.py", line 30, in test_parallel_run
    progress=True,calc_sim_mat=False)
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/site-packages/champ/leiden_ext.py", line 214, in parallel_leiden
    for i, res in tqdm.tqdm(enumerate(pool.imap(_run_leiden_parallel, parallel_args)), miniters=tot):
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/site-packages/tqdm/std.py", line 1180, in __iter__
    for obj in iterable:
  File "/home/rpb/anaconda3/envs/champ_test/lib/python3.6/multiprocessing/pool.py", line 735, in next
    raise value
TypeError: function takes at most 2 arguments (3 given)

Process finished with exit code 1

Other information

Ubuntu 20.04
Python 3.6 run on Pycharm

Appreciate for your assistance @wweir827

Error trying to run parallel louvain implementation

Hi,

I am attempting to run the tutorial code under Partition Ensemble Example but when I try to run the champ.parallel_louvain command, I get this error message:

Traceback (most recent call last):

File "", line 5, in
progress=True)

File "/Users/wilxl8/anaconda3/lib/python3.6/site-packages/champ/louvain_ext.py", line 1337, in parallel_louvain
parts_list_of_list=pool.map(_run_louvain_parallel, parallel_args )

File "/Users/wilxl8/anaconda3/lib/python3.6/multiprocessing/pool.py", line 266, in map
return self._map_async(func, iterable, mapstar, chunksize).get()

File "/Users/wilxl8/anaconda3/lib/python3.6/multiprocessing/pool.py", line 644, in get
raise self._value

TypeError: find_partition() missing 1 required positional argument: 'partition_type'

I have tried to resolve the issue myself but can't seem to find the problem. Could you help me with this issue?

Thank you,
Brady Williamson

README typo

"partitoins" should probably be partitions, right?

Performance regression

I haven't had a chance to look too much into this, but I just updated CHAMP for the first time since ~ March. Based on "Return time", it looks like parallel_louvain is running 2-4x slower than it was. Is there any explanation for this?

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.