Comments (8)
from hetionet.
@jromanowska cool query!
Unfortunately, I don't think @gsummer is actively maintaining cyNeo4j
anymore. We've also run into the issue that cyNeo4j doesn't support exporting paths to Cytoscape (see cyNeo4j/cyNeo4j#14). We've engineered a partial workaround, where you append the following to a query returning paths:
WITH relationships(path) AS rels
UNWIND rels AS rel
RETURN DISTINCT startNode(rel) AS source, endNode(rel) AS target, rel AS relationship
So the following query should work with cyNeo4j:
MATCH path = allShortestPaths((node1:Gene)-[*..3]-(node2:PharmacologicClass))
WHERE
node1.name = 'ESRRG' AND
node2.name STARTS WITH 'Vitamin'
WITH relationships(path) AS rels
UNWIND rels AS rel
RETURN DISTINCT startNode(rel) AS source, endNode(rel) AS target, rel AS relationship
This will return all nodes and relationships in the matched paths. Note that the Neo4j browser shows all relationships between returned nodes by default (even if those relationships were not requested). This option is controlled by the AUTO-COMPLETE toggle. So Cytoscape will receive just the relationships in the paths, i.e. AUTO-COMPLETE set to OFF.
Also unfortunately, there is a separate cyNeo4j issue where nodes don't retain their labels (i.e. node types, see cyNeo4j/cyNeo4j#15). Therefore, you may need to do a little extra work to get reverse engineer the node types in Cytoscape.
Good luck! We'd love to see what you come up with.
from hetionet.
Also note that (in this instance), the above query can be simplified by removing allShortestPaths
. Since the shortest path between ESRRG and a Vitamin* is 3, this is just returning all paths of length 3.
from hetionet.
That worked, thank you! I see I need to read more about Cypher then ;)
And by the way - have you tried visualizing your networks in R?
from hetionet.
@gsummer - great that you're still working a bit on this app. I'll give the dev version a try.
However, there is another issue - on Neo4j there is an "auto-complete" option, while this doesn't seem to be on when I use cyNeo4j, so when getting a union of two queries, there are many edges that are missing.
from hetionet.
@gsummer good to know about the dev version. Best of luck with your PhD. I know the terror/joy of the last few months of a dissertation. Happy to test whenever.
on Neo4j there is an "auto-complete" option, while this doesn't seem to be on when I use cyNeo4j
@jromanowska the AUTO-COMPLETE feature of the Neo4j Browser is a frontend "extra". Since cyNeo4j interacts solely via Cypher queries, I don't think an AUTO-COMPLETE feature would be appropriate for cyNeo4j (since AUTO-COMPLETE is not part of Cypher).
However, you can make your query return all relationships between your selected nodes (source):
MATCH path = (node1:Gene)-[*..3]-(node2:PharmacologicClass)
WHERE
node1.name = 'ESRRG' AND
node2.name STARTS WITH 'Vitamin'
WITH nodes(path) AS nodes
UNWIND nodes AS node_set
WITH collect(DISTINCT node_set) AS node_set
MATCH (n1)-[rel]->(n2)
WHERE
n1 in node_set AND
n2 in node_set
RETURN DISTINCT startNode(rel) AS source, endNode(rel) AS target, rel AS relationship
from hetionet.
Forgot to write yesterday - it works, thank you! And thanks for explanation about the auto-complete option.
And btw, @gsummer - the developmental version of cyNeo4j works fine for me as well.
from hetionet.
Great!
from hetionet.
Related Issues (20)
- Local files HOT 2
- Multiple Match Queries Not Working HOT 2
- Question About Hetionet's Dictionary HOT 3
- How to add new disease and anatomy nodes HOT 2
- Providing a dump version of Hetionet HOT 11
- http://neo4j.het.io/browser/ time out HOT 4
- Neo4J instance down (?) HOT 7
- Updated TSV version HOT 6
- graph.db database offline in neo4j HOT 3
- neo4j website down HOT 6
- Hetionet Browser is down HOT 4
- Mapping to original databases HOT 2
- Cannot map non-existing file HOT 5
- Do any relations imply another relation? HOT 1
- Connectivity Search Automated Query Question HOT 8
- Docker compatibility question HOT 4
- Question on metrics HOT 1
- What does it mean if something up regulates a disease in this context? HOT 3
- Speeding up data import to Neo4j v5 and CSV format data HOT 2
- Inquiry about metapaths from 2017 Paper "Systematic Integration of Biomedical Knowledge Prioritizes Drugs for Repurposing" HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hetionet.