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.2.tar.gz (15.8 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.2-py3-none-any.whl (20.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pmotif_lib-1.0.2.tar.gz
  • Upload date:
  • Size: 15.8 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.2.tar.gz
Algorithm Hash digest
SHA256 caf5334af6090c4a3375cf3e446657d15f6ccc6f1f8a9c46058912ea56f54512
MD5 e17e4434d08e0fa72c5c167d7e3df4be
BLAKE2b-256 1ec1ec384af60dbd3df9933f1c95106c91ab866d32aafdb0d50d2dd6e0ee650c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pmotif_lib-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 20.3 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 da949b48b247579a952e613dc4cde6c06d09e0d31db58c9988462b17f63689ae
MD5 89cbdfe68b7fd1742ea463694a464fb6
BLAKE2b-256 f2b8b9d67145ef80d7b78c4ca90bd81c2496b35aec3566d75912cd68717cd76a

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