New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error on first query #86
Comments
I copy and fasted the lark file and tried to run this:
This error occurs:
|
Thank you so much for reporting! Let me check into this and I will get back to you with some potential debug steps. Unfortunately it looks like I didn't work out all the kinks in the windows installation! |
@lix2k3 Your second issue looks like it's possibly because you're searching for a directed motif in an undirected host graph (my understanding is that You may be able to fix this by adding the from dotmotif import Motif, NetworkXExecutor
import networkx as nx
# Create the UNDIRECTED host graph:
G = nx.random_regular_graph(6, 10, seed=None)
# Create the executor:
E = NetworkXExecutor(graph=G)
# Construct the motif.
# * This motif has only one (directed) edge
# * We set ignore_direction to True in order
# to search for _any_ edge in the host graph
motif = Motif("""
A -> B
""", ignore_direction=True)
# Get the number of edges in this graph
results = E.count(motif) Note that this will double-count undirected edges (so in your 30-edge graph The most straightforward way to forbid these double-counts is to just add the reverse edge as well:
I'll keep on working on your first installation issue. Really appreciate you filing the report! Please let me know if you run into any other problems/questions! Would be happy to walk through some motifs with you :) |
Thanks a lot! I'm up and running now and this is quite an awesome library you have here. The language is elegant and love the macros feature. Excited to work with it and see it grow! |
I'm so excited to hear that! 😀 btw, I noticed you're using the NetworkX executor. If you're willing to install another Python package, I'd definitely recommend using the https://github.com/aplbrain/grandiso-networkx pip install grandiso # This example is exactly the same, but NetworkXExecutor
# has been replaced with GrandIsoExecutor:
from dotmotif import Motif, GrandIsoExecutor
import networkx as nx
# Create the UNDIRECTED host graph:
G = nx.random_regular_graph(6, 10, seed=None)
# Create the executor:
E = GrandIsoExecutor(graph=G)
# Construct the motif.
# * This motif has only one (directed) edge
# * We set ignore_direction to True in order
# to search for _any_ edge in the host graph
motif = Motif("""
A -> B
""", ignore_direction=True)
# Get the number of edges in this graph
results = E.count(motif) Super curious to hear about your experiences / feature-requests / issues :) |
Awesome to hear that regarding the performance of the GrandIsoExecutor. Will install shortly. Right now, I am looking for ways to create random network ensembles (1000 random networks) and test the occurrence of motifs in both the real/observed network and the random networks. I am looking to compare the statistic in the observed network (# of motifs) to the random networks (average, std of motif count) to test for significance (z-scores, etc.). Also, I am trying to obtain to complex measures of the motifs (motif intensity, motif coherence, clustering coefficient, participation coefficient) of all the found motifs in the undirected network. These measures are all mentioned in Letina et al (2019). DotMotif makes this all possible in an elegant syntax. But, of course, I will have to roll up my own functions to fully make this work. I'm a Phd student in psychology rather than a programmer, so it will take me some time. This is the only package that I think can get me what I'm looking for with minimal fuss :) As far as feature requests, anything that can get me closer to the above is much appreciated. But, the fact that this even exists is a game-changer for me. Letina, S., Blanken, T. F., Deserno, M. K., & Borsboom, D. (2019). Expanding network analysis tools in psychological networks: Minimal spanning trees, participation coefficients, and motif analysis applied to a network of 26 psychological attributes. Complexity, 2019. |
This is a very cool use-case! I'm so glad DotMotif is helpful to you here! I'll keep those graph measures in the back of my mind, I've been considering adding some sort of metrics output as well, though it can add substantially to the runtime for larger graphs... :) |
Great, thanks! |
Just pushed a change that should fix this installation error as well — please do reach out if you encounter any more issues or just want to chat more about motif search :) |
Tried to run the query from the tutorial:
But got this error:
The text was updated successfully, but these errors were encountered: