Skip to content

Instantly share code, notes, and snippets.

View nickynicolson's full-sized avatar

Nicky Nicolson nickynicolson

View GitHub Profile
@nickynicolson
nickynicolson / name-reconciliation-python.ipynb
Last active February 12, 2016 16:25
Name reconciliation in Python
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Automating reading list management

What I'm using:

zotero Zotero: In browser integration mean that its a single click to save citation information (and a full-text PDF if available)

...but I'm using trello Trello to stay on top of tasks, and my "to-read" list needs to have a presence in my "to-do" list, as Trello gives a better single view of my work than zotero.

What I'd like:

Cards for new "to-read" articles in Trello, automatically - without cut + paste.

This graph gist demonstrates use of Jaccard calculation to determine similarity between two sets of nodes

@nickynicolson
nickynicolson / 0_reuse_code.js
Last active August 29, 2015 14:26
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@nickynicolson
nickynicolson / gbseq2tsv.xsl
Created May 6, 2015 09:43
XSL to convert INSDSeq XML format download from genbank to tabular delimited file of accession, publication and voucher details
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" indent="yes" encoding="UTF-8"/>
<xsl:variable name="delimiter" select="'&#09;'"/>
<xsl:variable name="newline" select="'&#10;'"/>
<xsl:template match="/">
<!-- header line -->
<xsl:value-of select="concat('primary_accession',$delimiter,'date_created',$delimiter,'date_last_amended', $delimiter, 'definition', $delimiter, 'title', $delimiter, 'reference', $delimiter, 'doi', $delimiter, 'specimen_voucher', $delimiter, 'bio_material', $delimiter, 'organism', $newline)"/>
<!-- data -->
@nickynicolson
nickynicolson / cypher-meta-graph-w-counts
Last active August 29, 2015 14:20
Modification of the neo4j "meta" graph creation cypher statement to add counts to nodes and relationships
// Create meta-graph with orphan counts
MATCH (n)
/* ugly string replace to convert collection of labels to colon delimited string */
WITH replace(replace(replace(replace(str(labels(n)),'[',''),']',''),'"',''),',',':') AS l, count(distinct n) AS c
MERGE (mn:Meta_Node {name:l,count:c})
WITH mn
MATCH (a)-[r]->(b)
WITH replace(replace(replace(replace(str(labels(a)),'[',''),']',''),'"',''),',',':') AS a_labels
, count(distinct a) AS from_count
, type(r) AS rel_type
import urllib
import urllib2
try:
# Base url for the TNRS match_names API
url = 'http://api.opentreeoflife.org/v2/tnrs/match_names'
# Encode data value to be looked up as an array of names:
data = '{"names": ["'+value+'"]}'
print "Looking up: " + data
# Set HTTP headers:
= The taxonomic mind-mapper
Nicky Nicolson, Peter Hovenkamp
:neo4j-version: 2.1.0
:author: Nicky Nicolson
:twitter: nickynicolson
== Domain
We investigate the use of the scheme in: https://docs.google.com/document/d/1FIxNrrGrIZs0l4QJEdGfctXbYVL4cQhKspmMEHmKAGg/edit with a use case in the taxonomy of Diplazium tomentosum (https://docs.google.com/document/d/1vni44RBwGNZ7iRCFf243NtcD-7xwjHrDeAPehato7KY/edit?usp=sharing)
== Data model
@nickynicolson
nickynicolson / Taxonomic-mind-mapper
Last active August 29, 2015 13:57
Peter's use cases for the taxonomic mind mapper
Peter investigates the taxonomy of Diplazium tomentosum.
//console
He starts with one of the types from the Leiden herbarium (http://plants.jstor.org/specimen/l0051073):
[source,cypher]
----
CREATE (s:Specimen{id:"L0051073"
,jstorUrl:'http://plants.jstor.org/specimen/l0051073'