Skip to main content

Perform motif detection, either with traditional frequency, or with positional metrics for each graphlet occurrence.

Project description

pmotif_lib

Perform motif detection, either with traditional frequency, or with positional metrics for each graphlet occurrence.

This library implements each step of a (p)motif detection pipeline such as

  • graphlet detection in networks
  • randomization of networks
  • frequency comparison of graphlet occurrences
  • positional metric comparison of graphlet occurrences.

Setup

Install this package:

pip install pmotif-lib

This library relies on the gtrieScanner tool. Please download it, compile it, and add the executable to your path.

Finally, this library loads environment variables. Create an .env file::

export DATASET_DIRECTORY=/path/where/edgelists/are/located
export EXPERIMENT_OUT=/path/where/raw/graphlets/and/pmetric/should/go
export GTRIESCANNER_EXECUTABLE=/path/to/the/gtriescanner/executable
export WORKERS=1  # Optional, controls the max. degree of parallelization

In order to make these variablea available to the library, use source .env before command line usage! You can also use the python-dotenv package to load the .env file from python code:

from dotenv import load_dotenv

load_dotenv(".env")

Usage

showcase/ contains a number of examples:

  • graphlet detection
  • p-graphlet detection
  • motif detection
  • p-motif detection

After installing pmotif_lib, navigate into showcase/, run source .showcase_env, and then run python3 graphlet_detection (or one of the other examples). This expects the gtrieScanner executable to be in your system's path under gtrieScanner!

Glossary

  • Induced Subgraph: A graph created by cutting out a set of nodes from a graph G, retaining all edges between these nodes
  • Isomorphic graphs: Graphs, that are structurally the same when ignoring node labels
  • Isomorphic Classes of Size k: A set of graphs with k nodes, so that every other graph with k nodes is isomorphic to one graph in the set
  • k-Graphlet: An isomorphic class of size k, so that at least one induced subgraph in a graph G is isomorphic to that class
  • Graphlet Occurrences: All induced sub-graphs in a graph G that belong to a specific k-Graphlet
  • Graphlet Frequency: The number of graphlet occurrences of a specific k-graphlet in a graph G
  • Graph Motif: A k-Graphlet, which has a graphlet frequency which is significantly higher than expected, usually tested against randomized graphs generated based on G
  • p-Motif: A k-Graphlet, which has graphlet occurrences with a significant expression of a positional metric, when compared against randomized graphs generated based on G

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

pmotif_lib-1.0.0.tar.gz (15.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pmotif_lib-1.0.0-py3-none-any.whl (20.6 kB view details)

Uploaded Python 3

File details

Details for the file pmotif_lib-1.0.0.tar.gz.

File metadata

  • Download URL: pmotif_lib-1.0.0.tar.gz
  • Upload date:
  • Size: 15.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pmotif_lib-1.0.0.tar.gz
Algorithm Hash digest
SHA256 e02af1a5259f075366439525acc0b6ae38b6514bd03f3f5b04983eeff1f9dafe
MD5 2860eb8478114f39fbe7b228ab60fe4b
BLAKE2b-256 7dad4c7af9167ab15ca5ddb57100fd9d63828afe6982e88736c5f31d7536ea15

See more details on using hashes here.

File details

Details for the file pmotif_lib-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pmotif_lib-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 20.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.6

File hashes

Hashes for pmotif_lib-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0e9ecf02087fffe1926757a9b26e475f563c6a8b215cf5ca21337f94b6329809
MD5 cbd197d4a4d1b9a472f1394197889ec0
BLAKE2b-256 22a6f7f9bf513990aa20507718a98307c8c2329a725d8d671ebbc7d878775d34

See more details on using hashes here.

Supported by

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