aplbrain / dotmotif

A performant, powerful query framework to search for network motifs
https://bossdb.org/tools/dotmotif
Apache License 2.0
81 stars 9 forks source link

Filtering By Properties w/ Invalid Characters in the Name #111

Closed simonwarchol closed 2 years ago

simonwarchol commented 2 years ago

Hey There, I'm using dotmotif to query the neuPrint dataset and have found some of the neurons have properties that aren't accepted in the query string format e.g. 'AVLP(R)': True,

Is there a way to still query w/ these params? I tried adding directly to the _node_constraints but that doesn't seem to work either e.g.

motif._node_constraints['A']['AVLP(R)'] = {}
motif._node_constraints['A']['AVLP(R)']['='] = [True]

Variable `R` not defined (line 2, column 83 (offset: 156))
"    WHERE B.status = "Traced" AND A.status = "Orphan" AND A.INP = True AND A.AVLP(R) = True"
j6k4m8 commented 2 years ago

Hi @simonwarchol — thank you so much for reporting this! I will work on a fix for this ASAP.

Would it be acceptable to use 'index-bracket' style notation?

A -> B
A['AVLP(R)'] = true

Open to other suggestions!

simonwarchol commented 2 years ago

Hey @j6k4m8, Yep -- that's the first thing I tried, so it's probably the most intuitive way to do it. Really appreciate it! The framework is really impressive :) -Simon

j6k4m8 commented 2 years ago

@simonwarchol I just pushed a new update (dotmotif==0.11.0) to PyPI and it should be installable with:

pip3 install -U dotmotif

Let me know if you're able to use the bracket syntax to execute your commands successfully now?

An example of the syntax in use is here!

simonwarchol commented 2 years ago

Rad -- really appreciate it. Will test in the morning. -Simon

simonwarchol commented 2 years ago

Looks great. Ty again

j6k4m8 commented 2 years ago

Super awesome! Excited to see what you discover :)