Skip to content

Python interface to the motif counting algorithms mfinder, fanmod, pgd, NetMODE

License

Notifications You must be signed in to change notification settings

aanastasiou/pymotifcounter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

79 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyMotifCounter

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

About

Python interface to the motif counting algorithms mfinder, fanmod, pgd, NetMODE

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages