Giter VIP home page Giter VIP logo

hidef's Introduction

HiDeF (Hierarchical community Decoding Framework)

Introduction

A package for resolving the hierarchical structures of networks based on multiscale community detection.

Corresponding to a paper submitted to ISMB 2020:
Robust and flexible decoding of multiscale structures in complex network data, S Zhang*, F Zheng*, I Bahar, T Ideker. (* equal contribution)

There are two main components of the scripts: finder.py and weaver.py

Detailed documentations are coming.

Dependencies (with tested versions)

networkx 2.3
python-igraph 0.7.1
louvain-igraph 0.6.1
leidenalg 0.7.0
numpy
scipy
pandas

Usage

Hierarchical view

The following example shows how to obtain a hierarchical view of given data points using HiDeF.

First, the user needs to provide the clustering results on these data points. These results may be obtained from any multilevel clustering algorithm of user's choice. In this example, suppose we have 8 data points and define 7 ways of partitioning them (in a Python terminal),

>>> P = ['11111111',
...      '11111100',
...      '00001111',
...      '11100000',
...      '00110000',
...      '00001100',
...      '00000011']

The labels of these nodes are assigned as follows (optional):

>>> nodes = 'ABCDEFGH'

Then the hierarchical view can be obtained by

>>> weaver = Weaver(P, boolean=True, terminals=nodes, assume_levels=False)
>>> T = weaver.weave(cutoff=0.9, top=10)

The hierarchy is represented by a networkx.DiGraph object, which can be obtained by querying T.hier. T also contains a lot of useful functions for extracting useful information about the hierarchy.

Optimal resolution

To identify the optimal Louvain modularity of a graph, simply run the following command in a terminal:

python finder.py --g $graph --n $n [--options]

$graph: a tab delimited file with 2-3 columns: nodeA, nodeB, weight (optional).

$n: the upper limit of the sampled range of the resolution parameter.

hidef's People

Contributors

fanzheng10 avatar shz66 avatar

Watchers

 avatar

Forkers

fanzheng10

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.