Skip to content

Instantly share code, notes, and snippets.

@pvanheus
Created May 22, 2016 19:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pvanheus/659bf6cb14b074e518e298e11cdac194 to your computer and use it in GitHub Desktop.
Save pvanheus/659bf6cb14b074e518e298e11cdac194 to your computer and use it in GitHub Desktop.
find all genes in interval (cypher)
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