Skip to content

Instantly share code, notes, and snippets.

View nathandunn's full-sized avatar

Nathan Dunn nathandunn

View GitHub Profile
@nathandunn
nathandunn / Bioschemas Example 3
Last active October 29, 2018 19:19
Example of a proposed bioschemas example
{
"@context": [
"http://schema.org",
"http://bioschemas.org/context.jsonld"
],
"@id": "http://www.alliancegenome.org/gene/ZFIN:ZDB-GENE-001103-2",
"@type": ["BioChemEntity", "Gene"],
"identifier": "ZFIN:ZDB-GENE-001103-2",
"version": "1.8",
"license": "CC BY 4.0",
@nathandunn
nathandunn / converter.js
Last active September 20, 2019 20:07
tsv to json converter
function tsvJSON(tsv){
var lines=tsv.split("\n");
var result = [];
for(var i=0;i<lines.length;i++){
var obj = {};
var currentline=lines[i].split("\t");
if(currentline.length>2){
obj.gene = currentline[1].split(",");
if(currentline[0].indexOf('(GO:')>0){
const startIndex = currentline[0].indexOf('(GO:');