<p align="center">
<img align="center" src="https://user-images.githubusercontent.com/693511/117350563-b58b9900-ae7a-11eb-83ce-9f5f9213145e.png" / width="25%">
<h1 align="center" fontsize="2em">d o t m o t i f</h1>
</p>
<p align="center">Find graph motifs using intuitive notation</p>
<p align="center">
<a href="https://pypi.org/project/dotmotif/"><img alt="PyPI" src="https://img.shields.io/pypi/v/dotmotif?style=for-the-badge"></a>
<a href="https://bossdb.org/tools/DotMotif"><img src="https://img.shields.io/badge/Pretty Dope-👌-00ddcc.svg?style=for-the-badge" /></a>
<a href="https://bossdb.org/tools/DotMotif"><img src="https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge" /></a>
<a href="https://codecov.io/gh/aplbrain/dotmotif"><img alt="Codecov" src="https://img.shields.io/codecov/c/github/aplbrain/dotmotif?style=for-the-badge"></a>
</p>
---
DotMotif is a library that identifies subgraphs or motifs in a large graph. It looks like this:
```py
# Look for all motifs of the form,
# Neuron A synapses on Neuron B:
A -> B
# ...and B inhibits C:
B -> C [type = "inhibitory"]
```
# Examples
| Notebook | Description |
|----------|-------------|
| <a href="https://colab.research.google.com/gist/j6k4m8/7c5cf55e7feb24685bd13a217cedda1d/dotmotif-search-in-pinky100.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | Looking for motifs in the IARPA MICrONS Pinky100 Dataset |
| <a href="https://colab.research.google.com/gist/j6k4m8/d02259dfedc2321973be4d2e665653f4/dotmotif-search-in-custom-networkx.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | Motif search in a custom graph |
| <a href="https://colab.research.google.com/gist/j6k4m8/919cc1a8162289dd4a6aeb965e800322/dotmotif-search-in-custom-networkx.ipynb" target="_parent"><img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/></a> | Subgraph search in the Janelia Hemibrain dataset |
# Get Started
If you have [DotMotif](https://github.com/aplbrain/dotmotif/wiki/Installation), a NetworkX graph, and a curious mind, you already have everything you need to start using DotMotif:
```python
from dotmotif import Motif, GrandIsoExecutor
executor = GrandIsoExecutor(graph=my_networkx_graph)
triangle = Motif("""
A -> B
B -> C
C -> A
""")
results = executor.find(triangle)
```
# Parameters
You can also pass optional parameters into the constructor for the `dotmotif` object. Those arguments are:
| Argument | Type, Default | Behavior |
| ----------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `ignore_direction` | `bool`: `False` | Whether to disregard direction when generating the database query |
| `limit` | `int`: `None` | A limit (if any) to impose on the query results |
| `enforce_inequality` | `bool`: `False` | Whether to enforce inequality; in other words, whether two nodes should be permitted to be aliases for the same node. For example, in `A->B->C`; if `A!=C`, then set to `True` |
| `exclude_automorphisms` | `bool`: `False` | Whether to return only a single example for each detected automorphism. See more in [the documentation](https://github.com/aplbrain/dotmotif/wiki/Automorphisms) |
For more details on how to write a query, see [Getting Started](https://github.com/aplbrain/dotmotif/wiki/Getting-Started).
---
# Citing
If this tool is helpful to your research, please consider citing it with:
```bibtex
# https://doi.org/10.1038/s41598-021-91025-5
@article{Matelsky_Motifs_2021,
title={{DotMotif: an open-source tool for connectome subgraph isomorphism search and graph queries}},
volume={11},
ISSN={2045-2322},
url={http://dx.doi.org/10.1038/s41598-021-91025-5},
DOI={10.1038/s41598-021-91025-5},
number={1},
journal={Scientific Reports},
publisher={Springer Science and Business Media LLC},
author={Matelsky, Jordan K. and Reilly, Elizabeth P. and Johnson, Erik C. and Stiso, Jennifer and Bassett, Danielle S. and Wester, Brock A. and Gray-Roncal, William},
year={2021},
month={Jun}
}
```
Raw data
{
"_id": null,
"home_page": "",
"name": "dotmotif",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.9,<4.0",
"maintainer_email": "",
"keywords": "graph,motif,network,pattern,subgraph",
"author": "Jordan Matelsky",
"author_email": "jordan.matelsky@jhuapl.edu",
"download_url": "https://files.pythonhosted.org/packages/e0/6f/bb172d2e537011a11ac0551728758cc65bf100d3b5c31e462cc15a81a324/dotmotif-0.14.0.tar.gz",
"platform": null,
"description": "<p align=\"center\">\n <img align=\"center\" src=\"https://user-images.githubusercontent.com/693511/117350563-b58b9900-ae7a-11eb-83ce-9f5f9213145e.png\" / width=\"25%\">\n <h1 align=\"center\" fontsize=\"2em\">d o t m o t i f</h1>\n</p>\n<p align=\"center\">Find graph motifs using intuitive notation</p>\n\n<p align=\"center\">\n<a href=\"https://pypi.org/project/dotmotif/\"><img alt=\"PyPI\" src=\"https://img.shields.io/pypi/v/dotmotif?style=for-the-badge\"></a>\n<a href=\"https://bossdb.org/tools/DotMotif\"><img src=\"https://img.shields.io/badge/Pretty Dope-\ud83d\udc4c-00ddcc.svg?style=for-the-badge\" /></a>\n<a href=\"https://bossdb.org/tools/DotMotif\"><img src=\"https://img.shields.io/badge/License-Apache_2.0-blue.svg?style=for-the-badge\" /></a>\n<a href=\"https://codecov.io/gh/aplbrain/dotmotif\"><img alt=\"Codecov\" src=\"https://img.shields.io/codecov/c/github/aplbrain/dotmotif?style=for-the-badge\"></a>\n</p>\n\n---\n\nDotMotif is a library that identifies subgraphs or motifs in a large graph. It looks like this:\n\n```py\n# Look for all motifs of the form,\n\n# Neuron A synapses on Neuron B:\nA -> B\n# ...and B inhibits C:\nB -> C [type = \"inhibitory\"]\n```\n\n# Examples\n\n| Notebook | Description |\n|----------|-------------|\n| <a href=\"https://colab.research.google.com/gist/j6k4m8/7c5cf55e7feb24685bd13a217cedda1d/dotmotif-search-in-pinky100.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> | Looking for motifs in the IARPA MICrONS Pinky100 Dataset |\n| <a href=\"https://colab.research.google.com/gist/j6k4m8/d02259dfedc2321973be4d2e665653f4/dotmotif-search-in-custom-networkx.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> | Motif search in a custom graph |\n| <a href=\"https://colab.research.google.com/gist/j6k4m8/919cc1a8162289dd4a6aeb965e800322/dotmotif-search-in-custom-networkx.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a> | Subgraph search in the Janelia Hemibrain dataset |\n\n\n# Get Started\n\nIf you have [DotMotif](https://github.com/aplbrain/dotmotif/wiki/Installation), a NetworkX graph, and a curious mind, you already have everything you need to start using DotMotif:\n\n```python\nfrom dotmotif import Motif, GrandIsoExecutor\n\nexecutor = GrandIsoExecutor(graph=my_networkx_graph)\n\ntriangle = Motif(\"\"\"\nA -> B\nB -> C\nC -> A\n\"\"\")\n\nresults = executor.find(triangle)\n```\n\n# Parameters\n\nYou can also pass optional parameters into the constructor for the `dotmotif` object. Those arguments are:\n\n| Argument | Type, Default | Behavior |\n| ----------------------- | --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |\n| `ignore_direction` | `bool`: `False` | Whether to disregard direction when generating the database query |\n| `limit` | `int`: `None` | A limit (if any) to impose on the query results |\n| `enforce_inequality` | `bool`: `False` | Whether to enforce inequality; in other words, whether two nodes should be permitted to be aliases for the same node. For example, in `A->B->C`; if `A!=C`, then set to `True` |\n| `exclude_automorphisms` | `bool`: `False` | Whether to return only a single example for each detected automorphism. See more in [the documentation](https://github.com/aplbrain/dotmotif/wiki/Automorphisms) |\n\nFor more details on how to write a query, see [Getting Started](https://github.com/aplbrain/dotmotif/wiki/Getting-Started).\n\n---\n\n# Citing\n\nIf this tool is helpful to your research, please consider citing it with:\n\n```bibtex\n# https://doi.org/10.1038/s41598-021-91025-5\n@article{Matelsky_Motifs_2021, \n title={{DotMotif: an open-source tool for connectome subgraph isomorphism search and graph queries}},\n volume={11}, \n ISSN={2045-2322}, \n url={http://dx.doi.org/10.1038/s41598-021-91025-5}, \n DOI={10.1038/s41598-021-91025-5}, \n number={1}, \n journal={Scientific Reports}, \n publisher={Springer Science and Business Media LLC}, \n author={Matelsky, Jordan K. and Reilly, Elizabeth P. and Johnson, Erik C. and Stiso, Jennifer and Bassett, Danielle S. and Wester, Brock A. and Gray-Roncal, William},\n year={2021}, \n month={Jun}\n}\n```\n",
"bugtrack_url": null,
"license": "Apache 2.0",
"summary": "Find graph motifs using simple, intuitive notation.",
"version": "0.14.0",
"project_urls": null,
"split_keywords": [
"graph",
"motif",
"network",
"pattern",
"subgraph"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "d2ae7d722361a404ceb71041af906500c2bab4c3fee2a557f98f3c143742ffd4",
"md5": "400935facde66ee993d7e62f7c84f0b8",
"sha256": "c1d5087a7d72688fda157b8e1d9d3e2e93847a066c874d1eddf67afa18ee9f8e"
},
"downloads": -1,
"filename": "dotmotif-0.14.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "400935facde66ee993d7e62f7c84f0b8",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9,<4.0",
"size": 48164,
"upload_time": "2023-05-16T14:30:09",
"upload_time_iso_8601": "2023-05-16T14:30:09.120464Z",
"url": "https://files.pythonhosted.org/packages/d2/ae/7d722361a404ceb71041af906500c2bab4c3fee2a557f98f3c143742ffd4/dotmotif-0.14.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e06fbb172d2e537011a11ac0551728758cc65bf100d3b5c31e462cc15a81a324",
"md5": "df5d45cf27b922d6e00d57ab4965405f",
"sha256": "36f871d54236c2ff2f33a7698d7d6ca68ddd4298cb90a488798e52ce3073f11f"
},
"downloads": -1,
"filename": "dotmotif-0.14.0.tar.gz",
"has_sig": false,
"md5_digest": "df5d45cf27b922d6e00d57ab4965405f",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9,<4.0",
"size": 39204,
"upload_time": "2023-05-16T14:30:11",
"upload_time_iso_8601": "2023-05-16T14:30:11.060646Z",
"url": "https://files.pythonhosted.org/packages/e0/6f/bb172d2e537011a11ac0551728758cc65bf100d3b5c31e462cc15a81a324/dotmotif-0.14.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-16 14:30:11",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "dotmotif"
}