Skip to content

Instantly share code, notes, and snippets.

@rdmpage
rdmpage / synonym.asc
Last active August 29, 2015 14:01
Linking taxa by synonyms

Test whether two taxa are same using synonyms

This experiment takes two taxa for the same lizard (Geckonia chazaliae or Tarentola chazaliae) and runs a query to discover that these taxa are duplicates. In other words, GBIF has the same lizard twice in its classification.

63550 88 88
= Network versioning using relationnodes
Recently there was a nice blog on versioning networks by Ian Robinson (http://iansrobinson.com/2014/05/13/time-based-versioned-graphs/[read it here]) on using identity nodes and separating structure from state. In this gist I'd like to put in my 2 cents by introducing another approach using _relationnodes_. This is more about structure of a network than about states of nodes, but it treats versioning differently. As Ian states in his blog, there's always a trade-off to be made, since versioning causes an extra load on storage and processing.
== Relationnodes?
=== What are relationnodes?
Relation nodes are intermediary nodes between two network nodes that represents the relation between the nodes.
So, if A and B are two network nodes, instead of connecting them with a relationship of `[:RELTYPE]`,
@rdmpage
rdmpage / index.html
Created June 22, 2014 19:34
WKT GBIF query
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>WKT</title>
<style type="text/css">
#info {
position: absolute;
top: 70px;
left: 550px;
width: 350px;
}
@rdmpage
rdmpage / geotagging.txt
Created August 25, 2014 09:57
BioStor geotagging stats
How many articles?
SELECT COUNT(reference_id) FROM rdmp_reference WHERE PageID <> 0;
+---------------------+
| COUNT(reference_id) |
+---------------------+
| 106617 |
+---------------------+
1 row in set (0.08 sec)
@rdmpage
rdmpage / gbif.asc
Last active March 31, 2018 05:03
GenBank and GBIF

Cluster multiple occurrence records in GBIF

In this example we have the same sequence GQ247641 in two sequence datasets ("European Molecular Biology Laboratory Australian Mirror" and "Geographically tagged INSDC sequences"), and also the voucher specimen ("AM W.35546.001" or "AMS:W.35546") also occurs in GBIF (provided by "Australian Museum provider for OZCAM"). Linking the two sequence occurrences is trivial, we just link by the accession "GQ247641". Linking the sequence to the museum specimen requires matching the slightly different strings "AM W.35546.001" and "AMS:W.35546".

The graph links three records in GBIf that all refer to the same thing.

@rdmpage
rdmpage / gb.asc
Last active August 29, 2015 14:07
GenBank specimen

Simple case of specimen and sequence both in GBIF

@rdmpage
rdmpage / getag.asc
Last active August 29, 2015 14:07
Getagged in Genbank but not GBIF
== GBIF geotagged, sequence in Genbank not geotagged
//hide
//setup
//output
[source,cypher]
----
// GBIF occurrence
@rdmpage
rdmpage / zsm.asc
Last active August 29, 2015 14:07
GenBank, BOLD, GBIF (ZSM iBOL)

GenBank, BOLD, GBIF (ZSM iBOL)

// GBIF occurrence
@rdmpage
rdmpage / permissions.txt
Created January 8, 2015 11:09
MySQL database permissions
When copying MySQL database files (i.e. the binary files in /usr/local/mysql/data ) to a new machine we need to set permissions.
For the database "db" we do the following:
sudo chown -R _mysql db
sudo chgrp -R _mysql db
sudo chmod -R 644 db
sudo chmod 755 db