Skip to content

Instantly share code, notes, and snippets.

View DoctorBud's full-sized avatar

Dan Keith DoctorBud

View GitHub Profile
@DoctorBud
DoctorBud / detokenizer.cpp
Last active December 27, 2015 06:49
Experimenting with Gists
//
// Examples of ways to implement a detokenize(vector<string> tokens, string delim) function,
// which will concatenate the tokens in (tokens), with (delim) inserted between, and ensuring
// that no terminal (delim) is inserted.
//
// For example:
// detokenize( {"aaa", "bbb"}, "/" ) --> "aaa/bbb"
//
// I wrote this as an example for some of my colleagues not as familiar with modern C++.
//
##"I made a program to generate dot files representing the LR(0) state graph along with computed LALR(1) lookahead for an arbitrary context-free grammar, to make the diagrams I used in this article: http://blog.lab49.com/archives/2471. The program also highlights errant nodes in red if the grammar would produce a shift/reduce or reduce/reduce conflict -- you may be able to go to http://kthielen.dnsalias.com:8082/ to produce a graph more to your liking". Contributed by Kalani Thielen.
##Command to get the layout: "dot -Gsize=10,15 -Tpng thisfile > thisfile.png"
digraph g {
graph [fontsize=30 labelloc="t" label="" splines=true overlap=false rankdir = "LR"];
ratio = auto;
"state0" [ style = "filled, bold" penwidth = 5 fillcolor = "white" fontname = "Courier New" shape = "Mrecord" label =<<table border="0" cellborder="0" cellpadding="3" bgcolor="white"><tr><td bgcolor="black" align="center" colspan="2"><font color="white">State #0</font></td></tr><tr><td align="left" port="r0">&#40;0&#41; s -&gt; &bull;e
Disease ID Disease Name Gene ID Gene Name Genotype Gene Symbol(s) Phenotype ID Phenotype Name Age of Onset ID Age of Onset Name Evidence ID Evidence Name Frequency Sex ID Sex Name Negation ID Negation Name Description Pub Assigned by Date Created Gene Symbol_s_
OMIM:100800 ACHONDROPLASIA NCBIGene:2261 FIBROBLAST GROWTH FACTOR RECEPTOR 3 GENO1 FGFR3 HP:0000006 Autosomal dominant inheritance HP:0030674 Antenatal onset ECO:0000011 genetic interaction evidence Occasional female female NOT NOT Original Description 17.02.2009 GENO1
Orphanet:232288 Alpha-thalassemia-related diseases NCBIGene:12166 Bmpr1a GENO2 FGFR3 HP:0002378 Hand tremor HP:0003623 Neonatal onset IEA IEA Occasional female female NOT NOT Original Description 17.02.2009 GENO2

Chocolate Chip Cookies (serves 12)

Ingredients:

  • Eggs
  • Milk
  • Chips
  • Sugar
  • Butter
  • Lotta Love
@DoctorBud
DoctorBud / AM_vs_LaTeX.md
Last active March 26, 2017 21:34
Comparison of AsciiMath syntax vs LaTeX syntax

Welcome to Smartdown

Smartdown is an extension of Markdown that includes several additions:

  • The ability to have input, output, and calculation cells that react to user input. Smartdown's cells are similar to those in most spreadsheets.
  • Additional media embedding support including Tweets, SVG, Video.
  • Integration of P5JS, PlotlyJS, and a GraphViz-compatible viewer.

Math Support

Currently, Smartdown uses LaTeX-style math syntax, so the following formula:

@DoctorBud
DoctorBud / flare.json
Created March 30, 2017 20:08
flare.json
{
"name": "flare",
"children": [
{
"name": "analytics",
"children": [
{
"name": "cluster",
"children": [
{"name": "AgglomerativeCluster", "size": 3938},

Simple Example of multiple biological data source acquisition

This notebook is intended as a starting point for other researchers and domain experts to explore and experiment with various data sources and how they can be utilized to build pipelines to support a Blackboard architecture that can address important science. Our initial modest goals are to focus on the Translator competency questions and begin to incorporate and integrate those data sources we anticipate being useful.

Typical Structure

This Notebook, and those that are cloned from it, will follow a typical structure like this:

  • Background
source target value
Homo sapiens animalqtldb 1
Homo sapiens cgd 1
Homo sapiens clinvar 1
Homo sapiens coriell 1
Homo sapiens ctd 1
Homo sapiens gwascatalog 1
Homo sapiens hpoa 1
Homo sapiens kegg 1
Homo sapiens mgi 1

Sankey diagram

This Sankey diagram shows a correspondence between difference species (taxa?) and their associated Model Organism Database or other data source.


function addCss(cssCode) {
var styleElement = document.createElement("style");
  styleElement.type = "text/css";
  if (styleElement.styleSheet) {
@DoctorBud
DoctorBud / sankey.js
Last active April 29, 2017 00:56
sankey.js
function addCss(cssCode) {
var styleElement = document.createElement("style");
styleElement.type = "text/css";
if (styleElement.styleSheet) {
styleElement.styleSheet.cssText = cssCode;
} else {
styleElement.appendChild(document.createTextNode(cssCode));
}
document.getElementsByTagName("head")[0].appendChild(styleElement);
}