Skip to content

Commit

Permalink
Release 0.9.0
Browse files Browse the repository at this point in the history
  • Loading branch information
j6k4m8 committed Mar 23, 2021
1 parent e2b9566 commit 4cc7987
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 21 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
@@ -1,6 +1,6 @@
# Changelog

- **0.9.0**
- **0.9.0** (March 23 2021)
- Features:
- `Neo4jExecutor#create_index`. This function call adds an index to the database on the node attribute specified, in order to improve query performance (#95)
- `dotmotif.ingest.EdgelistConverter` now supports importing from a dask or pandas dataframe edgelist in addition to files on disk (#99)
Expand Down
64 changes: 44 additions & 20 deletions README.md
Expand Up @@ -11,43 +11,65 @@
<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>

# Usage
---

## Writing a motif

DotMotif is a custom language that specializes in subgraph query notation:

`threecycle.motif`
DotMotif is a custom language that specializes in subgraph query notation. It looks like this:

```yml
# A excites B
# Neuron A excites B:
A -> B [type = "excitatory"]
# B inhibits C
# ...and B inhibits C:
B -> C [type = "inhibitory"]
```

## Ingesting the motif into dotmotif
Or like this:

```python
import dotmotif
```yml
TwitterInfluencer(person) {
# An influencer has more than a million
# followers and is verified.
person.followers > 1000000
person.verified = true
}

InfluencerAwkward(person1, person2) {
# Two people who are both influencers...
TwitterInfluencer(person1)
TwitterInfluencer(person2)
# ...where one follows the other, but...
person1 -> person2
# ...the other doesn't follow back
person2 !> person1
}

dm = dotmotif.Motif("threecycle.motif")
# Search for all awkward twitter influencer
# relationships in the dataset:
InfluencerAwkward(X, Y)
```

## Inline code in Python
# Get Started

Alternatively, you can inline your motif in the python code when creating your `dotmotif` object:
> To follow along in an interactive Binder without installing anything, launch a Jupyter Notebook here:
>
> [![Binder](https://mybinder.org/badge_logo.svg)](https://mybinder.org/v2/gist/j6k4m8/7da63dc9c049c4263fc2749d4ce880cd#file-get-started-dotmotif-ipynb/HEAD)
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
dm = dotmotif.Motif("""
# A excites B
A -> B [type = "excitatory"]
# B inhibits C
B -> C [type = "inhibitory"]
from dotmotif import Motif, GrandIsoExecutor

executor = GrandIsoExecutor(graph=my_networkx_graph)

triangle = Motif("""
A -> B
B -> C
C -> A
""")

results = executor.find(triangle)
```

## Parameters
# Parameters

You can also pass optional parameters into the constructor for the `dotmotif` object. Those arguments are:

Expand All @@ -60,6 +82,8 @@ You can also pass optional parameters into the constructor for the `dotmotif` ob

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:
Expand Down

0 comments on commit 4cc7987

Please sign in to comment.