Created
May 22, 2016 19:26
-
-
Save pvanheus/659bf6cb14b074e518e298e11cdac194 to your computer and use it in GitHub Desktop.
find all genes in interval (cypher)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MATCH (s:Strand {forward: True}) -[:CONTAINS]->(l1:Location) | |
WHERE l1.end >= 1000 | |
WITH l1 | |
ORDER BY l1.end ASC LIMIT 1 | |
MATCH (l1)-[:NEXT*]->(l2) | |
WHERE l2.start <= 7000 | |
WITH l1,l2 | |
ORDER BY l2.end DESC LIMIT 1 | |
MATCH p=(l1)-[:NEXT*]->(l2) | |
UNWIND nodes(p) as x | |
MERGE (x)-[:CONTAINS]->(g:Gene) | |
RETURN g.name |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment