Skip to content

Instantly share code, notes, and snippets.

View trvrb's full-sized avatar

Trevor Bedford trvrb

View GitHub Profile
@trvrb
trvrb / clades.json
Last active June 28, 2023 14:15
ncov-clades-schematic
{
"name": "19A",
"color": "#462EB9",
"children": [
{
"name": "20A",
"color": "#4580CA",
"children": [
{
"name": "20B",
@trvrb
trvrb / ceirr-data.json
Last active February 21, 2020 01:52
CEIRR Network
{
"nodes": [
{
"name": "Bedford"
},
{
"name": "Bloom"
},
{
"name": "Cobey"
@trvrb
trvrb / .block
Last active July 29, 2019 05:50 — forked from mbostock/.block
Arc Tween
license: gpl-3.0
@trvrb
trvrb / d3-multichord.js
Last active January 3, 2018 00:11
VEG Network
(function (global, factory) {
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('d3-array'), require('d3-path')) :
typeof define === 'function' && define.amd ? define(['exports', 'd3-array', 'd3-path'], factory) :
(factory((global.d3 = global.d3 || {}),global.d3,global.d3));
}(this, function (exports,d3Array,d3Path) { 'use strict';
var cos = Math.cos;
var sin = Math.sin;
var pi = Math.PI;
var halfPi = pi / 2;
@trvrb
trvrb / graph.json
Last active June 13, 2017 23:51
Network of Bedford lab projects
{
"nodes": [
{
"id": "Alli",
"type": "member",
"img": "http://bedford.io/images/team/allison-black.jpg"
},
{
"id": "Sidney",
"type": "member",
@trvrb
trvrb / beast_checkpoint.rb
Last active December 15, 2015 14:49
Ruby script to restart BEAST runs. This constructs a new XML control file from the original control file and the last logged parameter values.
#!/usr/bin/ruby
# Designed to allow checkpointing of BEAST output files
# Input: beast_analysis.xml output_file_1.log output_file_2.log ... tree_file.trees
# Expect at least 3 files
# This matches column names in log files to parameter names in the original XML to set initial conditions
xml_filename = ARGV.shift
tree_filename = ARGV.pop
log_filenames = ARGV
@trvrb
trvrb / Rakefile
Last active December 14, 2015 08:19
Rakefile for LaTex. Collects all .tex in a directory and runs `pdflatex` and `bibtex` as necessary to produce complete PDFs.
# Rakefile to collect all .tex files in a directory and run `pdflatex` and `bibtex` as needed to
# produce PDF output. If a .tex file is updated `pdflatex -draftmode` will be run to produce new
# .aux and .log files. These are used to determine whether `bibtex` needs to be run. If so `bibtex`
# will always need to be followed by `pdflatex -draftmode`. With fully updated .aux and .bbl in
# hand, a final `pdflatex` is run. The only hole in the logic I've found is that, when making a
# small revision, this will run `pdflatex -draftmode` then `pdflatex` when only `pdflatex` is
# required.
#
# Run `rake` to compile PDFs and `rake clean` to remove the intermediary cruft
@trvrb
trvrb / collect-nodes.rb
Created July 30, 2012 15:22
Ruby script to collate nodes and attributes from a BEAST MCC file
#!/usr/bin/ruby
# This script reads through an MCC tree and reads out tip attributes
# Converting these to a more parsable tab-deliminated format
# Relies on each label existing for every node
# Load tree from file
filename = ARGV[0]
infile = File.new(filename, "r")
tree = ""
@trvrb
trvrb / index.html
Created July 20, 2012 14:46
Testing layout.pack
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js ~ Treemap</title>
<script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<style type="text/css">
@import url("http://mbostock.github.com/d3/style.css?1.10.0");
@trvrb
trvrb / d3.js ~ Treemap.htm
Created July 20, 2012 14:27 — forked from jasondavies/d3.js ~ Treemap.htm
Testing layout.pack transitioning
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="content-type" content="text/html;charset=utf-8">
<title>d3.js ~ Treemap</title>
<script type="text/javascript" src="http://mbostock.github.com/d3/d3.js"></script>
<style type="text/css">
@import url("http://mbostock.github.com/d3/style.css?1.10.0");