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.1.tar.gz (16.0 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.1-py3-none-any.whl (20.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pmotif_lib-1.0.1.tar.gz
  • Upload date:
  • Size: 16.0 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.1.tar.gz
Algorithm Hash digest
SHA256 e144e073049651599e0218b34edb93d5e31350ed250dda4af213c705aabda848
MD5 301ba84336cea351b2f080274bfe2b13
BLAKE2b-256 0184179e3cbf24d3c4e6a05943bd28e39560e4cd03b5c3e2b6c2a6b88b9e2eb3

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmotif_lib-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 20.7 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 6fffcd118e23bc0463e1e66f935b4b2450ec780727062fda9bb10130d70d45fd
MD5 fc20b69f588e3ecbae70790f8eadf14c
BLAKE2b-256 edcd0292000c82de13c5663772d13d4321a0ab1d3f214612225c8fde062413f5

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