hidef


Namehidef JSON
Version 1.1.5 PyPI version JSON
download
home_pagehttps://github.com/fanzheng10/HiDeF
SummaryA package for building a hierarchy based on multiple partitions on graph nodes.
upload_time2024-01-30 23:01:53
maintainer
docs_urlNone
authorFan Zheng, She Zhang
requires_python>=3.6, <4
license
keywords hierarchy tree dag
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # HiDeF (Hierarchical community Decoding Framework)
[![Documentation Status](https://readthedocs.org/projects/hidef/badge/?version=latest)](https://hidef.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://pepy.tech/badge/hidef/month)](https://pepy.tech/project/hidef)

<img src="https://github.com/fanzheng10/HiDeF/blob/master/fig1.png?raw=true" width="400">

## Introduction

HiDeF is a method for robustly resolving the hierarchical structures of networks based on multiscale community detection and the concepts of persistent homology. 

HiDeF is described in the following manuscript:  

Zheng, F., Zhang, S., Churas, C. et al., [HiDeF: identifying persistent structures in multiscale ‘omics data](https://doi.org/10.1186/s13059-020-02228-4). Genome Biol 22, 21 (2021).

## Updates

- `1.1.5` Fixed bug where ``_tmp`` edge list temp files collide if multiple instances of ``hidef_finder.py`` are run on same machine. 
          Made small fix to ``jaccard_matrix`` to handle scipy breaking [change](https://github.com/fanzheng10/HiDeF/commit/3dc6225cc67e59126b5b168996fb9718ea73d264)  

- `1.1.4` Add [Colab notebooks](https://github.com/fanzheng10/HiDeF/blob/master/analysis/protein_interaction_network_app.ipynb) allowing quick exploration of HiDeF results - now applicable to models based on protein-protein interaction network.  
- `1.1.3` Stable release around the time of paper publication, the first version available with `pip`.  

## Installation (Python package)

With pip:  
`pip install hidef`

From source:  
`python setup.py install`

## Usage

### Running HiDeF from Cytoscape

Best for small/medium networks < 10k nodes and < 50k edges.

HiDeF has been fully integrated with the [Cytoscape](https://cytoscape.org/) platform, via our recently published [Community Detection APplication and Service (CDAPS)](https://doi.org/10.1371/journal.pcbi.1008239) framework.

With this option users can access unique features in the CDAPS framework, including (1) interacting with the source network to visualize the subnetwork of any detected community (2) performing gene set enrichment analysis (when the vertices of the source network are proteins/genes) (3) sharing the models via the [NDEx](http://www.ndexbio.org/) database.

### Running HiDeF as a command-line tool

First, install the package as instructed above.

Using the codes in this repository, HiDeF can be used as a command-line tool. There are two main components of the scripts: `hidef_finder.py` and `weaver.py`.

To sweep the resolution profile and generate an optimized hierarchy based on pan-resolution community persistence, run the following command in a terminal: 

`python hidef_finder.py --g $graph --maxres $n --o $out [--options]`

- `$graph`: a tab delimited file with 2-3 columns: nodeA, nodeB, weight (optional).
- `$maxres`: the upper limit of the sampled range of the resolution parameter.
- `$out`: a prefix string for the output files.  

Other auxiliary parameters are explained in the manuscript.


#### Outputs
- `$out.nodes`: A TSV file describing the content (nodes in the input network) of each community. The last column of this file contains the persistence of each community.  
- `$out.edges`: A TSV file describing the parent-child relationships of communities in the hierarchy. The parent communities are in the 1st column and the children communities are in the 2nd column.  
- `$out.gml`: A file in the GML format that can be opened in Cytoscape to visualize the hierarchy (using "yFiles hierarchic layout" in Cytoscape)


### Using HiDeF as a python package

For documents, please see [https://hidef.readthedocs.io](https://hidef.readthedocs.io).

The following example shows how to build a hierarchical view of a network based on pre-computed communities, by using HiDeF as a Python package. This workflow only involves `weaver.py`.

First, the user needs to provide the clustering results on these data points. These results may be obtained from any multilevel clustering algorithm of the 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']
```

Then the hierarchical view can be obtained by

```
from hidef import weaver
wv = weaver.Weaver()
H = wv.weave(P, cutoff=1.0)
```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/fanzheng10/HiDeF",
    "name": "hidef",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.6, <4",
    "maintainer_email": "",
    "keywords": "hierarchy tree DAG",
    "author": "Fan Zheng, She Zhang",
    "author_email": "fanzheng1101@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/a1/75/84aa89f8630879b73bc8332fb7b248077b752c8ca806e1dead8631d81dbb/hidef-1.1.5.tar.gz",
    "platform": null,
    "description": "# HiDeF (Hierarchical community Decoding Framework)\n[![Documentation Status](https://readthedocs.org/projects/hidef/badge/?version=latest)](https://hidef.readthedocs.io/en/latest/?badge=latest)\n[![Downloads](https://pepy.tech/badge/hidef/month)](https://pepy.tech/project/hidef)\n\n<img src=\"https://github.com/fanzheng10/HiDeF/blob/master/fig1.png?raw=true\" width=\"400\">\n\n## Introduction\n\nHiDeF is a method for robustly resolving the hierarchical structures of networks based on multiscale community detection and the concepts of persistent homology. \n\nHiDeF is described in the following manuscript:  \n\nZheng, F., Zhang, S., Churas, C. et al., [HiDeF: identifying persistent structures in multiscale \u2018omics data](https://doi.org/10.1186/s13059-020-02228-4). Genome Biol 22, 21 (2021).\n\n## Updates\n\n- `1.1.5` Fixed bug where ``_tmp`` edge list temp files collide if multiple instances of ``hidef_finder.py`` are run on same machine. \n          Made small fix to ``jaccard_matrix`` to handle scipy breaking [change](https://github.com/fanzheng10/HiDeF/commit/3dc6225cc67e59126b5b168996fb9718ea73d264)  \n\n- `1.1.4` Add [Colab notebooks](https://github.com/fanzheng10/HiDeF/blob/master/analysis/protein_interaction_network_app.ipynb) allowing quick exploration of HiDeF results - now applicable to models based on protein-protein interaction network.  \n- `1.1.3` Stable release around the time of paper publication, the first version available with `pip`.  \n\n## Installation (Python package)\n\nWith pip:  \n`pip install hidef`\n\nFrom source:  \n`python setup.py install`\n\n## Usage\n\n### Running HiDeF from Cytoscape\n\nBest for small/medium networks < 10k nodes and < 50k edges.\n\nHiDeF has been fully integrated with the [Cytoscape](https://cytoscape.org/) platform, via our recently published [Community Detection APplication and Service (CDAPS)](https://doi.org/10.1371/journal.pcbi.1008239) framework.\n\nWith this option users can access unique features in the CDAPS framework, including (1) interacting with the source network to visualize the subnetwork of any detected community (2) performing gene set enrichment analysis (when the vertices of the source network are proteins/genes) (3) sharing the models via the [NDEx](http://www.ndexbio.org/) database.\n\n### Running HiDeF as a command-line tool\n\nFirst, install the package as instructed above.\n\nUsing the codes in this repository, HiDeF can be used as a command-line tool. There are two main components of the scripts: `hidef_finder.py` and `weaver.py`.\n\nTo sweep the resolution profile and generate an optimized hierarchy based on pan-resolution community persistence, run the following command in a terminal: \n\n`python hidef_finder.py --g $graph --maxres $n --o $out [--options]`\n\n- `$graph`: a tab delimited file with 2-3 columns: nodeA, nodeB, weight (optional).\n- `$maxres`: the upper limit of the sampled range of the resolution parameter.\n- `$out`: a prefix string for the output files.  \n\nOther auxiliary parameters are explained in the manuscript.\n\n\n#### Outputs\n- `$out.nodes`: A TSV file describing the content (nodes in the input network) of each community. The last column of this file contains the persistence of each community.  \n- `$out.edges`: A TSV file describing the parent-child relationships of communities in the hierarchy. The parent communities are in the 1st column and the children communities are in the 2nd column.  \n- `$out.gml`: A file in the GML format that can be opened in Cytoscape to visualize the hierarchy (using \"yFiles hierarchic layout\" in Cytoscape)\n\n\n### Using HiDeF as a python package\n\nFor documents, please see [https://hidef.readthedocs.io](https://hidef.readthedocs.io).\n\nThe following example shows how to build a hierarchical view of a network based on pre-computed communities, by using HiDeF as a Python package. This workflow only involves `weaver.py`.\n\nFirst, the user needs to provide the clustering results on these data points. These results may be obtained from any multilevel clustering algorithm of the user's choice. In this example, suppose we have 8 data points and define 7 ways of partitioning them (in a Python terminal), \n\n```\nP = ['11111111',\n  '11111100',\n  '00001111',\n  '11100000',\n  '00110000',\n  '00001100',\n  '00000011']\n```\n\nThen the hierarchical view can be obtained by\n\n```\nfrom hidef import weaver\nwv = weaver.Weaver()\nH = wv.weave(P, cutoff=1.0)\n```\n\n\n",
    "bugtrack_url": null,
    "license": "",
    "summary": "A package for building a hierarchy based on multiple partitions on graph nodes.",
    "version": "1.1.5",
    "project_urls": {
        "Bug Reports": "https://github.com/fanzheng10/HiDeF/issues",
        "Homepage": "https://github.com/fanzheng10/HiDeF",
        "Source": "https://github.com/fanzheng10/HiDeF"
    },
    "split_keywords": [
        "hierarchy",
        "tree",
        "dag"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "21c30977e55bfc74479fc1ea4aea6d553b2b6dffb3ae9c2176097b6ef244be7d",
                "md5": "a570b8e4a304fe04da66375fddd0f0ad",
                "sha256": "9af01b44ac4d1166e3082c8950e164a317c01440aff8a62a0bcffb4d47cf8c55"
            },
            "downloads": -1,
            "filename": "hidef-1.1.5-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "a570b8e4a304fe04da66375fddd0f0ad",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.6, <4",
            "size": 38997,
            "upload_time": "2024-01-30T23:01:51",
            "upload_time_iso_8601": "2024-01-30T23:01:51.308862Z",
            "url": "https://files.pythonhosted.org/packages/21/c3/0977e55bfc74479fc1ea4aea6d553b2b6dffb3ae9c2176097b6ef244be7d/hidef-1.1.5-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a17584aa89f8630879b73bc8332fb7b248077b752c8ca806e1dead8631d81dbb",
                "md5": "d9f2e230c7923c6b8899d6e44ee90218",
                "sha256": "06710d30f15cb29f28ad60d3345f51d38e119692eb4fdb602009a06f803601aa"
            },
            "downloads": -1,
            "filename": "hidef-1.1.5.tar.gz",
            "has_sig": false,
            "md5_digest": "d9f2e230c7923c6b8899d6e44ee90218",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.6, <4",
            "size": 30379,
            "upload_time": "2024-01-30T23:01:53",
            "upload_time_iso_8601": "2024-01-30T23:01:53.728971Z",
            "url": "https://files.pythonhosted.org/packages/a1/75/84aa89f8630879b73bc8332fb7b248077b752c8ca806e1dead8631d81dbb/hidef-1.1.5.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-01-30 23:01:53",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "fanzheng10",
    "github_project": "HiDeF",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "requirements": [],
    "lcname": "hidef"
}
        
Elapsed time: 0.17680s