Skip to content

Instantly share code, notes, and snippets.

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

Simple case of specimen and sequence both in GBIF

@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
We can make this file beautiful and searchable if this error is corrected: It looks like row 3 should actually have 10 columns, instead of 1. in line 2.
"Catalog# (TTU-M)","TK#","Genus","Species","Country","State","County","Collection Date","Tissues Available","Preparator"
"84773","104001","ARTIBEUS","OBSCURUS","ECUADOR","PASTAZA DISTRICT","---","7/19/2001","Yes","HAYNIE, M L"
"Subspecies: ---Specific Locality: 5 KM E PUYO, SAFARI HOSTERIA PARKElevation: ---Zone: 18Easting: 166624Northing: 9840350Latitude: ---Longitude: ---Collector: BAKER, R J ET ALPreparation Type: SBSex: FEMALEAssociated Sequences: ---Specimen#: ---Prep#: 157Prep Date: 7/19/2001Total Length (mm): 100Tail Length (mm): 0Foot Length (mm): 11Ear Length (mm): 12Weight (g): 14.9Tail Broken: NoTragus Length (mm): 0Forearm Length (mm): 0Reproductive Notes: ---Age: ADULT"
@rdmpage
rdmpage / occurrence.geojson
Last active August 29, 2015 14:15
Museu Paraense Emilio Goeldi - Ornithology Collection GeoJSON for first 1000 records after lat/long divided by 10000000, see issue http://dev.gbif.org/issues/browse/POR-2649
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rdmpage
rdmpage / index.html
Created February 24, 2015 12:04
BOLD website returned this HTML 2015-02-24
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>www.boldsystems.org [8]</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="pragma" content="no-cache">
<style>
body { margin:0; padding:0; }
</style>
</head>
{
"created_at": "Thu Mar 12 21:17:00 +0000 2015",
"id": 576129791759384600,
"id_str": "576129791759384576",
"text": "#myGBIF (via web client)",
"source": "<a href=\"http://twitter.com\" rel=\"nofollow\">Twitter Web Client</a>",
"truncated": false,
"in_reply_to_status_id": null,
"in_reply_to_status_id_str": null,
"in_reply_to_user_id": null,
@rdmpage
rdmpage / traits.html
Last active August 29, 2015 14:17
CouchDB-like view of EOL Trait data
<html>
<head>
<title>CouchDB-like view of EOL Trait data</title>
<meta charset="UTF-8"/>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>
</head>
<body>
<h1>CouchDB-like view of EOL Trait data</h1>
<p>API call like this: http://eol.org/api/traits/26374</p>
<div id="output"></div>
@rdmpage
rdmpage / bold.txt
Created March 25, 2015 10:55
BOLD phylogeny from API
BOLD has a (hidden) API to retrieve a Newick tree for a BIN. For example on the page http://www.boldsystems.org/index.php/Public_BarcodeCluster?clusteruri=BOLD:AAD8242 we see an SVG tree. Under the hood this is called by: http://www.boldsystems.org/index.php/Public_Ajax_BINTree?clusterguid=BOLD:AAD8242&clusteruri=BOLD:AAD8242&clustername=BIN38242&clusterid=1738567
It's not clear where the "clusterid" comes from, but without it the API call fails.
@rdmpage
rdmpage / simple.sql
Created May 18, 2015 10:37
Simple ION dump
SELECT
IFNULL(id, ""),
IFNULL(cluster_id, ""),
IFNULL(nameComplete, ""),
IFNULL(taxonAuthor, ""),
IFNULL(`group`, ""),
IFNULL(publication, "")
INTO OUTFILE "/tmp/markus.tsv"
FIELDS TERMINATED BY "\t" ENCLOSED BY "" ESCAPED BY ""
LINES TERMINATED BY "\n"