Skip to main content

A simple wrapper for graph motif counting algorithms

Project description

A unified Python interface to fast motif enumeration algorithms such as:

  • mfinder

  • fanmod

  • NetMODE

  • PGD

A typical usage example is as follows:

"""
Visualise the distribution of size-3 motifs.
"""

from pymotifcounter.concretecounters import PyMotifCounterMfinder
from matplotlib import pyplot as plt
from networkx import watts_strogatz_graph

if __name__ == "__main__":
    # Create an example network
    g = watts_strogatz_graph(100, 8, 0.2)
    # Create a motif counter based on mfinder
    motif_counter = PyMotifCounterMfinder()
    # Enumerate motifs using the selected counter
    g_mtf_count = motif_counter(g)
    # Visualise the distribution
    g_mtf_count.plot.bar("motif_id", "nreal")
    plt.tight_layout()
    plt.show()

Which would produce the following distribution:

https://github.com/aanastasiou/pymotifcounter/blob/main/doc/source/resources/figures/fig_dist_motif_3.png?raw=true

Installation

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

pymotifcounter-1.0.1-py3-none-any.whl (551.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymotifcounter-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 551.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.0

File hashes

Hashes for pymotifcounter-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5fa4d6f98eb1fcf6eabbfe93d856a6fa78b8c8a4429a7cb229f011581ee93d8e
MD5 c212ad2b3822881ab33c6b4a2380dcc4
BLAKE2b-256 cea48dab1b8cb6debb74531c795636e8d57877d4232f08ad95a760ba49a40653

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