Skip to content

Instantly share code, notes, and snippets.

View nathandunn's full-sized avatar

Nathan Dunn nathandunn

View GitHub Profile
@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:');
@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",
```(; datasetFetch
(fn [dataset samples probes]
(fetch [{:table dataset
:columns probes
:samples samples}]))
"ccle/CCLE_DepMap_18Q2_maf_20180502" ["127399_SOFT_TISSUE" "22RV1_PROSTATE" "A204_SOFT_TISSUE" "A253_SALIVARY_GLAND" "A427_LUNG" "A431_SKIN" "A4FUK_HAEMATOPOIETIC_AND_LYMPHOID_TISSUE" "A673_BONE" "ALLSIL_HAEMATOPOIETIC_AND_LYMPHOID_TISSUE" "BICR16_UPPER_AERODIGESTIVE_TRACT" "BICR78_UPPER_AERODIGESTIVE_TRACT" "BIN67_OVARY" "BT12_SOFT_TISSUE" "BT16_SOFT_TISSUE" "C10_LARGE_INTESTINE" "C125PM_LARGE_INTESTINE" "C75_LARGE_INTESTINE" "C80_LARGE_INTESTINE" "C8166_HAEMATOPOIETIC_AND_LYMPHOID_TISSUE" "C84_LARGE_INTESTINE" "C99_LARGE_INTESTINE" "CADOES1_BONE" "CAKI2_KIDNEY" "CALU1_LUNG" "CCFSTTG1_CENTRAL_NERVOUS_SYSTEM" "CHLA06ATRT_SOFT_TISSUE" "CHLA15_AUTONOMIC_GANGLIA" "CHLA218_BONE" "CHLA258_BONE" "CHLA266_SOFT_TISSUE" "CHLA32_BONE" "CHLA57_BONE" "CHLA99_BONE" "CHLA9_BONE" "CL11_LARGE_INTESTINE" "CME1_SOFT_TISSUE" "COGAR359_SOFT_TISSUE" "COGE352_BONE" "COGN278_AUTONOMIC_GANGLIA" "COGN3
@nathandunn
nathandunn / overview-plugin.html
Created March 28, 2017 22:31
like overview.html, but trying to add the neatfeatures plugin
<html>
<head>
<title>JBrowse - Retrieve data outside of browser</title>
<link rel="stylesheet" type="text/css" href="css/genome.css">
<script type="text/javascript" src="src/dojo/dojo.js" data-dojo-config="async: 1, baseUrl: './src'"></script>
<script type="text/javascript" src="src/JBrowse/init.js"></script>
<style>
pre {
white-space: pre-wrap;
@nathandunn
nathandunn / overview.html
Created March 28, 2017 19:12
provides an overview screenshot from a remote JBrowse source specified in URL
<html>
<head>
<title>JBrowse - Retrieve data outside of browser</title>
<link rel="stylesheet" type="text/css" href="css/genome.css">
<script type="text/javascript" src="src/dojo/dojo.js" data-dojo-config="async: 1, baseUrl: './src'"></script>
<script type="text/javascript" src="src/JBrowse/init.js"></script>
<style>
pre {
white-space: pre-wrap;
@nathandunn
nathandunn / jbrowse-render
Created March 13, 2017 17:55 — forked from cmdcolin/jbrowse-render
JBrowse feature rendering outside browser
<html>
<head>
<title>JBrowse feature rendering outside of browser</title>
<link rel="stylesheet" type="text/css" href="css/genome.css">
<script type="text/javascript" src="src/dojo/dojo.js" data-dojo-config="async: 1, baseUrl: './src'"></script>
<script type="text/javascript" src="src/JBrowse/init.js"></script>
<script>
@nathandunn
nathandunn / features.html
Last active January 31, 2017 18:14
Grabs nclist from remote and local server data
<!DOCTYPE html>
<html>
<head>
<title>JBrowse - Retrieve data outside of browser</title>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<link rel="stylesheet" type="text/css" href="css/genome.css">
<script type="text/javascript" src="src/dojo/dojo.js" data-dojo-config="async: 1, baseUrl: './src'"></script>
<script type="text/javascript" src="src/JBrowse/init.js"></script>
<style>
pre {
@nathandunn
nathandunn / screenshot.py
Last active January 27, 2017 18:36
simple python JBrowse extraction
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import cv2
url = 'https://genome.monarchinitiative.org/apollo/Honeybee/jbrowse/index.html?loc=Group1.1%3A724016..726600&tracklist=0&nav=0&tracks=Official%20Gene%20Set%20v3.2&highlight='
driver = webdriver.Chrome()
driver.get(url)
@nathandunn
nathandunn / gist:3cc00bdae00635b4733e7b4566610489
Created October 13, 2016 03:58
sequence strings for difference frames
Frame 1 longest:
TCCGGAACAACGAAGATGAGATGGGATGCCGCTCTATATCTACTCTCGCTGCTGCTCTTCTCGTTGGCCAATCTGTGTTGGGCTCTCGTCGAAACGCGAGGATGCAATCGCACTATCAGAAATTCCGTTGGATGGATACGTTGGACAGGACGAATGGGACGATGCATTGTTCGCATCAGAGCGCCTCCTAGAGATCCTCAGGTGATCGAGTTGAAAGTTAGGAAACTGCAAGTTGGTTTCCTGAAAGAAACCAGATGCGAGGGTGCTTACATTCAATTTTCCGATGGTAGCGAGGACCTTGAAGATGAAACGGGACGTTACTGCGGCTATGTAAGCGGCAACACGACCAGACTGTTCCTGAGAAAGGGACCCAATTTGACGATCATAATGGACTCGGACGTGAGGTTCGCAGCCGAGAATCCCGTGATATTCTCCGCCCAGTTCTCCATACTTCCCGCCCAGCTCGCGTCCGAGCGTCACCGCGGCTTCTCCCCGTCCCCCTCGTCCGAGTGTCCCCTCGAGTGCGCCGTGAGGAACGAGCGAAGATCCTGCAAATTGTCCTCGCCCGGCTACCCGGGCGTCTACCCCCGCGGGATCAAGTGCAGGATAGGGTTGGAGTCGGGCGCCGGCCGATTCAAGATCGGCGGCCAACCGGACGACACTTACGATCTGATGAATCGCACGTGGCAGGAGGGTTGCCAGACCGAGAATTGCGAGGACCACGTGGAGGGGATGGTCGCGGAATTGCGGAGGGCGAGGGTCGAGCCGGGGGACGCGGGGAGGCGCGGGAAGAGGAGCCCGGAGGACCGCGAGGAGGAGGTGGAGTTTATCATCGGGCAGACGTCGTACAGGGGGGGTAGGAATGGTCGGAGGAGGCTTAAGAAGGGGAGGAAGGATGCCGGGAGCGAGGATATCCGGAGAGGAAACATCGGCCGGGCGAAGGGGGGTGGGGAGGGAGGAGAGTCGTTGGCCGGTTATCGGGGGGGCCAGGGGATCAGGTGGCGGG
@nathandunn
nathandunn / FeatureSet.java
Created October 12, 2016 00:06
original desktop apollo featureset code
package apollo.datamodel;
import java.lang.Integer;
import java.util.*;
import javax.swing.JOptionPane;
import apollo.util.SeqFeatureUtil;
import apollo.util.FeatureList;
import apollo.util.QuickSort;