Skip to content

Instantly share code, notes, and snippets.

@rdmpage
Created October 9, 2014 14:25
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 rdmpage/28255b22c3af10d70a67 to your computer and use it in GitHub Desktop.
Save rdmpage/28255b22c3af10d70a67 to your computer and use it in GitHub Desktop.
== GBIF geotagged, sequence in Genbank not geotagged
//hide
//setup
//output
[source,cypher]
----
// GBIF occurrence
CREATE (occurrence487122475:Occurrence { name: "gbif668551602", catalogNumber: "AM W.35545.001" }),
(occurrence487122475)-[:HASNAME]->(name1:Name { name: "Grania colorata DeWit, Rota & Erséus, 2009"}),
// has code
(sample1:Sample { name: "AM W.35545.001" }),
(occurrence487122475)-[:HASCODE]->(sample1),
(occurrence487122475)-[:GEOTAG]->(point1:Point { name: "145.44499, -14.68666"}),
// data provided by
(dataset1:Dataset { name: " Australian Museum provider for OZCAM"})<-[:SOURCE]-(occurrence487122475),
// Sequence
(GU902116:Sequence { accession:"GU902116", catalogueNumber: "AMS type W.35545" }),
(GU902116)-[:HASCODE]->(sample2:Sample { name: "AMS type W.35545" }),
(GU902116)-[:HASNAME]->(name2:Name { name: "Grania colorata"}),
// mapping samples
(occurrence487122475)-[:HASCODE]->(sample2)
----
//graph
//table
=== Get geotag for sequence based on GBIF
[source,cypher]
----
MATCH (o1:Occurrence)-[:HASCODE]-(Sample)-[:HASCODE]-(s1:Sequence)
WITH o1, s1
MATCH (o1)-[:GEOTAG]-(p1:Point)
RETURN o1.name , s1.name, p1.name
----
//table
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment