Skip to main content

A novel method for assessing and measuring homophily in networks

Project description

honto

HOmophily Network TOol

honto is a tool designed for assessing and measuring homophily in networks whose nodes have categorical attributes, namely when the nodes of networks come partitioned into classes.

Homophily evaluation is performed through the comparison between the relative edge density of the subgraphs, induced by each class, and the corresponding expected relative edge density under a null model.

The novelty of our approach consists in prescribing an endogenous null model, namely, the sample space of the null model is built on the input network itself. This allows us to give exact explicit expressions for the z-scores of the relative edge density of each class as well as other related statistics.

Install

The tool is available through pip and conda. Please, use one of the following commands to start working with honto:

# Install with pip
pip install honto

# Install with conda
conda install -c conda-forge honto

Please note that honto is also available as a Galaxy tool. It's wrapper is available under the official Galaxy ToolShed at https://toolshed.g2.bx.psu.edu/view/fabio/honto

Usage

Once installed, you can start running honto by specifying some arguments:

honto --input_edges ~/edges.txt \
      --input_nodes ~/nodes.txt \
      --verbose

List of standard arguments:

--input_edges           -- Path to the file with the list of edges
--input_nodes           -- Path to the file with nodes and colors
--weight_threshold      -- Threshold for considering edges based in their weight
--isolated              -- Insert isolated nodes
--nproc                 -- Make the computation of the z-scores parallel for singletons
--overwrite             -- Overwrite results if already exist
--verbose               -- Print results in real time
-v, --version           -- Print current honto version and exit

List of arguments for log-transforming z-scores:

--log_transform     -- Log-transform z-scores
--scale_factor      -- Rescale z-scores with this constant before log-transforming values
--scale_from_one    -- Set z-scores to 1 if lower than 1 before log-transforming values

List of arguments for customizing the heatmap

--cmap      -- Heatmap colormap
--vmin      -- Min value to anchor the colormap
--vmax      -- Max value to anchor the colormap
--center    -- The value at which to center the colormap when plotting divergant data
--cbar      -- Whether to draw a colorbar

Credits

Please credit our work in your manuscript by citing:

Manuscript in preparation

Nicola Apollonio, Paolo G Franciosa, and Daniele Santoni. A novel method for assessing and measuring homophily in networks through second-order statistics. Scientific reports, 12(1):1–18, 2022, https://doi.org/10.1038/s41598-022-12710-7

Contributing

Long-term discussion and bug reports are maintained via GitHub Issues, while code review is managed via GitHub Pull Requests.

Please, (i) be sure that there are no existing issues/PR concerning the same bug or improvement before opening a new issue/PR; (ii) write a clear and concise description of what the bug/PR is about; (iii) specifying the list of steps to reproduce the behavior in addition to versions and other technical details is highly recommended.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

honto-0.1.1.tar.gz (10.9 kB view details)

Uploaded Source

File details

Details for the file honto-0.1.1.tar.gz.

File metadata

  • Download URL: honto-0.1.1.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.8.2 requests/2.22.0 setuptools/45.2.0.post20200210 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.6

File hashes

Hashes for honto-0.1.1.tar.gz
Algorithm Hash digest
SHA256 bea61abd9003215dbfdbeb364d18920a62bb2861843c328d61b5edc6d2798e6d
MD5 5487696ac3ad8c79dbe5ded28d6a54e9
BLAKE2b-256 e7109c70dc33b5752ff188a20e33c79b94d8fd294ef2e8598fc3f932240ee9c8

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page